class_docstr: Generate scale and offset based on running mean and stddev along axis=0
  
  offset = running mean
  scale = 1 / (stddev + 0.1) / 3 (i.e. 3x stddev = +/- 1.0)
docstr: Update running mean and variance (this is an exact method)
  Args:
      x: NumPy array, shape = (N, obs_dim)
  
  see: https://stats.stackexchange.com/questions/43159/how-to-calculate-pooled-
         variance-of-two-groups-given-known-group-variances-mean
docstr_tok: ["Update","running","mean","and","variance","(","this","is","an","exact","method",")","Args",":","x",":","NumPy","array",",","shape","=","(","N",",","obs_dim",")","see",":","https",":","\/\/stats.stackexchange.com\/questions\/43159\/how-to-calculate-pooled-","variance-of-two-groups-given-known-group-variances-mean"]
code: def update(self, x):
      """Update running mean and variance (this is an exact method)
      Args:
          x: NumPy array, shape = (N, obs_dim)
  
      see: https://stats.stackexchange.com/questions/43159/how-to-calculate-pooled-
             variance-of-two-groups-given-known-group-variances-mean
      """
      if self.first_pass:
          self.means = np.mean(x, axis=0)
          self.vars = np.var(x, axis=0)
          self.cnt = x.shape[0]
          self.first_pass = False
      else:
          n = x.shape[0]
          new_data_var = np.var(x, axis=0)
          new_data_mean = np.mean(x, axis=0)
          new_data_mean_sq = np.square(new_data_mean)
          new_means = (
              (self.means * self.cnt) + (new_data_mean * n)
          ) / (self.cnt + n)
          self.vars = (
              (self.cnt * (self.vars + np.square(self.means)))
              + (n * (new_data_var + new_data_mean_sq))
          ) / (self.cnt + n) - np.square(new_means)
          self.vars = np.maximum(
              0.0, self.vars
          )  # occasionally goes negative, clip
          self.means = new_means
          self.cnt += n
  
imports: import numpy
  import scipy.signal
label_desc: Use image node_id 2 for calling the Scaler obj's underlying member method code with example usage: obj.update(x) without return types