original_docstring: Compute leaky integrator.
  
      Like ema, but expectation value depends on decay time constant.
  
      Args:
          decay: 'sum' to sum up values, otherwise decay in [0, 1]
          prev_val: previous value of accumulator
          new_val: new value
      Returns:
          updated accumulator
      
docstring: Compute leaky integrator.
  Like ema, but expectation value depends on decay time constant.
docstring_tokens: Compute leaky integrator . Like ema but expectation value depends on decay time constant .
code: def leak(decay, prev_val, new_val):
      """Compute leaky integrator.
  
      Like ema, but expectation value depends on decay time constant.
  
      Args:
          decay: 'sum' to sum up values, otherwise decay in [0, 1]
          prev_val: previous value of accumulator
          new_val: new value
      Returns:
          updated accumulator
      """
      if decay == 'sum':
          return prev_val + new_val
      return decay * prev_val + new_val
code_tokens: def leak ( decay , prev_val , new_val ) : if decay == 'sum' : return prev_val + new_val return decay * prev_val + new_val
short_docstring: Compute leaky integrator.
short_docstring_tokens: Compute leaky integrator .
comment: """Compute leaky integrator.
  
      Like ema, but expectation value depends on decay time constant.
  
      Args:
          decay: 'sum' to sum up values, otherwise decay in [0, 1]
          prev_val: previous value of accumulator
          new_val: new value
      Returns:
          updated accumulator
      """