Trait argmin::ArgminSolver
[−]
[src]
pub trait ArgminSolver<'a> { type Parameter: ArgminParameter; type CostValue: ArgminCostValue; type Hessian; type StartingPoints; type ProblemDefinition; fn init(
&mut self,
_: Self::ProblemDefinition,
_: &Self::StartingPoints
) -> Result<(), Error>; fn next_iter(
&mut self
) -> Result<ArgminResult<Self::Parameter, Self::CostValue>, Error>; fn run(
&mut self,
_: Self::ProblemDefinition,
_: &Self::StartingPoints
) -> Result<ArgminResult<Self::Parameter, Self::CostValue>, Error>; fn terminate(&self) -> TerminationReason; }
Trait every solve needs to implement (in the future)
Associated Types
type Parameter: ArgminParameter
Parameter vector
type CostValue: ArgminCostValue
Cost value
type Hessian
Hessian
type StartingPoints
Initial parameter(s)
type ProblemDefinition
Type of Problem
Required Methods
fn init(
&mut self,
_: Self::ProblemDefinition,
_: &Self::StartingPoints
) -> Result<(), Error>
&mut self,
_: Self::ProblemDefinition,
_: &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>
&mut self
) -> Result<ArgminResult<Self::Parameter, Self::CostValue>, Error>
Moves forward by a single iteration
fn run(
&mut self,
_: Self::ProblemDefinition,
_: &Self::StartingPoints
) -> Result<ArgminResult<Self::Parameter, Self::CostValue>, Error>
&mut self,
_: Self::ProblemDefinition,
_: &Self::StartingPoints
) -> Result<ArgminResult<Self::Parameter, Self::CostValue>, Error>
Run initialization and iterations at once
fn terminate(&self) -> TerminationReason
Handles the stopping criteria
Implementors
impl<'a> ArgminSolver<'a> for BacktrackingLineSearch<'a> type Parameter = Array1<f64>; type CostValue = f64; type Hessian = Array1<f64>; type StartingPoints = Array1<f64>; type ProblemDefinition = Array1<f64>;
impl<'a, T, U, V> ArgminSolver<'a> for SimulatedAnnealing<'a, T, U, V> where
T: ArgminParameter + 'a,
U: ArgminCostValue + 'a,
V: 'a, type Parameter = T; type CostValue = U; type Hessian = V; type StartingPoints = T; type ProblemDefinition = &'a ArgminProblem<'a, Self::Parameter, Self::CostValue, Self::Hessian>;impl<'a> ArgminSolver<'a> for GradientDescent<'a> type Parameter = Array1<f64>; type CostValue = f64; type Hessian = Array1<f64>; type StartingPoints = Array1<f64>; type ProblemDefinition = &'a ArgminProblem<'a, Self::Parameter, Self::CostValue, Self::Hessian>;
impl<'a> ArgminSolver<'a> for NelderMead<'a> type Parameter = Vec<f64>; type CostValue = f64; type Hessian = Vec<f64>; type StartingPoints = Vec<Self::Parameter>; type ProblemDefinition = &'a ArgminProblem<'a, Self::Parameter, Self::CostValue, Self::Hessian>;
impl<'a> ArgminSolver<'a> for Newton<'a> type Parameter = Array1<f64>; type CostValue = f64; type Hessian = Array2<f64>; type StartingPoints = Self::Parameter; type ProblemDefinition = &'a ArgminProblem<'a, Self::Parameter, Self::CostValue, Self::Hessian>;
impl<'a> ArgminSolver<'a> for Landweber<'a> type Parameter = Array1<f64>; type CostValue = f64; type Hessian = Array2<f64>; type StartingPoints = Self::Parameter; type ProblemDefinition = &'a ArgminOperator<'a>;
impl<'a> ArgminSolver<'a> for ConjugateGradient<'a> type Parameter = Array1<f64>; type CostValue = f64; type Hessian = Array2<f64>; type StartingPoints = Self::Parameter; type ProblemDefinition = &'a ArgminOperator<'a>;