Struct argmin::backtracking::BacktrackingLineSearch
[−]
[src]
pub struct BacktrackingLineSearch<'a> { /* fields omitted */ }
Backtracking Line Search
Methods
impl<'a> BacktrackingLineSearch<'a>
[src]
fn new(
cost_function: &'a Fn(&Array1<f64>) -> f64,
gradient: &'a Fn(&Array1<f64>) -> Array1<f64>
) -> Self
[src]
cost_function: &'a Fn(&Array1<f64>) -> f64,
gradient: &'a Fn(&Array1<f64>) -> Array1<f64>
) -> Self
Initialize Backtracking Line Search
Requires the cost function and gradient to be passed as parameter. The parameters
max_iters
, tau
, and c
are set to 100, 0.5 and 0.5, respectively.
fn alpha(&mut self, alpha: f64) -> &mut Self
[src]
Set the maximum distance from the starting point
fn max_iters(&mut self, max_iters: u64) -> &mut Self
[src]
Set the maximum number of iterations
fn c(&mut self, c: f64) -> Result<&mut Self, Error>
[src]
Set c to a desired value between 0 and 1
fn tau(&mut self, tau: f64) -> Result<&mut Self, Error>
[src]
Set tau to a desired value between 0 and 1
fn run(
&self,
p: &Array1<f64>,
x: &Array1<f64>
) -> Result<(f64, u64, TerminationReason), Error>
[src]
&self,
p: &Array1<f64>,
x: &Array1<f64>
) -> Result<(f64, u64, TerminationReason), Error>
Run backtracking line search
p
is the search direction. Take care about whether you need it to be a unit vector or
not! p
will not be normalized!