Skip to content

lit_sb3.wrappers.action_noise

source module lit_sb3.wrappers.action_noise

Classes

source class ActionNoiseWrapper(env: gym.Env, noise_std: float = 0.1)

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

Add Gaussian noise to the action (without telling the agent).

Useful to test the robustness of the control.

:param env: Gym environment. :param noise_std: Standard deviation of the Gaussian noise.

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

source method ActionNoiseWrapper.step(action: np.ndarray) → tuple[ObsType, SupportsFloat, bool, bool, dict[str, Any]]