Skip to content

lit_sb3.wrappers.atari.max_and_skip

source module lit_sb3.wrappers.atari.max_and_skip

Classes

  • MaxAndSkipEnv — Return only every skip-th frame (frameskipping).

source class MaxAndSkipEnv(env: gym.Env, skip: int = 4)

Bases : gym.Wrapper[np.ndarray, int, np.ndarray, int]

Return only every skip-th frame (frameskipping).

and return the max between the two last frames.

Parameters

  • env : gym.Env — Environment to wrap

  • skip : int — Number of skip-th frame The same action will be taken skip times.

Attributes

  • metadata : dict[str, Any] — attr:Env :attr:metadata.

  • render_mode : str | None — attr:Env :attr:render_mode.

  • spec : EnvSpec | None — attr:Env :attr:spec attribute with the WrapperSpec if the wrapper inherits from EzPickle.

  • action_space : spaces.Space[ActType] | spaces.Space[WrapperActType] — attr:Env :attr:action_space unless overwritten then the wrapper :attr:action_space is used.

  • observation_space : spaces.Space[ObsType] | spaces.Space[WrapperObsType] — attr:Env :attr:observation_space unless overwritten then the wrapper :attr:observation_space is used.

  • unwrapped : Env[ObsType, ActType] — Returns the base environment of the wrapper.

  • np_random_seed : int | None — attr:np_random_seed.

  • np_random : np.random.Generator — attr:Env :attr:np_random attribute.

Methods

  • step — Step the environment with the given action.

source method MaxAndSkipEnv.step(action: int) → AtariStepReturn

Step the environment with the given action.

Repeat action, sum reward, and max over last observations.

Parameters

  • action : int — the action

Returns

  • AtariStepReturn — observation, reward, terminated, truncated, information