class_docstr: Maintains an exponential moving average for a value.
  
  Note this module uses debiasing by default. If you don't want this please use
  an alternative implementation.
  
  This module keeps track of a hidden exponential moving average that is
  initialized as a vector of zeros which is then normalized to give the average.
  This gives us a moving average which isn't biased towards either zero or the
  initial value. Reference (https://arxiv.org/pdf/1412.6980.pdf)
  
  Initially:
  
      hidden_0 = 0
  
  Then iteratively:
  
      hidden_i = (hidden_{i-1} - value) * (1 - decay)
      average_i = hidden_i / (1 - decay^i)
  
  Attributes:
    average: Variable holding average. Note that this is None until the first
      value is passed.
docstr: Creates a debiased moving average module.
  
  Args:
    decay: The decay to use. Note values close to 1 result in a slow decay
      whereas values close to 0 result in faster decay, tracking the input
      values more closely.
    name: Name of the module.
code: def __init__(
      self, decay: types.FloatLike, name: Optional[str] = None
  ):
      """Creates a debiased moving average module.
  
      Args:
        decay: The decay to use. Note values close to 1 result in a slow decay
          whereas values close to 0 result in faster decay, tracking the input
          values more closely.
        name: Name of the module.
      """
      super().__init__(name=name)
      self._decay = decay
      self._counter = tf.Variable(
          0, trainable=False, dtype=tf.int64, name="counter"
      )
  
      self._hidden = None
      self.average = None
  
file_path: sonnet/sonnet/src/moving_averages.py
imports: from typing import Optional
  from sonnet.src import metrics
  from sonnet.src import once
  from sonnet.src import types
  import tensorflow
label_desc: Use image node_id 1 to create a new ExponentialMovingAverage object from inherited base classes: metrics with example: obj = ExponentialMovingAverage(decay, name)