-
Notifications
You must be signed in to change notification settings - Fork 752
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
修改COPY-FROM No.4 optimizer #6005
Conversation
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-6005.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
out.backward() | ||
adam.step() | ||
adam.clear_grad() | ||
COPY-FROM: paddle.optimizer.Adam:code-example1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要在adam源码文件的代码片段中同步加上 :name: code-example1
:name: code-example2
,否则无法展示
sgd.clear_gradients() | ||
scheduler.step() # If you update learning rate each step | ||
# scheduler.step() # If you update learning rate each epoch | ||
COPY-FROM: paddle.optimizer.lr.StepLR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StepLR
是啥...初步看了下,LRScheduler
下的step
方法,在英文源码中没有代码片段,如果想要copy from,首先得在源码中增加相关代码
out.backward() | ||
rmsprop.step() | ||
rmsprop.clear_grad() | ||
COPY-FROM: paddle.optimizer.RMSProp.minimize | ||
|
||
clear_gradients() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有 clear_gradients()
方法,应该是 clear_grad(set_to_zero=True)
clear_gradients() | |
clear_grad(set_to_zero=True) |
out.backward() | ||
rmsprop.step() | ||
rmsprop.clear_gradients() | ||
COPY-FROM: paddle.optimizer.RMSProp.clear_gradients |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COPY-FROM: paddle.optimizer.RMSProp.clear_gradients | |
COPY-FROM: paddle.optimizer.RMSProp.clear_grad |
Signed-off-by: jjyaoao <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
将代码块 .. code-block:: 使用 COPY-FROM 指令代替
PADDLEPADDLE_PR=55238