Normalization

This module implements two block transformations for normalizing the observation and action spaces of the environment respectively.

class gym_jiminy.common.wrappers.normalize.NormalizeObservation(env)[source]

Bases: BaseTransformObservation[ObsT, ObsT, ActT], Generic[ObsT, ActT]

Normalize (without clipping) the observation space of a pipeline environment according to its pre-defined bounds rather than statistics over collected data. Unbounded elements if any are left unchanged.

Warning

All leaves of the observation space must have type gym.spaces.Box.

Parameters:
  • env (InterfaceJiminyEnv[ObsT, ActT]) – Base or already wrapped jiminy environment.

  • kwargs – Extra keyword arguments for multiple inheritance.

transform_observation()[source]

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

Return type:

None

class gym_jiminy.common.wrappers.normalize.NormalizeAction(env)[source]

Bases: BaseTransformAction[ActT, ObsT, ActT], Generic[ObsT, ActT]

Normalize (without clipping) the action space of a pipeline environment according to its pre-defined bounds rather than statistics over collected data. Unbounded elements if any are left unchanged.

Warning

All leaves of the action space must have type gym.spaces.Box.

Parameters:
  • env (InterfaceJiminyEnv[ObsT, ActT]) – Base or already wrapped jiminy environment.

  • kwargs – Extra keyword arguments for multiple inheritance.

transform_action(action)[source]

Update in-place the pre-allocated action buffer of the wrapped environment with the de-normalized action.

Parameters:

action (ActT)

Return type:

None