Skip to content

Add spaces-tagged data types #37

@ryanjulian

Description

@ryanjulian

This would add tagged data types (and no-copy constructors) for the concrete types represented by a spaces.

This would allow users to perform important akro operations without needing an explicit reference to the space (and saves a lot of type checking). It would also get rid of a lot of helper/misc functions.

This idea is best illustrated by an example:

import akro

dspace = akro.Dict({'foo': akro.Discrete(3)})

d = {'foo': 1}  # a regular old dict
d_tagged = akro.tag(d, dspace)  # returns an akro.dict (inherits from dict) which stores dspace
d_flat = d_tagged.flatten()  # now I can flatten without any args
d_flat.to_tf_placeholder()  # sure, why not?
e = dspace.sample()  # returns an akro.dict by default)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions