Skip to content

[rllib] Add support for Tuple Preprocessor #1336

Closed
@cathywu

Description

Add support in observation preprocessors for gym.spaces.Tuple observations. The current workaround is to register a custom preprocessor for this as follows (requires PR #1334).

from ray.rllib.models.preprocessors import Preprocessor

class TuplePreprocessor(Preprocessor):

    def _init(self):
        self.shape = self._obs_space.shape

    def transform(self, observation):
        return np.concatenate(observation)

And then is registered as follows:

from ray.rllib.models import ModelCatalog
ModelCatalog.register_preprocessor(env_name, TuplePreprocessor)

Activity

ericl

ericl commented on Jan 17, 2018

@ericl
Contributor

RLlib now provides a tuple preprocessor automatically for tuple spaces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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

    [rllib] Add support for Tuple Preprocessor · Issue #1336 · ray-project/ray