Skip to main content

gradient_descent_clipped

Function gradient_descent_clipped 

Source
pub fn gradient_descent_clipped(
    f: impl Fn(&[f64]) -> f64,
    grad: impl Fn(&[f64]) -> Vec<f64>,
    x0: Vec<f64>,
    lr: f64,
    max_norm: f64,
    tol: f64,
    max_iter: u32,
) -> OptResult
Expand description

Gradient descent with gradient clipping.