chainer.functions.leaky_relu¶
-
chainer.functions.
leaky_relu
(x, slope=0.2)[source]¶ Leaky Rectified Linear Unit function.
This function is expressed as
\[f(x)=\max(x, ax),\]where \(a\) is a configurable slope value.
Parameters: - x (
Variable
ornumpy.ndarray
orcupy.ndarray
) – Input variable. A \((s_1, s_2, ..., s_N)\)-shaped float array. - slope (float) – Slope value \(a\).
Returns: Output variable. A \((s_1, s_2, ..., s_N)\)-shaped float array.
Return type: Example
>>> x = np.array([[-1, 0], [2, -3], [-2, 1]], 'f') >>> x array([[-1., 0.], [ 2., -3.], [-2., 1.]], dtype=float32) >>> F.leaky_relu(x, slope=0.2).data array([[-0.2 , 0. ], [ 2. , -0.60000002], [-0.40000001, 1. ]], dtype=float32)
- x (