Summary:
Fixes https://github.com/pytorch/pytorch/issues/15530
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15840
Differential Revision:
D13608503
Pulled By: goldsborough
fbshipit-source-id:
aad17c110d64cbe2c126bccd36d228e4108ffa9a
continue;
}
- auto update = options.learning_rate_ * p.grad();
+ auto update = p.grad();
if (options.weight_decay_ > 0) {
- update += options.learning_rate_ * options.weight_decay_ * p;
+ update += options.weight_decay_ * p;
}
if (options.momentum_ != 0) {
}
NoGradGuard guard;
- p.add_(-update);
+ p.add_(-options.learning_rate_ * update);
}
iteration_ += 1;
}