chainer.functions.prelu(x, W)[source]

Parametric ReLU function.

It accepts two arguments: an input x and a weight array W and computes the output as \(PReLU(x) = \max(x, W*x)\), 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 \(a\) 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 \(W\) has the shape of \((2, 3, 4)\), \(x\) must have the shape of \((B, 2, 3, 4, S1, ..., SN)\) where B is batch size and the number of trailing S’s is arbitrary non-negative integer.

  • x (Variable) – Input variable. Its first argument is assumed to be the minibatch dimension.
  • W (Variable) – Weight variable.

Output variable

Return type:


See also