chainer.functions.prelu¶
-
chainer.functions.
prelu
(x, W)[source]¶ Parametric ReLU function.
It accepts two arguments: an input
x
and a weight arrayW
and computes the output as PReLU(x)=max, where * is an elementwise multiplication for each sample in the batch.When the PReLU function is combined with two-dimensional convolution, the elements of parameter W are typically shared across the same filter of different pixels. In order to support such usage, this function supports the shape of parameter array that indicates leading dimensions of input arrays except the batch dimension.
For example, if W has the shape of (2, 3, 4), x must have the shape of (B, 2, 3, 4, S_1, ..., S_N) where B is the batch size and the number of trailing S’s N is an arbitrary non-negative integer.
- Parameters
x (
Variable
or N-dimensional array) – Input variable. Its first argument is assumed to be the minibatch dimension.W (
Variable
or N-dimensional array) – Weight variable.
- Returns
Output variable
- Return type
See also