class_docstr: Maintains cumulative moving mean and std of incoming numpy arrays along axis 0.
  
  Output shapes:
  scalar -> scalar
  vector -> scalar
  matrix -> vector
  
  Implementation adopted from:
  https://github.com/DLR-RM/stable-baselines3/blob/master/stable_baselines3/common/running_mean_std.py
  
  :param epsilon: Ensures numerical stability and avoids division by zero.
class_docstr_tok: ["Maintains","cumulative","moving","mean","and","std","of","incoming","numpy","arrays","along","axis","0",".","Output","shapes",":","scalar","-",">","scalar","vector","-",">","scalar","matrix","-",">","vector","Implementation","adopted","from",":","https",":","\/\/github.com\/DLR-RM\/stable-baselines3\/blob\/master\/stable_baselines3\/common\/running_mean_std.py",":","param","epsilon",":","Ensures","numerical","stability","and","avoids","division","by","zero","."]
docstr: Update cumulative moving statistics.
  
  :param batch_mean: Mean of new incoming data.
  :param batch_var: Variance of new incoming data.
  :param batch_count: Samples contained in new incoming data.
docstr_tok: ["Update","cumulative","moving","statistics",".",":","param","batch_mean",":","Mean","of","new","incoming","data",".",":","param","batch_var",":","Variance","of","new","incoming","data",".",":","param","batch_count",":","Samples","contained","in","new","incoming","data","."]
code: def _update_from_moments(
      self,
      batch_mean: np.ndarray,
      batch_var: np.ndarray,
      batch_count: int,
  ) -> None:
      """Update cumulative moving statistics.
  
      :param batch_mean: Mean of new incoming data.
      :param batch_var: Variance of new incoming data.
      :param batch_count: Samples contained in new incoming data.
      """
      mean_diff = batch_mean - self.mean
      new_count = self._count + batch_count
  
      # cumulative update of mean
      new_mean = self.mean + mean_diff * batch_count / new_count
      # cumulative update of variance
      m_2 = (self.var * self._count) + (batch_var * batch_count)
      m_2 += (
          np.square(mean_diff) * self._count * batch_count / new_count
      )
      new_var = m_2 / new_count
  
      # update statistics
      self.mean = new_mean
      self.var = new_var
      self._count = new_count
  
file_path: maze/maze/core/utils/stats_utils.py
imports: from typing import Optional, Union
  import numpy
label_desc: Use image node_id 3 for calling the CumulativeMovingMeanStd obj's underlying member method code with example usage: obj._update_from_moments(batch_mean, batch_var, batch_count) without return types