From f597cfb038bdef1ca89c9b2270f22ccc79c12f15 Mon Sep 17 00:00:00 2001 From: Qi Li Date: Wed, 26 Aug 2020 10:37:17 +0800 Subject: [PATCH] fix prelu, test=develop (#2478) --- doc/fluid/api_cn/nn_cn/activation_cn.rst | 2 +- .../activation_cn/{PRelu_cn.rst => PReLU_cn.rst} | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) rename doc/fluid/api_cn/nn_cn/activation_cn/{PRelu_cn.rst => PReLU_cn.rst} (80%) diff --git a/doc/fluid/api_cn/nn_cn/activation_cn.rst b/doc/fluid/api_cn/nn_cn/activation_cn.rst index 3cab2b771..934b80222 100644 --- a/doc/fluid/api_cn/nn_cn/activation_cn.rst +++ b/doc/fluid/api_cn/nn_cn/activation_cn.rst @@ -16,7 +16,7 @@ activation activation_cn/LeakyReLU_cn.rst activation_cn/LogSigmoid_cn.rst activation_cn/LogSoftmax_cn.rst - activation_cn/PRelu_cn.rst + activation_cn/PReLU_cn.rst activation_cn/ReLU_cn.rst activation_cn/ReLU6_cn.rst activation_cn/SELU_cn.rst diff --git a/doc/fluid/api_cn/nn_cn/activation_cn/PRelu_cn.rst b/doc/fluid/api_cn/nn_cn/activation_cn/PReLU_cn.rst similarity index 80% rename from doc/fluid/api_cn/nn_cn/activation_cn/PRelu_cn.rst rename to doc/fluid/api_cn/nn_cn/activation_cn/PReLU_cn.rst index 3d558d84a..d36cee798 100644 --- a/doc/fluid/api_cn/nn_cn/activation_cn/PRelu_cn.rst +++ b/doc/fluid/api_cn/nn_cn/activation_cn/PReLU_cn.rst @@ -1,10 +1,10 @@ -.. _cn_api_nn_PRelu: +.. _cn_api_nn_PReLU: -PRelu +PReLU ------------------------------- -.. py:class:: paddle.nn.PRelu(num_parameters=1, init=0.25, weight_attr=None, name=None) +.. py:class:: paddle.nn.PReLU(num_parameters=1, init=0.25, weight_attr=None, name=None) -PRelu激活层(PRelu Activation Operator)。计算公式如下: +PReLU激活层(PReLU Activation Operator)。计算公式如下: 如果使用近似计算: @@ -23,7 +23,7 @@ PRelu激活层(PRelu Activation Operator)。计算公式如下: 形状: :::::::::: - - input: 任意形状的Tensor。 + - input: 任意形状的Tensor,默认数据类型为float32。 - output: 和input具有相同形状的Tensor。 代码示例 @@ -35,13 +35,14 @@ PRelu激活层(PRelu Activation Operator)。计算公式如下: import numpy as np paddle.disable_static() + paddle.set_default_dtype("float64") data = np.array([[[[-2.0, 3.0, -4.0, 5.0], [ 3.0, -4.0, 5.0, -6.0], [-7.0, -8.0, 8.0, 9.0]], [[ 1.0, -2.0, -3.0, 4.0], [-5.0, 6.0, 7.0, -8.0], - [ 6.0, 7.0, 8.0, 9.0]]]], 'float32') + [ 6.0, 7.0, 8.0, 9.0]]]], 'float64') x = paddle.to_tensor(data) m = paddle.nn.PReLU(1, 0.25) out = m(x) -- GitLab