class_docstr: Normalize mean and variance of values based on empirical values.
  
  Args:
      shape (int or tuple of int): Shape of input values except batch axis.
      batch_axis (int): Batch axis.
      eps (float): Small value for stability.
      dtype (dtype): Dtype of input values.
      until (int or None): If this arg is specified, the link learns input
          values until the sum of batch sizes exceeds it.
class_docstr_tok: ["Normalize","mean","and","variance","of","values","based","on","empirical","values",".","Args",":","shape","(","int","or","tuple","of","int",")",":","Shape","of","input","values","except","batch","axis",".","batch_axis","(","int",")",":","Batch","axis",".","eps","(","float",")",":","Small","value","for","stability",".","dtype","(","dtype",")",":","Dtype","of","input","values",".","until","(","int","or","None",")",":","If","this","arg","is","specified",",","the","link","learns","input","values","until","the","sum","of","batch","sizes","exceeds","it","."]
docstr: Normalize mean and variance of values based on emprical values.
  
  Args:
      x (ndarray or Variable): Input values
      update (bool): Flag to learn the input values
  
  Returns:
      ndarray or Variable: Normalized output values
docstr_tok: ["Normalize","mean","and","variance","of","values","based","on","emprical","values",".","Args",":","x","(","ndarray","or","Variable",")",":","Input","values","update","(","bool",")",":","Flag","to","learn","the","input","values","Returns",":","ndarray","or","Variable",":","Normalized","output","values"]
code: def forward(self, x, update=True):
      """Normalize mean and variance of values based on emprical values.
  
      Args:
          x (ndarray or Variable): Input values
          update (bool): Flag to learn the input values
  
      Returns:
          ndarray or Variable: Normalized output values
      """
  
      if update:
          self.experience(x)
  
      normalized = (x - self._mean) * self._std_inverse
      if self.clip_threshold is not None:
          normalized = torch.clamp(
              normalized, -self.clip_threshold, self.clip_threshold
          )
      return normalized
  
file_path: pfrl/pfrl/nn/empirical_normalization.py
imports: import numpy
  import torch
  from torch import nn
label_desc: Use image node_id 6 for calling the EmpiricalNormalization obj's underlying member method code with example usage: obj.forward(x, update) and returns: normalized