pub fn l2_regularisation(weights: &[f64], lambda: f64) -> f64
Compute L2 regularisation loss contribution.
Returns 0.5 * lambda * sum(w^2) for all elements of weights.
0.5 * lambda * sum(w^2)
weights