class maze.core.wrappers.observation_stack_wrapper.ObservationStackWrapper(*args, **kwds)

An wrapper stacking the observations of multiple subsequent time steps.

Provides functionality for:

  • selecting which observations to stack

  • how many past observations should be stacked

  • stacking deltas with the current step observation (instead of the observations itself)

  • env – Environment/wrapper to wrap.

  • stack_config

    The observation stacking configuration.

    observation: The name (key) of the respective observation keep_original: Bool, indicates weather to keep or remove the original observation from the dictionary. tag: Optional[str], tag to add to observation (e.g. stacked) delta: Bool, if true deltas are stacked to the previous observation stack_steps: Int, number of past steps to be stacked

clone_from(env: maze.core.wrappers.observation_stack_wrapper.ObservationStackWrapper)None

(overrides SimulatedEnvMixin)

implementation of SimulatedEnvMixin.

get_observation_and_action_dicts(maze_state: Optional[Any], maze_action: Optional[Any], first_step_in_episode: bool) → Tuple[Optional[Dict[Union[int, str], Any]], Optional[Dict[Union[int, str], Any]]]

(overrides Wrapper)

If this is the first step in an episode, reset the observation stack.

get_observation_stack() → Dict[str, List[numpy.ndarray]]

Retrieve the observation stack of the wrapper.


The current observation stack of th wrapper.

observation(observation: Dict[str, numpy.ndarray]) → Dict[str, numpy.ndarray]

(overrides ObservationWrapper)

Stack observations.

param observation

The observation to be stacked.


The sacked observation.

reset() → Dict[str, numpy.ndarray]

(overrides ObservationWrapper)

Intercept ObservationWrapper.reset and map observation.

set_observation_stack(observation_stack: Dict[str, List[numpy.ndarray]])None

Set the observation stack of the wrapper.


observation_stack – The observation stack to be set.