Skip to main content

soft_threshold

Function soft_threshold 

Source
pub fn soft_threshold(x: f64, lambda: f64) -> f64
Expand description

Apply element-wise soft-thresholding: sign(x) * max(|x| - lambda, 0).

Used as a proximal operator in iterative shrinkage-thresholding algorithms.