MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / sufficient_statistics_v2

Function sufficient_statistics_v2

tensorflow/python/ops/nn_impl.py:1210–1235  ·  view source on GitHub ↗

Calculate the sufficient statistics for the mean and variance of `x`. These sufficient statistics are computed using the one pass algorithm on an input that's optionally shifted. See: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Computing_shifted_data Args: x: A `T

(x, axes, shift=None, keepdims=False, name=None)

Source from the content-addressed store, hash-verified

1208
1209@tf_export("nn.sufficient_statistics", v1=[])
1210def sufficient_statistics_v2(x, axes, shift=None, keepdims=False, name=None):
1211 """Calculate the sufficient statistics for the mean and variance of `x`.
1212
1213 These sufficient statistics are computed using the one pass algorithm on
1214 an input that's optionally shifted. See:
1215 https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Computing_shifted_data
1216
1217 Args:
1218 x: A `Tensor`.
1219 axes: Array of ints. Axes along which to compute mean and variance.
1220 shift: A `Tensor` containing the value by which to shift the data for
1221 numerical stability, or `None` if no shift is to be performed. A shift
1222 close to the true mean provides the most numerically stable results.
1223 keepdims: produce statistics with the same dimensionality as the input.
1224 name: Name used to scope the operations that compute the sufficient stats.
1225
1226 Returns:
1227 Four `Tensor` objects of the same type as `x`:
1228
1229 * the count (number of elements to average over).
1230 * the (possibly shifted) sum of the elements in the array.
1231 * the (possibly shifted) sum of squares of the elements in the array.
1232 * the shift by which the mean must be corrected or None if `shift` is None.
1233 """
1234 return sufficient_statistics(
1235 x=x, axes=axes, shift=shift, keep_dims=keepdims, name=name)
1236
1237
1238@tf_export("nn.normalize_moments")

Callers

nothing calls this directly

Calls 1

sufficient_statisticsFunction · 0.85

Tested by

no test coverage detected