MCPcopy Index your code
hub / github.com/tensorflow/tfjs / doMovingAverage

Method doMovingAverage

tfjs-layers/src/layers/normalization.ts:376–383  ·  view source on GitHub ↗
(variable: LayerVariable, value: Tensor, momentum: number)

Source from the content-addressed store, hash-verified

374
375 const doMovingAverage =
376 (variable: LayerVariable, value: Tensor, momentum: number): void => {
377 tfc.tidy(() => {
378 const decay = 1 - momentum;
379 const origValue = variable.read();
380 const updateDelta = tfc.mul(tfc.sub(origValue, value), decay);
381 variable.write(tfc.sub(origValue, updateDelta));
382 });
383 };
384
385 // Perform updates to moving mean and moving variance for training.
386 // Porting Note: In PyKeras, these updates to `movingMean` and

Callers

nothing calls this directly

Calls 5

tidyMethod · 0.80
mulMethod · 0.80
subMethod · 0.80
readMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected