![]() |
Compute exponentially weighted moving {mean,variance} of a streaming value.
tf.contrib.distributions.assign_moving_mean_variance(
mean_var,
variance_var,
value,
decay,
name=None
)
The value
updated exponentially weighted moving mean_var
and
variance_var
are given by the following recurrence relations:
variance_var = decay * (variance_var + (1-decay) * (value - mean_var)**2)
mean_var = decay * mean_var + (1 - decay) * value
For derivation justification, see [Finch (2009; Eq. 143)][1].
Args:
mean_var
:float
-likeVariable
representing the exponentially weighted moving mean. Same shape asvariance_var
andvalue
.variance_var
:float
-likeVariable
representing the exponentially weighted moving variance. Same shape asmean_var
andvalue
.value
:float
-likeTensor
. Same shape asmean_var
andvariance_var
.decay
: Afloat
-likeTensor
. The moving mean decay. Typically close to1.
, e.g.,0.999
.name
: Optional name of the returned operation.
Returns:
mean_var
:Variable
representing thevalue
-updated exponentially weighted moving mean.variance_var
:Variable
representing thevalue
-updated exponentially weighted moving variance.
Raises:
TypeError
: ifmean_var
does not have float typedtype
.TypeError
: ifmean_var
,variance_var
,value
,decay
have differentbase_dtype
.
References
[1]: Tony Finch. Incremental calculation of weighted mean and variance. Technical Report, 2009. http://people.ds.cam.ac.uk/fanf2/hermes/doc/antiforgery/stats.pdf