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:
transform_observation()[source]

Update in-place pre-allocated transformed observation buffer with the flattened observation of the wrapped environment.

Return type:

None

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:
transform_action(action)[source]

Update in-place the pre-allocated action buffer of the wrapped environment with the un-flattened action.

Parameters:

action (ndarray[Any, dtype[float64]])

Return type:

None