未验证 提交 b7637899 编写于 作者: Z zhupengyang 提交者: GitHub

LeakyReLU doc (#2330)

上级 7d856f9c
......@@ -8,4 +8,5 @@ activation
.. toctree::
:maxdepth: 1
activation_cn/LeakyReLU_cn.rst
activation_cn/Sigmoid_cn.rst
.. _cn_api_nn_LeakyReLU:
LeakyReLU
-------------------------------
.. py:class:: paddle.nn.LeakyReLU(alpha=0.01, name=None)
ReLU (Rectified Linear Unit)激活层
.. math::
\\Out = max(x, alpha*x)\\
其中,:math:`x` 为输入的 Tensor
参数
::::::::::
- alpha (float,可选) - :math:`x < 0` 时的斜率。默认值为0.01。
- name (str, 可选) - 操作的名称(可选,默认值为None)。更多信息请参见 :ref:`api_guide_Name`。
形状:
- input: 任意形状的Tensor。
- output: 和input具有相同形状的Tensor。
代码示例
:::::::::
.. code-block:: python
import paddle
import numpy as np
paddle.enable_imperative()
lrelu = paddle.nn.LeakyReLU()
x = paddle.imperative.to_variable(np.array([-2, 0, 1], 'float32'))
out = lrelu(x) # [-0.02, 0, 1]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册