提交 c77bf395 编写于 作者: D DuYao 提交者: hong

update inverseTimeDecay Chinese document (#1319)

* update inverseTimeDecay, test=develop

* update, test=document_fix

* update inverse, test=document_fix

* update, test=document_fix

* update, test=document_fix

* update, test=document_fix

* update, test=document_fix
上级 6ecd6327
...@@ -5,26 +5,37 @@ InverseTimeDecay ...@@ -5,26 +5,37 @@ InverseTimeDecay
.. py:class:: paddle.fluid.dygraph.InverseTimeDecay(learning_rate, decay_steps, decay_rate, staircase=False, begin=0, step=1, dtype='float32') .. py:class:: paddle.fluid.dygraph.InverseTimeDecay(learning_rate, decay_steps, decay_rate, staircase=False, begin=0, step=1, dtype='float32')
在初始学习率上运用逆时衰减 该接口提供反时限学习率衰减的功能
训练模型时,最好在训练过程中降低学习率。通过执行该函数,将对初始学习率运用逆向衰减函数 反时限学习率衰减计算方式如下
.. code-block:: text 当staircase为False时,计算公式为:
if staircase == True: .. math::
decayed_learning_rate = learning_rate / (1 + decay_rate * floor(global_step / decay_step))
else:
decayed_learning_rate = learning_rate / (1 + decay_rate * global_step / decay_step)
参数: decayed\_learning\_rate = \frac{learning\_rate}{1 + decay\_rate * \frac{global\_step}{decay\_step}}
- **learning_rate** (Variable|float)-初始学习率
- **decay_steps** (int)-见以上衰减运算 当staircase为True时,计算公式为:
- **decay_rate** (float)-衰减率。见以上衰减运算
- **staircase** (Boolean)-若为True,按间隔区间衰减学习率。默认:False .. math::
- **begin** (int) - 起始步,默认为0。
- **step** (int) - 步大小,默认为1。 decayed\_learning\_rate = \frac{learning\_rate}{1 + decay\_rate * math.floor(\frac{global\_step}{decay\_step})}
- **dtype** (str) - 学习率的dtype,默认为‘float32’
式中,
- :math:`decayed\_learning\_rate` : 衰减后的学习率。
式子中各参数详细介绍请看参数说明。
参数:
- **learning_rate** (Variable|float) - 初始学习率值。如果类型为Variable,则为shape为[1]的Tensor,数据类型为float32或float64;也可以是python的float类型。
- **decay_steps** (int) - 衰减步数,见以上衰减运算式子。
- **decay_rate** (float)- 衰减率。见以上衰减运算。
- **staircase** (bool,可选) - 指定是否按阶梯状衰减。若为True, 学习率变化曲线呈阶梯状。若为False,学习率变化值曲线为平滑的曲线。默认值为False。
- **begin** (int,可选) - 起始步,即以上运算式子中global_step的初始化值。默认值为0。
- **step** (int,可选) - 步大小,即以上运算式子中global_step的每次的增量值,使得global_step随着训练的次数递增。默认值为1。
- **dtype** (str,可选) - 初始化学习率变量的数据类型,可以为"float32", "float64"。默认值为"float32"。
返回: 无
**代码示例** **代码示例**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册