Skip to main content

prelu

Function prelu 

pub fn prelu<const D: usize>(tensor: Tensor<D>, alpha: Tensor<1>) -> Tensor<D>
Expand description

Applies Parametric ReLu activation function as described in the paper Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification.

  • The tensor is assumed to be of shape [batch_size, channels, ...].
  • alpha is assumed to be of shape [channels] or [1].

PReLu(x) = max(0,x) + alpha * min(0,x)