[−][src]Trait argmin::prelude::ArgminOp
This trait needs to be implemented for every operator/cost function.
It is required to implement the apply
method, all others are optional and provide a default
implementation which is essentially returning an error which indicates that the method has not
been implemented. Those methods (gradient
and modify
) only need to be implemented if the
uses solver requires it.
Associated Types
type Param: Clone + DeserializeOwned + Serialize
Type of the parameter vector
type Output: Clone + DeserializeOwned + Serialize
Output of the operator
type Hessian: Clone + DeserializeOwned + Serialize
Type of Hessian
type Jacobian: Clone + DeserializeOwned + Serialize
Type of Jacobian
Provided methods
fn apply(&self, _param: &Self::Param) -> Result<Self::Output, Error>
Applies the operator/cost function to parameters
fn gradient(&self, _param: &Self::Param) -> Result<Self::Param, Error>
Computes the gradient at the given parameters
fn hessian(&self, _param: &Self::Param) -> Result<Self::Hessian, Error>
Computes the Hessian at the given parameters
fn jacobian(&self, _param: &Self::Param) -> Result<Self::Jacobian, Error>
Computes the Hessian at the given parameters
fn modify(
&self,
_param: &Self::Param,
_extent: f64
) -> Result<Self::Param, Error>
&self,
_param: &Self::Param,
_extent: f64
) -> Result<Self::Param, Error>
Modifies a parameter vector. Comes with a variable that indicates the "degree" of the modification.
Implementors
impl ArgminOp for MinimalNoOperator
[src]
type Param = Vec<f64>
type Output = f64
type Hessian = Vec<Vec<f64>>
type Jacobian = Vec<f64>
fn apply(
&self,
_p: &<MinimalNoOperator as ArgminOp>::Param
) -> Result<<MinimalNoOperator as ArgminOp>::Output, Error>
[src]
&self,
_p: &<MinimalNoOperator as ArgminOp>::Param
) -> Result<<MinimalNoOperator as ArgminOp>::Output, Error>
Do nothing, really.
fn gradient(
&self,
_p: &<MinimalNoOperator as ArgminOp>::Param
) -> Result<<MinimalNoOperator as ArgminOp>::Param, Error>
[src]
&self,
_p: &<MinimalNoOperator as ArgminOp>::Param
) -> Result<<MinimalNoOperator as ArgminOp>::Param, Error>
Do nothing, really.
fn hessian(
&self,
_p: &<MinimalNoOperator as ArgminOp>::Param
) -> Result<<MinimalNoOperator as ArgminOp>::Hessian, Error>
[src]
&self,
_p: &<MinimalNoOperator as ArgminOp>::Param
) -> Result<<MinimalNoOperator as ArgminOp>::Hessian, Error>
Do nothing, really.
fn modify(
&self,
_p: &<MinimalNoOperator as ArgminOp>::Param,
_t: f64
) -> Result<<MinimalNoOperator as ArgminOp>::Param, Error>
[src]
&self,
_p: &<MinimalNoOperator as ArgminOp>::Param,
_t: f64
) -> Result<<MinimalNoOperator as ArgminOp>::Param, Error>
Do nothing, really.
impl<O> ArgminOp for OpWrapper<O> where
O: ArgminOp,
[src]
O: ArgminOp,
The OpWrapperArgminOp
type Param = <O as ArgminOp>::Param
type Output = <O as ArgminOp>::Output
type Hessian = <O as ArgminOp>::Hessian
type Jacobian = <O as ArgminOp>::Jacobian
fn apply(
&self,
param: &<OpWrapper<O> as ArgminOp>::Param
) -> Result<<OpWrapper<O> as ArgminOp>::Output, Error>
[src]
&self,
param: &<OpWrapper<O> as ArgminOp>::Param
) -> Result<<OpWrapper<O> as ArgminOp>::Output, Error>
fn gradient(
&self,
param: &<OpWrapper<O> as ArgminOp>::Param
) -> Result<<OpWrapper<O> as ArgminOp>::Param, Error>
[src]
&self,
param: &<OpWrapper<O> as ArgminOp>::Param
) -> Result<<OpWrapper<O> as ArgminOp>::Param, Error>
fn hessian(
&self,
param: &<OpWrapper<O> as ArgminOp>::Param
) -> Result<<OpWrapper<O> as ArgminOp>::Hessian, Error>
[src]
&self,
param: &<OpWrapper<O> as ArgminOp>::Param
) -> Result<<OpWrapper<O> as ArgminOp>::Hessian, Error>
fn jacobian(
&self,
param: &<OpWrapper<O> as ArgminOp>::Param
) -> Result<<OpWrapper<O> as ArgminOp>::Jacobian, Error>
[src]
&self,
param: &<OpWrapper<O> as ArgminOp>::Param
) -> Result<<OpWrapper<O> as ArgminOp>::Jacobian, Error>
fn modify(
&self,
param: &<OpWrapper<O> as ArgminOp>::Param,
extent: f64
) -> Result<<OpWrapper<O> as ArgminOp>::Param, Error>
[src]
&self,
param: &<OpWrapper<O> as ArgminOp>::Param,
extent: f64
) -> Result<<OpWrapper<O> as ArgminOp>::Param, Error>
impl<T, U, H, J> ArgminOp for NoOperator<T, U, H, J> where
H: Clone + Default + Debug + Send + Sync + Serialize + DeserializeOwned,
J: Clone + Default + Debug + Send + Sync + Serialize + DeserializeOwned,
T: Clone + Default + Debug + Send + Sync + Serialize + DeserializeOwned,
U: Clone + Default + Debug + Send + Sync + Serialize + DeserializeOwned,
[src]
H: Clone + Default + Debug + Send + Sync + Serialize + DeserializeOwned,
J: Clone + Default + Debug + Send + Sync + Serialize + DeserializeOwned,
T: Clone + Default + Debug + Send + Sync + Serialize + DeserializeOwned,
U: Clone + Default + Debug + Send + Sync + Serialize + DeserializeOwned,
type Param = T
type Output = U
type Hessian = H
type Jacobian = J
fn apply(
&self,
_p: &<NoOperator<T, U, H, J> as ArgminOp>::Param
) -> Result<<NoOperator<T, U, H, J> as ArgminOp>::Output, Error>
[src]
&self,
_p: &<NoOperator<T, U, H, J> as ArgminOp>::Param
) -> Result<<NoOperator<T, U, H, J> as ArgminOp>::Output, Error>
Do nothing, really.
fn gradient(
&self,
_p: &<NoOperator<T, U, H, J> as ArgminOp>::Param
) -> Result<<NoOperator<T, U, H, J> as ArgminOp>::Param, Error>
[src]
&self,
_p: &<NoOperator<T, U, H, J> as ArgminOp>::Param
) -> Result<<NoOperator<T, U, H, J> as ArgminOp>::Param, Error>
Do nothing, really.
fn hessian(
&self,
_p: &<NoOperator<T, U, H, J> as ArgminOp>::Param
) -> Result<<NoOperator<T, U, H, J> as ArgminOp>::Hessian, Error>
[src]
&self,
_p: &<NoOperator<T, U, H, J> as ArgminOp>::Param
) -> Result<<NoOperator<T, U, H, J> as ArgminOp>::Hessian, Error>
Do nothing, really.
fn modify(
&self,
_p: &<NoOperator<T, U, H, J> as ArgminOp>::Param,
_t: f64
) -> Result<<NoOperator<T, U, H, J> as ArgminOp>::Param, Error>
[src]
&self,
_p: &<NoOperator<T, U, H, J> as ArgminOp>::Param,
_t: f64
) -> Result<<NoOperator<T, U, H, J> as ArgminOp>::Param, Error>
Do nothing, really.