提交 27328555 编写于 作者: G GaoWei8 提交者: cyj1986

Fix brelu op doc: x, name and out. (#1199)

* Fix brelu op doc
test=document_preview

* fix brelu doc
test=document_preview

* fix brelu doc
test=document_preview
上级 f6796924
...@@ -6,15 +6,19 @@ brelu ...@@ -6,15 +6,19 @@ brelu
.. py:function:: paddle.fluid.layers.brelu(x, t_min=0.0, t_max=24.0, name=None) .. py:function:: paddle.fluid.layers.brelu(x, t_min=0.0, t_max=24.0, name=None)
BRelu 激活函数 BReLU 激活函数
.. math:: out=max(min(x,tmin),tmax) .. math:: out=min(max(x,t\_min),t\_max)
参数: 参数:
- **x** (Variable) - BReluoperator的输入 - **x** (Variable) - 该OP的输入为多维Tensor。数据类型为float32,float64。
- **t_min** (FLOAT|0.0) - BRelu的最小值 - **t_min** (float, 可选) - BRelu的最小值,默认值为0.0。
- **t_max** (FLOAT|24.0) - BRelu的最大值 - **t_max** (float, 可选) - BRelu的最大值,默认值为24.0。
- **name** (str|None) - 该层的名称(可选)。如果设置为None,该层将被自动命名 - **name** (str, 可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为None。
返回: 输出为Tensor,与 ``x`` 维度相同、数据类型相同。
返回类型: Variable
**代码示例:** **代码示例:**
...@@ -22,11 +26,12 @@ BRelu 激活函数 ...@@ -22,11 +26,12 @@ BRelu 激活函数
.. code-block:: python .. code-block:: python
import paddle.fluid as fluid import paddle.fluid as fluid
x = fluid.layers.data(name="x", shape=[2,3,16,16], dtype="float32") import numpy as np
y = fluid.layers.brelu(x, t_min=1.0, t_max=20.0)
input_brelu = np.array([[-1,6],[1,15.6]])
with fluid.dygraph.guard():
x = fluid.dygraph.to_variable(input_brelu)
y = fluid.layers.brelu(x, t_min=1.0, t_max=10.0)
print(y.numpy())
#[[ 1. 6.]
#[ 1. 10.]]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册