提交 7da34185 编写于 作者: G GaoWei8 提交者: hong19860320

Fix elu op doc (#1222)

* Fix elu op doc
test=document_preview

* fix elu
test=document_preview
上级 15064bb7
...@@ -7,31 +7,31 @@ elu ...@@ -7,31 +7,31 @@ elu
ELU激活层(ELU Activation Operator) ELU激活层(ELU Activation Operator)
根据 https://arxiv.org/abs/1511.07289 对输入张量中每个元素应用以下计算。 根据 https://arxiv.org/abs/1511.07289 对输入Tensor中每个元素应用以下计算。
.. math:: .. math::
\\out=max(0,x)+min(0,α∗(e^{x}−1))\\ \\out=max(0,x)+min(0,α∗(e^{x}−1))\\
参数: 参数:
- x(Variable)- ELU operator的输入 - **x** (Variable) - 该OP的输入为多维Tensor。数据类型为float32或float64。
- alpha(float|1.0)- ELU的alpha值 - **alpha** (float, 可选) - ELU的alpha值,默认值为1.0。
- name (str|None) -这个层的名称(可选)。如果设置为None,该层将被自动命名 - **name** (str, 可选) - 该参数供开发人员打印调试信息时使用,具体用法请参见 :ref:`api_guide_Name`,默认值为None
返回: ELU操作符的输出 返回: 输出为Tensor,与 ``x`` 维度相同、数据类型相同。
返回类型: 输出(Variable) 返回类型: Variable
**代码示例** **代码示例**
.. code-block:: python .. code-block:: python
import paddle.fluid as fluid import paddle.fluid as fluid
x = fluid.layers.data(name="x", shape=[3,10,32,32], dtype="float32") import numpy as np
y = fluid.layers.elu(x, alpha=0.2)
input_elu = np.array([[-1,6],[1,15.6]])
with fluid.dygraph.guard():
x = fluid.dygraph.to_variable(input_elu)
y = fluid.layers.elu(x, alpha=0.2)
print(y.numpy())
# [[-0.12642411 6. ]
# [ 1. 15.6 ]]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册