tf.contrib.distributions.assign_moving_mean_variance
Stay organized with collections
Save and categorize content based on your preferences.
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 -like Variable representing the exponentially weighted
moving mean. Same shape as variance_var and value .
|
variance_var
|
float -like Variable representing the
exponentially weighted moving variance. Same shape as mean_var and
value .
|
value
|
float -like Tensor . Same shape as mean_var and variance_var .
|
decay
|
A float -like Tensor . The moving mean decay. Typically close to
1. , e.g., 0.999 .
|
name
|
Optional name of the returned operation.
|
Returns |
mean_var
|
Variable representing the value -updated exponentially weighted
moving mean.
|
variance_var
|
Variable representing the value -updated
exponentially weighted moving variance.
|
Raises |
TypeError
|
if mean_var does not have float type dtype .
|
TypeError
|
if mean_var , variance_var , value , decay have different
base_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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.distributions.assign_moving_mean_variance\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/distributions/python/ops/moving_stats.py#L35-L104) |\n\nCompute exponentially weighted moving {mean,variance} of a streaming value. \n\n tf.contrib.distributions.assign_moving_mean_variance(\n mean_var, variance_var, value, decay, name=None\n )\n\nThe `value` updated exponentially weighted moving `mean_var` and\n`variance_var` are given by the following recurrence relations: \n\n variance_var = decay * (variance_var + (1-decay) * (value - mean_var)**2)\n mean_var = decay * mean_var + (1 - decay) * value\n\n| **Note:** `mean_var` is updated *after* `variance_var`, i.e., `variance_var` uses the lag-1 mean.\n\nFor derivation justification, see \\[Finch (2009; Eq. 143)\\]\\[1\\].\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| `mean_var` | `float`-like `Variable` representing the exponentially weighted moving mean. Same shape as `variance_var` and `value`. |\n| `variance_var` | `float`-like `Variable` representing the exponentially weighted moving variance. Same shape as `mean_var` and `value`. |\n| `value` | `float`-like `Tensor`. Same shape as `mean_var` and `variance_var`. |\n| `decay` | A `float`-like `Tensor`. The moving mean decay. Typically close to `1.`, e.g., `0.999`. |\n| `name` | Optional name of the returned operation. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|----------------|-------------------------------------------------------------------------------------|\n| `mean_var` | `Variable` representing the `value`-updated exponentially weighted moving mean. |\n| `variance_var` | `Variable` representing the `value`-updated exponentially weighted moving variance. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-------------|------------------------------------------------------------------------------|\n| `TypeError` | if `mean_var` does not have float type `dtype`. |\n| `TypeError` | if `mean_var`, `variance_var`, `value`, `decay` have different `base_dtype`. |\n\n\u003cbr /\u003e\n\n#### References\n\n\\[1\\]: Tony Finch. Incremental calculation of weighted mean and variance.\n*Technical Report* , 2009.\n\u003chttp://people.ds.cam.ac.uk/fanf2/hermes/doc/antiforgery/stats.pdf\u003e"]]