ptrendx commented on a change in pull request #18325:
URL: https://github.com/apache/incubator-mxnet/pull/18325#discussion_r425969856



##########
File path: python/mxnet/optimizer/lars.py
##########
@@ -252,6 +253,13 @@ def fused_step(self, indices, weights, grads, states):
                 wd = wds[i]
                 lr = lrs[i]
                 lr *= self._get_lars(index, weight, grad, wd)
+                # normal SGD picks up momentum correction by default,
+                # so need to modify the momentum to undo that.
+                # The correction term is previous_lr / current_lr.
+                kwargs['momentum'] = (self.momentum * (self.last_lr / lr)) \

Review comment:
       Thanks, done




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to