mlx.nn.PReLU

Contents

mlx.nn.PReLU#

class PReLU(num_parameters=1, init=0.25)#
Applies the element-wise parametric ReLU.

Applies \(\max(0, x) + a * \min(0, x)\) element wise, where \(a\) is an array.

See prelu() for the functional equivalent.

Parameters:
  • num_parameters – number of \(a\) to learn. Default: 1

  • init – the initial value of \(a\). Default: 0.25

Methods