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
Trait Implementations
impl<'a> ArgminSolver<'a> for BacktrackingLineSearch<'a>
[src]
type Parameter = Array1<f64>
Parameter vector
type CostValue = f64
Cost value
type Hessian = Array1<f64>
Hessian
type StartingPoints = Array1<f64>
Initial parameter(s)
type ProblemDefinition = Array1<f64>
Type of Problem
fn init(
&mut self,
p: Self::ProblemDefinition,
x: &Self::StartingPoints
) -> Result<(), Error>
[src]
&mut self,
p: Self::ProblemDefinition,
x: &Self::StartingPoints
) -> Result<(), Error>
Initializes the solver and sets the state to its initial state
fn next_iter(
&mut self
) -> Result<ArgminResult<Self::Parameter, Self::CostValue>, Error>
[src]
&mut self
) -> Result<ArgminResult<Self::Parameter, Self::CostValue>, Error>
Moves forward by a single iteration
fn terminate(&self) -> TerminationReason
[src]
Handles the stopping criteria
fn run(
&mut self,
operator: Self::ProblemDefinition,
init_param: &Self::StartingPoints
) -> Result<ArgminResult<Self::Parameter, Self::CostValue>, Error>
[src]
&mut self,
operator: Self::ProblemDefinition,
init_param: &Self::StartingPoints
) -> Result<ArgminResult<Self::Parameter, Self::CostValue>, Error>
Run initialization and iterations at once