Skip to content

Commit 5b556ce

Browse files
authored
docs: 修改 LRScheduler bug (#6324)
诺姆衰减,相关算法请参考 《Attention Is All You Need》 ..改成 相关算法来源于...;中文文档增加方法介绍state_dict(),set_state_dict(state_dict)。
1 parent ffbded2 commit 5b556ce

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/api/paddle/optimizer/lr/LRScheduler_cn.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LRScheduler
99

1010
目前在 paddle 中基于该基类,已经实现了 14 种策略,分别为:
1111

12-
* :code:`NoamDecay`:诺姆衰减,相关算法请参考 `《Attention Is All You Need》 <https://arxiv.org/pdf/1706.03762.pdf>`_ 。请参考 :ref:`cn_api_paddle_optimizer_lr_NoamDecay`。
12+
* :code:`NoamDecay`:诺姆衰减,相关算法来源于 `《Attention Is All You Need》 <https://arxiv.org/pdf/1706.03762.pdf>`_ 。请参考 :ref:`cn_api_paddle_optimizer_lr_NoamDecay`。
1313

1414
* :code:`ExponentialDecay`:指数衰减,即每次将当前学习率乘以给定的衰减率得到下一个学习率。请参考 :ref:`cn_api_paddle_optimizer_lr_ExponentialDecay`。
1515

@@ -88,10 +88,20 @@ get_lr()
8888

8989
上述给出了实现 ``StepLR`` 的一个简单示例。
9090

91-
_state_keys()
91+
state_keys()
9292
'''''''''
9393

9494
该函数通过定义字典 ``self.keys`` 来设置 ``optimizer.state_dict()`` 时的存储对象,默认情况下:``self.keys=['last_epoch', 'last_lr']``,其中 ``last_epoch``
9595
是当前的 epoch 数,``last_lr`` 是当前的学习率值。
9696

9797
如果需要改变默认的行为,用户需要重写该方法,来重新定义字典 ``self.keys``,一般无需重新设置。
98+
99+
state_dict()
100+
'''''''''
101+
102+
以 ``dict`` 形式返回调度器的状态。
103+
104+
set_state_dict(state_dict)
105+
'''''''''
106+
107+
加载调度器状态。

0 commit comments

Comments
 (0)