Function leaky_relu

pub fn leaky_relu<const D: usize, B>(
    tensor: Tensor<B, D>,
    negative_slope: f64,
) -> Tensor<B, D>
where B: Backend,
Expand description

Applies the leaky rectified linear unit function element-wise.

f(x) =

  • x for x >= 0
  • negative_slope * x if x < 0