Closed
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)
Metadata
Assignees
Labels
No labels
Activity
ericl commentedon Jan 17, 2018
RLlib now provides a tuple preprocessor automatically for tuple spaces