Flattening¶
This module implements a block transformation for flattening observation space of the environment.
- class gym_jiminy.common.wrappers.flatten.FlattenObservation(env, dtype=None)[source]¶
Bases:
BaseTransformObservation
[ndarray
[Any
,dtype
[float64
]],ObsT
,ActT
],Generic
[ObsT
,ActT
]Flatten the observation space of a pipeline environment. It will appear as a simple one-dimension vector.
Warning
All leaves of the observation space must have type gym.spaces.Box.
- Parameters:
env (InterfaceJiminyEnv[ObsT, ActT]) – Environment to wrap.
dtype (dtype[Any] | None | type[Any] | _SupportsDType[dtype[Any]] | str | tuple[Any, int] | tuple[Any, SupportsIndex | Sequence[SupportsIndex]] | list[Any] | _DTypeDict | tuple[Any, Any]) – Numpy dtype of the flattened observation. If None, the most appropriate dtype to avoid lost of information if possible will be picked, following standard coercion rules. See np.promote_types for details. Optional: None by default.
- class gym_jiminy.common.wrappers.flatten.FlattenAction(env, dtype=None)[source]¶
Bases:
BaseTransformAction
[ndarray
[Any
,dtype
[float64
]],ObsT
,ActT
],Generic
[ObsT
,ActT
]Flatten the action space of a pipeline environment. It will appear as a simple one-dimension vector.
Warning
All leaves of the action space must have type gym.spaces.Box.
- Parameters:
env (InterfaceJiminyEnv[ObsT, ActT]) – Environment to wrap.
dtype (dtype[Any] | None | type[Any] | _SupportsDType[dtype[Any]] | str | tuple[Any, int] | tuple[Any, SupportsIndex | Sequence[SupportsIndex]] | list[Any] | _DTypeDict | tuple[Any, Any]) – Numpy dtype of the flattened action. If None, the most appropriate dtype to avoid lost of information if possible will be picked, following standard coercion rules. See np.promote_types for details. Optional: None by default.