Skip to content

Concatenate operation for Spaces #4

@ryanjulian

Description

@ryanjulian

This is a common use case which leads to a lot of unnecessary munging.

e.g.

    def observation_space(self):
        task_ub, task_lb = self.task_space.bounds
        env_ub, env_lb = super(OneHotMultiTaskEnv,
                               self).observation_space.bounds
        return spaces.Box(
            np.concatenate([task_ub, env_ub]),
            np.concatenate([task_lb, env_lb]))

Could just be

    def observation_space(self):
        task = self.task_space
        obs = super(OneHotMultiTaskEnv,
                               self).observation_space
        return spaces.Box.concatenate(task, obs)

This will require some thought about how non-alike spaces interact, and should provide a feature for concatenating members of these spaces easily and consistent with this spec, once a space is described as a concatenation of other spaces.

Imported from ryanjulian/rllab#2

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