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: Learn input values without computing the output values of them
docstr_tok: ["Learn","input","values","without","computing","the","output","values","of","them"]
code: def experience(self, x):
      """Learn input values without computing the output values of them"""
  
      if self.until is not None and self.count >= self.until:
          return
  
      count_x = x.shape[self.batch_axis]
      if count_x == 0:
          return
  
      self.count += count_x
      rate = count_x / self.count.float()
      assert rate > 0
      assert rate <= 1
  
      var_x, mean_x = torch.var_mean(
          x, axis=self.batch_axis, keepdims=True, unbiased=False
      )
      delta_mean = mean_x - self._mean
      self._mean += rate * delta_mean
      self._var += rate * (
          var_x - self._var + delta_mean * (mean_x - self._mean)
      )
  
      # clear cache
      self._cached_std_inverse = None
  
file_path: pfrl/pfrl/nn/empirical_normalization.py
imports: import numpy
  import torch
  from torch import nn
label_desc: Use image node_id 5 for calling the EmpiricalNormalization obj's underlying member method code with example usage: obj.experience(x) without return types