shrink

Function shrink 

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

Applies the Shrink function element-wise.

shrink(x) = x - bias if x > lambda, x + bias if x < -lambda, 0 otherwise

ยงArguments

  • lambda: the lambda value for the Shrink formulation.
  • bias: the bias value for the Shrink formulation.