eric-haibin-lin commented on a change in pull request #16885: Multi Precision
Lamb Update operator
URL: https://github.com/apache/incubator-mxnet/pull/16885#discussion_r355082525
##########
File path: tests/python/unittest/test_optimizer.py
##########
@@ -472,16 +481,21 @@ def update(self, index, weight, grad, state):
var_hat = var / (1. - mx.nd.power(self.beta2, t))
g = mean_hat / (mx.nd.sqrt(var_hat) + self.epsilon) + wd * weight
+
r2 = g.norm()
# calculate lamb_trust_ratio
r = 1. if r1 == 0. or r2 == 0. else r1 / r2
lr *= r
# update weight
weight[:] -= lr * g
+ if use_multi_precision:
Review comment:
why adding this?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services