• Compute the moving average of a variable.

    Without zeroDebias, the moving average operation is defined by: v += delta where delta = (1 - decay) * (x - v)

    With zeroDebias (default), the delta term is scaled to debias the effect of the (assumed) zero-initialization of v. delta /= (1 - decay ^ step)

    For more details on the zero-debiasing algorithm, see: https://arxiv.org/abs/1412.6980

    Note that this function is completely stateless and does not keep track of step count. The step count needs to be maintained by the caller and passed in as step.

    Type Parameters

    Parameters

    • v: TensorLike | T

      The current moving average value.

    • x: TensorLike | T

      New input value, must have the same shape and dtype as v.

    • decay: number | Scalar

      The decay factor. Typical values are 0.95 and 0.99.

    • Optional step: number | Scalar

      Step count.

    • Optional zeroDebias: boolean

    Returns T

    The new moving average value.

    Doc

Generated using TypeDoc