The current moving average value.
New input value, must have the same shape and dtype as v
.
The decay factor. Typical values are 0.95 and 0.99.
Optional
step: number | ScalarStep count.
Optional
zeroDebias: booleanThe new moving average value.
Generated using TypeDoc
Compute the moving average of a variable.
Without zeroDebias, the moving average operation is defined by:
v += delta
wheredelta = (1 - decay) * (x - v)
With zeroDebias (default), the
delta
term is scaled to debias the effect of the (assumed) zero-initialization ofv
.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
.