Parametric ReLU function.
It accepts two arguments: an input
xand a weight array
Wand 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 \(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.