MCPcopy Create free account
hub / github.com/tensorflow/lingvo / _GetGlobalGradScale

Method _GetGlobalGradScale

lingvo/core/learner.py:395–432  ·  view source on GitHub ↗

Returns a scaling factor for all gradients according to their norm. In case there are NaN or Inf values the function will return 0.0. Args: all_grad_norm: A scalar representing the total norm of all vars. has_nan_or_inf: A scalar of 0 or 1, indicating whether there is any NaN o

(self, all_grad_norm, has_nan_or_inf)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

ScaleGradientsMethod · 0.95

Calls 1

FPropDefaultThetaMethod · 0.45

Tested by

no test coverage detected