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

update optimizer doc for 2.0 #2424

Merged
merged 22 commits into from
Sep 2, 2020
Merged

update optimizer doc for 2.0 #2424

merged 22 commits into from
Sep 2, 2020

Conversation

MRXLT
Copy link
Contributor

@MRXLT MRXLT commented Aug 19, 2020

完善Adam、Adamax、Optimizer、RMSProp op
新增AdamW op

Optimizer类
参数parameter_list 变为 parameters
参数regularization 变为weight_decay,传入float类型时为L2Decay的系数
set_dict接口变为set_state_dict
动态图下新增step接口,替代minimize

AdamOptimzer变为Adam、AdamaxOptimizer变为Adamax、RMSPropOptimizer变为RMSProp,其余改动与基类Optimizer相同。

新增AdamW类
继承自DecoupledWeightDecay、Adam

英文文档PR:PaddlePaddle/Paddle#26288
英文文档修改PR:PaddlePaddle/Paddle#26711

image

image

image

image

image

doc/fluid/api_cn/optimizer_cn/Adam_cn.rst Outdated Show resolved Hide resolved
doc/fluid/api_cn/optimizer_cn/Adam_cn.rst Outdated Show resolved Hide resolved
doc/fluid/api_cn/optimizer_cn/Adam_cn.rst Show resolved Hide resolved
doc/fluid/api_cn/optimizer_cn/Adam_cn.rst Outdated Show resolved Hide resolved
doc/fluid/api_cn/optimizer_cn/Adam_cn.rst Outdated Show resolved Hide resolved

参数:
- **learning_rate** (float|Variable,可选) - 学习率,用于参数更新的计算。可以是一个浮点型值或者一个值为浮点型的Variable,默认值为0.001
Copy link
Collaborator

Choose a reason for hiding this comment

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

loat|LearningRateDecay 还是 float|Tensor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

改为loat|LearningRateDecay

doc/fluid/api_cn/optimizer_cn/Adamax_cn.rst Outdated Show resolved Hide resolved
doc/fluid/api_cn/optimizer_cn/Adamax_cn.rst Show resolved Hide resolved
@MRXLT MRXLT changed the title [WIP]update optimizer doc for 2.0 update optimizer doc for 2.0 Aug 25, 2020
AdamW
-------------------------------

.. py:class:: paddle.optimizer.AdamW(learning_rate=0.001, beta1=0.9, beta2=0.999, epsilon=1e-08, parameters=None, weight_decay=0.01, grad_clip=None, name=None, lazy_mode=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

没有写【apply_decay_param_fun】

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修复


返回:当前步骤的学习率。

返回类型:float
Copy link
Collaborator

Choose a reason for hiding this comment

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

不需要单独写返回类型,直接写到返回中即可,如:
返回:float,当前步骤的学习率。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修复


返回:当前步骤的学习率。

返回类型:float
Copy link
Collaborator

Choose a reason for hiding this comment

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

同上

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修复


返回: tuple(optimize_ops, params_grads),其中optimize_ops为参数优化OP列表;param_grads为由(param, param_grad)组成的列表,其中param和param_grad分别为参数和参数的梯度。在静态图模式下,该返回值可以加入到 ``Executor.run()`` 接口的 ``fetch_list`` 参数中,若加入,则会重写 ``use_prune`` 参数为True,并根据 ``feed`` 和 ``fetch_list`` 进行剪枝,详见 ``Executor`` 的文档。

返回类型: tuple
Copy link
Collaborator

Choose a reason for hiding this comment

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

这行返回类型可以删除

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修复


返回:当前步骤的学习率。

返回类型:float
Copy link
Collaborator

Choose a reason for hiding this comment

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

同上,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修复


返回: tuple(optimize_ops, params_grads),其中optimize_ops为参数优化OP列表;param_grads为由(param, param_grad)组成的列表,其中param和param_grad分别为参数和参数的梯度。在静态图模式下,该返回值可以加入到 ``Executor.run()`` 接口的 ``fetch_list`` 参数中,若加入,则会重写 ``use_prune`` 参数为True,并根据 ``feed`` 和 ``fetch_list`` 进行剪枝,详见 ``Executor`` 的文档。

返回类型: tuple
Copy link
Collaborator

Choose a reason for hiding this comment

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

这行也可以删除

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修复


返回:当前步骤的学习率。

返回类型:float
Copy link
Collaborator

Choose a reason for hiding this comment

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

同上

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修复

Copy link
Collaborator

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

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

LGTM

@MRXLT MRXLT merged commit 1bbf08b into PaddlePaddle:develop Sep 2, 2020
@MRXLT MRXLT deleted the 2.0-op branch September 2, 2020 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants