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

【Hackathon 5 No.117】add parameter value for thresholded_relu #6403

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
5 changes: 3 additions & 2 deletions docs/api/paddle/nn/ThresholdedReLU_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@

ThresholdedReLU
-------------------------------
.. py:class:: paddle.nn.ThresholdedReLU(threshold=1.0, name=None)
.. py:class:: paddle.nn.ThresholdedReLU(threshold=1.0, value=0.0, name=None)

Thresholded ReLU 激活层

.. math::

ThresholdedReLU(x) = \begin{cases}
x, \text{if } x > threshold \\
0, \text{otherwise}
value, \text{otherwise}
\end{cases}

其中,:math:`x` 为输入的 Tensor。

参数
::::::::::
- **threshold** (float,可选) - ThresholdedReLU 激活计算公式中的 threshold 值。默认值为 1.0。
- **value** (float,可选) - ThresholdedReLU 激活计算公式中的 value 值。默认值为 0.0。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

形状
Expand Down
5 changes: 3 additions & 2 deletions docs/api/paddle/nn/functional/thresholded_relu_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
thresholded_relu
-------------------------------

.. py:function:: paddle.nn.functional.thresholded_relu(x, threshold=1.0, name=None)
.. py:function:: paddle.nn.functional.thresholded_relu(x, threshold=1.0, value=0.0, name=None)

thresholded relu 激活层。计算公式如下:

.. math::

thresholded\_relu(x) = \begin{cases}
x, \text{if } x > threshold \\
0, \text{otherwise}
value, \text{otherwise}
\end{cases}

其中,:math:`x` 为输入的 Tensor。
Expand All @@ -21,6 +21,7 @@ thresholded relu 激活层。计算公式如下:
::::::::::
- **x** (Tensor) - 输入的 ``Tensor``,数据类型为:float32、float64。
- **threshold** (float,可选) - thresholded_relu 激活计算公式中的 threshold 值。默认值为 1.0。
- **value** (float,可选) - thresholded_relu 激活计算公式中的 value 值。默认值为 0.0。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
Expand Down