Skip to content

[Docathon][Fix note No.17-18] #7172

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/api/paddle/optimizer/LBFGS_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ LBFGS 具体原理参考书籍 Jorge Nocedal, Stephen J. Wright, Numerical Optim


.. note::
当前仅支持动态图模式下使用。
当前仅支持动态图模式下使用。


参数
Expand Down Expand Up @@ -52,11 +52,11 @@ COPY-FROM: paddle.optimizer.LBFGS
方法
::::::::::::
step(closure)
'''''''''
''''''''''''''

.. note::

该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。
该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。

执行一次 LBFGS 优化器(包含若干 iter)并进行参数更新。

Expand All @@ -74,11 +74,11 @@ COPY-FROM: paddle.optimizer.LBFGS.step


state_dict()
'''''''''
''''''''''''''

.. note::

该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。
该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。

将优化器当前参数状态保存到字典。

Expand Down
21 changes: 10 additions & 11 deletions docs/api/paddle/optimizer/Lamb_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ LAMB(Layer-wise Adaptive Moments optimizer for Batching training)优化器
- **parameters** (list,可选) - 指定优化器需要优化的参数。在动态图模式下必须提供该参数;在静态图模式下默认值为 None,这时所有的参数都将被优化。
- **grad_clip** (GradientClipBase,可选) – 梯度裁剪的策略,支持三种裁剪策略::ref:`paddle.nn.ClipGradByGlobalNorm <cn_api_paddle_nn_ClipGradByGlobalNorm>` 、 :ref:`paddle.nn.ClipGradByNorm <cn_api_paddle_nn_ClipGradByNorm>` 、 :ref:`paddle.nn.ClipGradByValue <cn_api_paddle_nn_ClipGradByValue>`。默认值为 None,此时将不进行梯度裁剪。
- **exclude_from_weight_decay_fn** (function) - 当某个参数作为输入该函数返回值为 True 时,为该参数跳过权重衰减。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name` ,一般无需设置,默认值为 None。

.. note::
目前 ``Lamb`` 不支持 Sparse Parameter Optimization(稀疏参数优化)。
Expand All @@ -54,7 +54,7 @@ step()

.. note::

该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。
该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。

执行一次优化器并进行参数更新。

Expand All @@ -67,7 +67,7 @@ step()
COPY-FROM: paddle.optimizer.Lamb.step

minimize(loss, startup_program=None, parameters=None, no_grad_set=None)
'''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

为网络添加反向计算过程,并根据反向计算所得的梯度,更新 parameters 中的 Parameters,最小化网络损失值 loss。

Expand All @@ -87,11 +87,10 @@ minimize(loss, startup_program=None, parameters=None, no_grad_set=None)
COPY-FROM: paddle.optimizer.Lamb.minimize

clear_grad()
'''''''''
'''''''''''''

.. note::
该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。

该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。

清除需要优化的参数的梯度。

Expand All @@ -100,11 +99,11 @@ clear_grad()
COPY-FROM: paddle.optimizer.Lamb.clear_grad

set_lr(value)
'''''''''
''''''''''''''

.. note::

该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。
该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。

手动设置当前 ``optimizer`` 的学习率。当使用_LRScheduler 时,无法使用该 API 手动设置学习率,因为这将导致冲突。

Expand All @@ -121,11 +120,11 @@ set_lr(value)
COPY-FROM: paddle.optimizer.Lamb.set_lr

set_lr_scheduler(scheduler)
'''''''''
''''''''''''''''''''''''''''

.. note::

该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。
该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。

手动设置当前 ``optimizer`` 的学习率为 LRScheduler 类。

Expand All @@ -146,7 +145,7 @@ get_lr()

.. note::

该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。
该 API 只在 `Dygraph <../../user_guides/howto/dygraph/DyGraph.html>`_ 模式下生效。

获取当前步骤的学习率。当不使用_LRScheduler 时,每次调用的返回值都相同,否则返回当前步骤的学习率。

Expand Down