obtain_normalization_statistics

class maze.core.wrappers.observation_normalization.observation_normalization_utils.obtain_normalization_statistics(env: Union[maze.core.env.maze_env.MazeEnv, maze.core.wrappers.observation_normalization.observation_normalization_wrapper.ObservationNormalizationWrapper], n_samples: int)

Obtain the normalization statistics of a given environment.

  • Returns None, if the ObservationNormalizationWrapper is not implemented

  • Returns the loaded statistics, if available

  • Runs the estimation and returns the newly calculated statistics, if not loaded previously

Parameters
  • env – Environment with applied ObservationNormalizationWrapper (function returns None immediately if this is not the case.

  • n_samples – Number of samples (=steps) to collect normalization statistics at the beginning of the training.

Returns

The normalization statistics or None if the ObservationNormalizationWrapper is not implemented by the env.