stable_learning_control.disturbers.observation_random_noise_disturber

Contains a small gymnasium wrapper that can be used to disturb the observation of a gymnasium environment with normally distributed random noise (i.e. mean and std).

Module Contents

Classes

ObservationRandomNoiseDisturber

A gymnasium wrapper that can be used to disturb the observation of a gymnasium

class stable_learning_control.disturbers.observation_random_noise_disturber.ObservationRandomNoiseDisturber(env, mean, std)[source]

Bases: gymnasium.ObservationWrapper

A gymnasium wrapper that can be used to disturb the observation of a gymnasium environment with normally distributed random noise.

mean

The mean of the noise normal distribution.

Type:

float

std

The standard deviation of the noise normal distribution.

Type:

float

Initialise the ObservationRandomNoiseDisturber object.

Parameters:
  • env (gym.Env) – The gymnasium environment.

  • mean (float) – The mean of the noise normal distribution.

  • std (float) – The standard deviation of the noise normal distribution.

observation(observation)[source]

Add normally distributed random noise to the observation.

Parameters:

observation (np.ndarray) – The observation.

Returns:

The observation with added noise.

Return type:

np.ndarray