garage.envs.wrappers.max_and_skip module

Max and Skip wrapper for gym.Env.

class MaxAndSkip(env, skip=4)[source]

Bases: gym.core.Wrapper

Max and skip wrapper for gym.Env.

It returns only every skip-th frame. Action are repeated and rewards are sum for the skipped frames.

It also takes element-wise maximum over the last two consecutive frames, which helps algorithm deal with the problem of how certain Atari games only render their sprites every other game frame.

Parameters:
  • env – The environment to be wrapped.
  • skip – The environment only returns skip-th frame.
reset()[source]

gym.Env reset.

step(action)[source]

gym.Env step.

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