celu¶
- paddle.nn.functional. celu ( x, alpha=1.0, name=None ) [source]
-
celu activation.
\[celu(x) = max(0, x) + min(0, \alpha * (e^{x/\alpha}-1))\]- Parameters
-
x (Tensor) – The input Tensor with data type float32, float64.
alpha (float, optional) – The ‘alpha’ value of the CELU formulation. Default is 1.0.
name (str, optional) – For details, please refer to Name. Generally, no setting is required. Default: None.
- Returns
-
A Tensor with the same data type and shape as
x
.
Examples
import paddle import paddle.nn.functional as F x = paddle.to_tensor([[-1., 6.], [1., 15.6]]) out = F.celu(x, alpha=0.2) # [[-0.19865242, 6. ], # [ 1. , 15.60000038]]