!1896 fix lars weight decay computation error

Merge pull request !1896 from gziyan/fix_lars_weight_decay
This commit is contained in:
mindspore-ci-bot 2020-06-08 17:04:01 +08:00 committed by Gitee
commit eaaf824f18
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ class LARS(Optimizer):
self.learning_rate = optimizer.learning_rate
self.lars = P.LARSUpdate(epsilon, hyperpara, use_clip)
self.reciprocal_scale = 1.0 / loss_scale
self.weight_decay = weight_decay * loss_scale
self.weight_decay = weight_decay
self.cast = P.Cast()
self.decay_flag = tuple(decay_filter(x) for x in self.parameters)
self.lars_flag = tuple(lars_filter(x) for x in self.parameters)