class_docstr: Abstract base class for normalization strategies.
  
  Provides functionality for:
      - normalizing gym.Box observations as well as for normalizing the originally defined observation space.
      - setting and getting the currently employed normalization statistics.
      - interface definition for estimating the normalization statistics from a list of observations
      - interface definition for normalizing a given gym.Box (np.ndarray) observation
  
  :param observation_space: The observations space to be normalized.
  :param clip_range: The minimum and maximum value allowed for an observation.
  :param axis: Defines the axis along which to compute normalization statistics
class_docstr_tok: ["Abstract","base","class","for","normalization","strategies",".","Provides","functionality","for",":","-","normalizing","gym.Box","observations","as","well","as","for","normalizing","the","originally","defined","observation","space",".","-","setting","and","getting","the","currently","employed","normalization","statistics",".","-","interface","definition","for","estimating","the","normalization","statistics","from","a","list","of","observations","-","interface","definition","for","normalizing","a","given","gym.Box","(","np.ndarray",")","observation",":","param","observation_space",":","The","observations","space","to","be","normalized",".",":","param","clip_range",":","The","minimum","and","maximum","value","allowed","for","an","observation",".",":","param","axis",":","Defines","the","axis","along","which","to","compute","normalization","statistics"]
docstr: Set normalization statistics.
  
  :param stats: A dictionary containing the respective observation normalization statistics.
docstr_tok: ["Set","normalization","statistics",".",":","param","stats",":","A","dictionary","containing","the","respective","observation","normalization","statistics","."]
code: def set_statistics(self, stats: StatisticsType) -> None:
      """Set normalization statistics.
  
      :param stats: A dictionary containing the respective observation normalization statistics.
      """
  
      results = dict()
  
      for stats_key, values in stats.items():
          results[stats_key] = np.asarray(values, dtype=np.float32)
  
          # assert that broadcasting is possible with provided statistics
          obs_shape = self._original_observation_space.shape
          assert (
              np.broadcast(
                  np.ones(shape=obs_shape), results[stats_key]
              ).shape
              == obs_shape
          )
  
      self._statistics = results
  
file_path: maze/maze/core/wrappers/observation_normalization/normalization_strategies/base.py
imports: import copy
  from abc import ABC, abstractmethod
  from typing import Dict, List, Union, Iterable, Tuple, Optional
  import gym
  import numpy
label_desc: Use image node_id 4 for calling the ObservationNormalizationStrategy obj's underlying member method code with example usage: obj.set_statistics(stats) without return types