花乡芳村:图说最早花市天光墟 最大鲜花批发地

paddle.nn.functional. leaky_relu ( x: Tensor, negative_slope: float = 0.01, name: str | None = None ) Tensor [source]
百度 现在,鲁家村从原来负债150万到现在集体资产个亿,村民人均收入达到35600元。

leaky_relu activation. The calculation formula is:

\[\begin{split}leaky\_relu(x)= \left\{ \begin{array}{rcl} x, & & if \ x >= 0 \\ negative\_slope * x, & & otherwise \\ \end{array} \right.\end{split}\]
Parameters
  • x (Tensor) – The input Tensor with data type float32, float64.

  • negative_slope (float, optional) – Slope of the activation function at \(x < 0\) . Default is 0.01.

  • name (str|None, 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([-2., 0., 1.])
>>> out = F.leaky_relu(x)
>>> print(out)
Tensor(shape=[3], dtype=float32, place=Place(cpu), stop_gradient=True,
[-0.02000000,  0.        ,  1.        ])