pub struct Optimizer<F>where
F: Fn(&Vec<f64>, Vec<AD>) -> Option<Vec<AD>>,{ /* private fields */ }
Expand description
Implementations§
source§impl<F> Optimizer<F>where
F: Fn(&Vec<f64>, Vec<AD>) -> Option<Vec<AD>>,
impl<F> Optimizer<F>where F: Fn(&Vec<f64>, Vec<AD>) -> Option<Vec<AD>>,
pub fn new(data: Matrix, func: F) -> Self
sourcepub fn get_domain(&self) -> Vec<f64>
pub fn get_domain(&self) -> Vec<f64>
Get domain
sourcepub fn get_hyperparam(&self, key: &str) -> Option<&f64>
pub fn get_hyperparam(&self, key: &str) -> Option<&f64>
Get hyperparameter (learning rate or lambda or etc.)
sourcepub fn set_init_param(&mut self, p: Vec<f64>) -> &mut Self
pub fn set_init_param(&mut self, p: Vec<f64>) -> &mut Self
Set initial parameter
sourcepub fn set_max_iter(&mut self, n: usize) -> &mut Self
pub fn set_max_iter(&mut self, n: usize) -> &mut Self
Set maximum iteration
sourcepub fn set_method(&mut self, method: OptMethod) -> &mut Self
pub fn set_method(&mut self, method: OptMethod) -> &mut Self
Set optimization method
sourcepub fn set_lambda_init(&mut self, lambda_init: f64) -> &mut Self
pub fn set_lambda_init(&mut self, lambda_init: f64) -> &mut Self
Set initial lambda for LevenbergMarquardt
sourcepub fn set_lambda_max(&mut self, lambda_max: f64) -> &mut Self
pub fn set_lambda_max(&mut self, lambda_max: f64) -> &mut Self
Set maximum lambda for LevenbergMarquardt