Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace NaturalExpDecay, ExponentialDecay, InverseTimeDecay with 2.0 version #54424

Merged
merged 7 commits into from
Jun 27, 2023

Conversation

longranger2
Copy link
Contributor

@longranger2 longranger2 commented Jun 7, 2023

PR types

Others

PR changes

APIs

Description

  • remove the NaturalExpDecay in python/paddle/fluid/dygraph/learning_rate_scheduler.py, the natural_exp_decay in python/paddle/fluid/layers/learning_rate_scheduler.py and use NaturalExpDecay in python/paddle/optimizer/lr.py to replace them.
  • remove the ExponentialDecay in python/paddle/fluid/dygraph/learning_rate_scheduler.py and use ExponentialDecay in python/paddle/optimizer/lr.py to replace it.
  • remove the InverseTimeDecay in python/paddle/fluid/dygraph/learning_rate_scheduler.py and use InverseTimeDecay in python/paddle/optimizer/lr.py to replace it.

@paddle-bot
Copy link

paddle-bot bot commented Jun 7, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Jun 7, 2023
lr = natural_exp_decay(
1.0, lr_decay_steps, lr_scheduler.gamma, True
lr = paddle.optimizer.lr.NaturalExpDecay(
1.0, lr_scheduler.gamma
Copy link
Contributor

Choose a reason for hiding this comment

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

这个地方的return从一个 Tensor变成Class了,需要检查下能否这么改

@@ -181,68 +180,6 @@ def exponential_decay(learning_rate, decay_steps, decay_rate, staircase=False):
return decayed_lr


def natural_exp_decay(learning_rate, decay_steps, decay_rate, staircase=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

目前看 https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/jit/dy2static/utils.py#L122 函数式LRDecay提供了动转静的功能,这里不建议直接移除。这个PR中可以专注把fluid旧的class类型的LRDecay替换并移除。

@paddle-ci-bot
Copy link

paddle-ci-bot bot commented Jun 23, 2023

Sorry to inform you that 68ebf55's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

Copy link
Contributor

@zoooo0820 zoooo0820 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

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

no doc'c changes. LGTM

@jeff41404 jeff41404 merged commit de60c1d into PaddlePaddle:develop Jun 27, 2023
@longranger2 longranger2 deleted the NaturalExpDecay branch July 8, 2023 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants