Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
【PaddlePaddle Hackathon 2】16、doc for rrelu (#4725)
* add cn doc for rrelu * fix doc format * fix doc format * fix paper link * 参数加粗 * fix typo prelu
- Loading branch information
Showing
3 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.. _cn_api_nn_RReLU: | ||
|
||
RReLU | ||
------------------------------- | ||
.. py:class:: paddle.nn.RReLU(lower=1./8., upper=1./3., name=None) | ||
RReLU激活层,应用随机纠正线性单元对神经元激活,参考论文: | ||
`Empirical Evaluation of Rectified Activations in Convolutional Network <https://arxiv.org/abs/1505.00853>`_ 。 | ||
|
||
训练阶段对负斜率进行均匀分布随机采样: | ||
|
||
.. math:: | ||
rrelu(x)= | ||
\left\{ | ||
\begin{array}{rcl} | ||
x, & & if \ x >= 0 \\ | ||
a * x, & & otherwise \\ | ||
\end{array} | ||
\right. | ||
其中,:math:`x` 为输入的 Tensor,:math:`a` 是服从(:math:`lower`,:math:`upper` )均匀分布的随机值。 | ||
|
||
测试阶段负斜率取均匀分布上下边界(:math:`lower` 及 :math:`upper` )的平均值: | ||
|
||
.. math:: | ||
rrelu(x)= | ||
\left\{ | ||
\begin{array}{rcl} | ||
x, & & if \ x >= 0 \\ | ||
(lower + upper) * 0.5 * x, & & otherwise \\ | ||
\end{array} | ||
\right. | ||
其中,:math:`x` 为输入的 Tensor,:math:`lower` 及 :math:`upper` 是随机均匀分布的上下边界。 | ||
|
||
参数 | ||
:::::::::: | ||
- **lower** (float,可选) - 负值斜率的随机值范围下限,`lower` 包含在范围中。支持的数据类型:float。默认值为0.125。 | ||
- **upper** (float,可选) - 负值斜率的随机值范围上限,`upper` 包含在范围中。支持的数据类型:float。默认值为0.333。 | ||
- **name** (str,可选) - 操作的名称(可选,默认值为None)。更多信息请参见 :ref:`api_guide_Name`。 | ||
|
||
形状 | ||
:::::::::: | ||
- **x** (Tensor) – 任意形状的Tensor,默认数据类型为float32。 | ||
- **out** (Tensor) – 和x具有相同形状的Tensor。 | ||
|
||
代码示例 | ||
::::::::: | ||
COPY-FROM: paddle.nn.RRelu:RRelu-example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.. _cn_api_nn_cn_rrelu: | ||
|
||
rrelu | ||
------------------------------- | ||
|
||
.. py:function:: paddle.nn.functional.rrelu(x, lower=1. / 8., upper=1. / 3., training=True, name=None) | ||
rrelu激活函数,应用随机纠正线性单元对神经元激活,参考论文: | ||
`Empirical Evaluation of Rectified Activations in Convolutional Network <https://arxiv.org/abs/1505.00853>`_ 。 | ||
|
||
训练阶段对负斜率进行均匀分布随机采样: | ||
|
||
.. math:: | ||
rrelu(x)= | ||
\left\{ | ||
\begin{array}{rcl} | ||
x, & & if \ x >= 0 \\ | ||
a * x, & & otherwise \\ | ||
\end{array} | ||
\right. | ||
其中,:math:`x` 为输入的 Tensor,:math:`a` 是服从(:math:`lower`,:math:`upper` )均匀分布的随机值。 | ||
|
||
测试阶段负斜率取均匀分布上下边界(:math:`lower` 及 :math:`upper` )的平均值: | ||
|
||
.. math:: | ||
rrelu(x)= | ||
\left\{ | ||
\begin{array}{rcl} | ||
x, & & if \ x >= 0 \\ | ||
(lower + upper) * 0.5 * x, & & otherwise \\ | ||
\end{array} | ||
\right. | ||
其中,:math:`x` 为输入的 Tensor,:math:`lower` 及 :math:`upper` 是随机均匀分布的上下边界。 | ||
|
||
参数 | ||
:::::::::: | ||
- **x** (Tensor) - 输入的 `Tensor` ,数据类型为:float16、float32、float64。 | ||
- **lower** (float,可选) - 负值斜率的随机值范围下限,`lower` 包含在范围中。支持的数据类型:float。默认值为0.125。 | ||
- **upper** (float,可选) - 负值斜率的随机值范围上限,`upper` 包含在范围中。支持的数据类型:float。默认值为0.333。 | ||
- **training** (bool,可选) - 标记是否为训练阶段。 默认: True。 | ||
- **name** (str,可选) - 操作的名称(可选,默认值为None)。更多信息请参见 :ref:`api_guide_Name` 。 | ||
|
||
返回 | ||
:::::::::: | ||
``Tensor`` ,数据类型和形状同 ``x`` 一致。 | ||
|
||
代码示例 | ||
::::::::: | ||
COPY-FROM: paddle.nn.functional.rrelu:rrelu-example |