Skip to main content

project_l2

Function project_l2 

Source
pub fn project_l2(perturbation: &[f64], epsilon: f64) -> Vec<f64>
Expand description

Project perturbation onto the L2 ball of radius epsilon.

If ‖δ‖₂ > ε, the vector is scaled down to have norm exactly ε.