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).

Classes

ObservationRandomNoiseDisturber

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

Module Contents

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[source]

The mean of the noise normal distribution.

Type:

float

std[source]

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.

mean[source]
std[source]
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