[−][src]Trait argmin::prelude::ArgminSolver
Defines the interface to a solver. Usually, there is no need to implement this manually, use
the argmin_derive
crate instead.
Required methods
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
apply cost function or operator to a parameter vector
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
compute the gradient for a parameter vector
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
compute the hessian for a parameter vector
fn modify(&self, param: &Self::Param, extent: f64) -> Result<Self::Param, Error>
modify the parameter vector
fn cur_param(&self) -> Self::Param
return current parameter vector
fn cur_grad(&self) -> Self::Param
return current gradient
fn cur_hessian(&self) -> Self::Hessian
return current gradient
fn set_cur_param(&mut self, param: Self::Param)
set current parameter vector
fn set_cur_grad(&mut self, grad: Self::Param)
set current gradient
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
set current gradient
fn set_best_param(&mut self, param: Self::Param)
set current parameter vector
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
Execute the optimization algorithm.
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
Execute the optimization algorithm without Ctrl-C handling, logging, writing and anything else which may cost unnecessary time.
fn result(&self) -> ArgminResult<Self::Param>
Returns the best solution found during optimization.
fn set_termination_reason(&mut self, reason: TerminationReason)
Set termination reason (doesn't terminate yet! -- this is helpful for terminating within the iterations)
fn terminate(&mut self) -> TerminationReason
Evaluate all stopping criterions and return the TerminationReason
fn set_max_iters(&mut self, iters: u64)
Set max number of iterations.
fn max_iters(&self) -> u64
Get max number of iterations.
fn cur_iter(&self) -> u64
Get current iteration number.
fn increment_iter(&mut self)
Increment the iteration number by one
fn cur_cost(&self) -> f64
Get current cost function value
fn set_cur_cost(&mut self, cost: f64)
Get current cost function value
fn best_cost(&self) -> f64
Get best cost function value
fn set_best_cost(&mut self, cost: f64)
set best cost value
fn set_target_cost(&mut self, cost: f64)
Set the target cost function value which is used as a stopping criterion
fn add_logger(&mut self, logger: Arc<dyn ArgminLog + 'static>)
Add a logger to the array of loggers
fn add_writer(
&mut self,
writer: Arc<dyn ArgminWrite<Param = Self::Param> + 'static>
)
&mut self,
writer: Arc<dyn ArgminWrite<Param = Self::Param> + 'static>
)
Add a writer to the array of writers
fn base_reset(&mut self)
Reset the base of the algorithm to its initial state
fn increment_cost_func_count(&mut self)
Increment the cost function evaluation count
fn increase_cost_func_count(&mut self, count: u64)
Increaese the cost function evaluation count by a given value
fn cost_func_count(&self) -> u64
Return the cost function evaluation count
fn increment_grad_func_count(&mut self)
Increment the gradient evaluation count
fn increase_grad_func_count(&mut self, count: u64)
Increase the gradient evaluation count by a given value
fn grad_func_count(&self) -> u64
Return the gradient evaluation count
fn increment_hessian_func_count(&mut self)
Increment the hessian evaluation count
fn increase_hessian_func_count(&mut self, count: u64)
Increase the hessian evaluation count by a given value
fn hessian_func_count(&self) -> u64
Return the gradient evaluation count
Implementors
impl<'a, O> ArgminSolver for NonlinearConjugateGradient<'a, O> where
O: 'a + ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminMul<f64, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminNorm<f64>,
[src]
O: 'a + ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminMul<f64, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminNorm<f64>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<'a, O> ArgminSolver for SteepestDescent<'a, O> where
O: 'a + ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param> + ArgminMul<f64, <O as ArgminOp>::Param> + ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminNorm<f64>,
[src]
O: 'a + ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param> + ArgminMul<f64, <O as ArgminOp>::Param> + ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminNorm<f64>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<'a, O> ArgminSolver for NewtonCG<'a, O> where
O: 'a + ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param> + ArgminMul<f64, <O as ArgminOp>::Param> + ArgminZero + ArgminNorm<f64>,
<O as ArgminOp>::Hessian: ArgminInv<<O as ArgminOp>::Hessian> + ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
[src]
O: 'a + ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param> + ArgminMul<f64, <O as ArgminOp>::Param> + ArgminZero + ArgminNorm<f64>,
<O as ArgminOp>::Hessian: ArgminInv<<O as ArgminOp>::Hessian> + ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<'a, O> ArgminSolver for BFGS<'a, O> where
O: 'a + ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Hessian> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param> + ArgminNorm<f64> + ArgminMul<f64, <O as ArgminOp>::Param>,
<O as ArgminOp>::Hessian: ArgminSub<<O as ArgminOp>::Hessian, <O as ArgminOp>::Hessian> + ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Hessian, <O as ArgminOp>::Hessian> + ArgminAdd<<O as ArgminOp>::Hessian, <O as ArgminOp>::Hessian> + ArgminMul<f64, <O as ArgminOp>::Hessian> + ArgminTranspose + ArgminEye,
[src]
O: 'a + ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Hessian> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param> + ArgminNorm<f64> + ArgminMul<f64, <O as ArgminOp>::Param>,
<O as ArgminOp>::Hessian: ArgminSub<<O as ArgminOp>::Hessian, <O as ArgminOp>::Hessian> + ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Hessian, <O as ArgminOp>::Hessian> + ArgminAdd<<O as ArgminOp>::Hessian, <O as ArgminOp>::Hessian> + ArgminMul<f64, <O as ArgminOp>::Hessian> + ArgminTranspose + ArgminEye,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<'a, O> ArgminSolver for TrustRegion<'a, O> where
O: 'a + ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminMul<f64, <O as ArgminOp>::Param> + ArgminWeightedDot<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Hessian> + ArgminNorm<f64> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminZero + ArgminMul<f64, <O as ArgminOp>::Param>,
<O as ArgminOp>::Hessian: ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
[src]
O: 'a + ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminMul<f64, <O as ArgminOp>::Param> + ArgminWeightedDot<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Hessian> + ArgminNorm<f64> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminZero + ArgminMul<f64, <O as ArgminOp>::Param>,
<O as ArgminOp>::Hessian: ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<O> ArgminSolver for ConjugateGradient<O> where
O: ArgminOp<Output = <O as ArgminOp>::Param>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminMul<f64, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64>,
[src]
O: ArgminOp<Output = <O as ArgminOp>::Param>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminMul<f64, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<O> ArgminSolver for Landweber<O> where
<O as ArgminOp>::Param: ArgminScaledSub<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param>,
O: ArgminOp,
[src]
<O as ArgminOp>::Param: ArgminScaledSub<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param>,
O: ArgminOp,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<O> ArgminSolver for BacktrackingLineSearch<O> where
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param>,
[src]
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<O> ArgminSolver for HagerZhangLineSearch<O> where
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param>,
[src]
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<O> ArgminSolver for MoreThuenteLineSearch<O> where
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param>,
[src]
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminScaledAdd<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<O> ArgminSolver for Newton<O> where
O: ArgminOp,
<O as ArgminOp>::Param: ArgminScaledSub<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param>,
<O as ArgminOp>::Hessian: ArgminInv<<O as ArgminOp>::Hessian> + ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
[src]
O: ArgminOp,
<O as ArgminOp>::Param: ArgminScaledSub<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Param>,
<O as ArgminOp>::Hessian: ArgminInv<<O as ArgminOp>::Hessian> + ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<O> ArgminSolver for SimulatedAnnealing<O> where
O: ArgminOp<Output = f64>,
[src]
O: ArgminOp<Output = f64>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<O> ArgminSolver for CauchyPoint<O> where
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminMul<f64, <O as ArgminOp>::Param> + ArgminWeightedDot<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Hessian> + ArgminNorm<f64>,
[src]
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminMul<f64, <O as ArgminOp>::Param> + ArgminWeightedDot<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Hessian> + ArgminNorm<f64>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<O> ArgminSolver for Dogleg<O> where
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminMul<f64, <O as ArgminOp>::Param> + ArgminWeightedDot<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Hessian> + ArgminNorm<f64> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
<O as ArgminOp>::Hessian: ArgminInv<<O as ArgminOp>::Hessian> + ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
[src]
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminMul<f64, <O as ArgminOp>::Param> + ArgminWeightedDot<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Hessian> + ArgminNorm<f64> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
<O as ArgminOp>::Hessian: ArgminInv<<O as ArgminOp>::Hessian> + ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.
impl<O> ArgminSolver for Steihaug<O> where
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminMul<f64, <O as ArgminOp>::Param> + ArgminWeightedDot<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Hessian> + ArgminNorm<f64> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminZero + ArgminMul<f64, <O as ArgminOp>::Param>,
<O as ArgminOp>::Hessian: ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
[src]
O: ArgminOp<Output = f64>,
<O as ArgminOp>::Param: ArgminMul<f64, <O as ArgminOp>::Param> + ArgminWeightedDot<<O as ArgminOp>::Param, f64, <O as ArgminOp>::Hessian> + ArgminNorm<f64> + ArgminDot<<O as ArgminOp>::Param, f64> + ArgminAdd<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminSub<<O as ArgminOp>::Param, <O as ArgminOp>::Param> + ArgminZero + ArgminMul<f64, <O as ArgminOp>::Param>,
<O as ArgminOp>::Hessian: ArgminDot<<O as ArgminOp>::Param, <O as ArgminOp>::Param>,
fn run(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the optimization algorithm
fn run_fast(&mut self) -> Result<ArgminResult<Self::Param>, Error>
[src]
Run the essential parts of the optimization algorithm (no logging, no Ctrl-C handling)
fn apply(&mut self, param: &Self::Param) -> Result<Self::Output, Error>
[src]
Applies the cost function or operator to a parameter vector param
.
Returns an Err
if apply
of ArgminOperator
is not implemented.
fn gradient(&mut self, param: &Self::Param) -> Result<Self::Param, Error>
[src]
Computes the gradient at parameter param
.
Returns an Err
if gradient
of ArgminOperator
is not implemented.
fn hessian(&mut self, param: &Self::Param) -> Result<Self::Hessian, Error>
[src]
Computes the Hessian at parameter param
.
Returns an Err
if hessian
of ArgminOperator
is not implemented.
fn cur_param(&self) -> Self::Param
[src]
Returns the current parameter vector.
fn cur_grad(&self) -> Self::Param
[src]
Returns the most recently stored gradient.
fn cur_hessian(&self) -> Self::Hessian
[src]
Returns the most recently stored Hessian.
fn set_cur_param(&mut self, param: Self::Param)
[src]
Sets the current parameter to param
.
fn set_cur_grad(&mut self, grad: Self::Param)
[src]
Sets the current gradient to grad
.
fn set_cur_hessian(&mut self, hessian: Self::Hessian)
[src]
Sets the current Hessian to hessian
.
fn set_best_param(&mut self, param: Self::Param)
[src]
Sets the best parameter vector to param
.
fn modify(&self, param: &Self::Param, factor: f64) -> Result<Self::Param, Error>
[src]
Modify the parameter vector by calling the modify
method of the trait
ArgminOperator
. Will return an Err
if modify
is not implemented.
fn result(&self) -> ArgminResult<Self::Param>
[src]
Returns the result of the optimization.
fn set_max_iters(&mut self, iters: u64)
[src]
Sets the maximum number of iterations to iters
.
fn max_iters(&self) -> u64
[src]
Returns the maximum number of iterations.
fn increment_iter(&mut self)
[src]
Increments the iteration counter.
fn cur_iter(&self) -> u64
[src]
Returns the current number of iterations.
fn cur_cost(&self) -> f64
[src]
Returns the most recently stored cost function value.
fn set_cur_cost(&mut self, cost: f64)
[src]
Sets the current cost function value to cost
fn best_cost(&self) -> f64
[src]
Returns the best cost function value obtained so far.
fn set_best_cost(&mut self, cost: f64)
[src]
Sets the best cost function value.
fn set_target_cost(&mut self, cost: f64)
[src]
Sets the target cost function value to cost
. The optimization algorithm will be
terminated when this limit is reached.
fn increment_cost_func_count(&mut self)
[src]
Increments the counter for the computations of the cost function by 1.
fn increase_cost_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the cost function by count
.
fn cost_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the cost function.
fn increment_grad_func_count(&mut self)
[src]
Increments the counter for the computations of the gradient by 1.
fn increase_grad_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the gradient by count
.
fn grad_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the gradient.
fn increment_hessian_func_count(&mut self)
[src]
Increments the counter for the computations of the Hessian by 1.
fn increase_hessian_func_count(&mut self, count: u64)
[src]
Increases the counter for the computations of the Hessian by count
.
fn hessian_func_count(&self) -> u64
[src]
Returns the current value of the counter for the computations of the Hessian.
fn add_logger(&mut self, logger: Arc<dyn ArgminLog>)
[src]
Attaches a logger which implements ArgminLog
to the solver.
fn add_writer(&mut self, writer: Arc<dyn ArgminWrite<Param = Self::Param>>)
[src]
Attaches a writer which implements ArgminWrite
to the solver.
fn set_termination_reason(&mut self, reason: TerminationReason)
[src]
Sets the TerminationReason
fn terminate(&mut self) -> TerminationReason
[src]
Checks whether any of the conditions to terminate is true and terminates the algorithm.
fn base_reset(&mut self)
[src]
Resets the base
field to it's initial conditions. This is helpful for
implementing a solver which is initialized once, but called several times. It is
recommended to only call this method inside the init
function of
ArgminNextIter
.