Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Set _scale in Trainer using Optimizer rescale_grad #14593

Merged
merged 1 commit into from
Apr 3, 2019

Conversation

yuxihu
Copy link
Member

@yuxihu yuxihu commented Apr 2, 2019

Currently _scale is set based on the value of rescale_grad in optimizer_params when creating Trainer. However, users can use optimizer_params to create an Optimizer object and pass this object to Trainer. In this case, _scale may not be correctly set since optimizer_params is None.

In this PR, we set _scale by reading the rescale_grad value from optimizer after optimizer is initialized in Trainer.

@piyushghai
Copy link
Contributor

That's a good catch @yuxihu.

@mxnet-label-bot Add [Gluon, pr-awaiting-review]

@marcoabreu marcoabreu added Gluon pr-awaiting-review PR is waiting for code review labels Apr 2, 2019
@yuxihu
Copy link
Member Author

yuxihu commented Apr 2, 2019

@eric-haibin-lin @apeforest Please help review.

Copy link
Contributor

@larroy larroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eric-haibin-lin eric-haibin-lin merged commit 53743d6 into apache:master Apr 3, 2019
@yuxihu yuxihu deleted the trainer_scale branch April 3, 2019 18:34
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Gluon pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants