class_docstr: This wrapper will normalize immediate rewards s.t. their exponential moving average has a fixed variance.
  
  The exponential moving average will have variance :math:`(1 - \gamma)^2`.
  
  Note:
      The scaling depends on past trajectories and rewards will not be scaled correctly if the wrapper was newly
      instantiated or the policy was changed recently.
class_docstr_tok: ["This","wrapper","will","normalize","immediate","rewards","s.t",".","their","exponential","moving","average","has","a","fixed","variance",".","The","exponential","moving","average","will","have","variance",":","math",":","`","(","1","-","\\gamma",")","^2","`",".","Note",":","The","scaling","depends","on","past","trajectories","and","rewards","will","not","be","scaled","correctly","if","the","wrapper","was","newly","instantiated","or","the","policy","was","changed","recently","."]
docstr: This wrapper will normalize immediate rewards s.t. their exponential moving average has a fixed variance.
  
  Args:
      env (env): The environment to apply the wrapper
      epsilon (float): A stability parameter
      gamma (float): The discount factor that is used in the exponential moving average.
docstr_tok: ["This","wrapper","will","normalize","immediate","rewards","s.t",".","their","exponential","moving","average","has","a","fixed","variance",".","Args",":","env","(","env",")",":","The","environment","to","apply","the","wrapper","epsilon","(","float",")",":","A","stability","parameter","gamma","(","float",")",":","The","discount","factor","that","is","used","in","the","exponential","moving","average","."]
code: def __init__(
      self,
      env: gym.Env,
      gamma: float = 0.99,
      epsilon: float = 1e-8,
  ):
      """This wrapper will normalize immediate rewards s.t. their exponential moving average has a fixed variance.
  
      Args:
          env (env): The environment to apply the wrapper
          epsilon (float): A stability parameter
          gamma (float): The discount factor that is used in the exponential moving average.
      """
      super().__init__(env)
      self.num_envs = getattr(env, "num_envs", 1)
      self.is_vector_env = getattr(env, "is_vector_env", False)
      self.return_rms = RunningMeanStd(shape=())
      self.returns = np.zeros(self.num_envs)
      self.gamma = gamma
      self.epsilon = epsilon
  
file_path: gym/gym/wrappers/normalize.py
imports: import numpy
  import gym
label_desc: Use image node_id 1 to create a new NormalizeReward object from inherited base classes: gym.core with example: obj = NormalizeReward(env, gamma, epsilon)