pub struct ModelMap<Inner: FitModel, Map: DifferentiableFunction<Inner::Scalar>> {
pub inner: Inner,
/* private fields */
}Expand description
Model equal to application of a function on top of a model.
You can’t construct this struct manually, please use model_map for that. This is motivated by it’s fields containing two separate objects (value and derivative), that are actually dependent and should be derived from each other.
Fields§
§inner: InnerInner model.
Trait Implementations§
Source§impl<Inner: Clone + FitModel, Map: Clone + DifferentiableFunction<Inner::Scalar>> Clone for ModelMap<Inner, Map>
impl<Inner: Clone + FitModel, Map: Clone + DifferentiableFunction<Inner::Scalar>> Clone for ModelMap<Inner, Map>
Source§impl<Inner: Debug + FitModel, Map: Debug + DifferentiableFunction<Inner::Scalar>> Debug for ModelMap<Inner, Map>
impl<Inner: Debug + FitModel, Map: Debug + DifferentiableFunction<Inner::Scalar>> Debug for ModelMap<Inner, Map>
Source§impl<Inner, Map: DifferentiableFunction<Inner::Scalar>> FitModel for ModelMap<Inner, Map>
impl<Inner, Map: DifferentiableFunction<Inner::Scalar>> FitModel for ModelMap<Inner, Map>
Source§type Scalar = <Inner as FitModel>::Scalar
type Scalar = <Inner as FitModel>::Scalar
Type of
x, y, model parameters and all the derivatives. Different types are not supported (yet)Source§type ParamCount = <Inner as FitModel>::ParamCount
type ParamCount = <Inner as FitModel>::ParamCount
Type representing number of parameters. Read more
Source§fn evaluate(&self, x: &Self::Scalar) -> Self::Scalar
fn evaluate(&self, x: &Self::Scalar) -> Self::Scalar
Computes model value for supplied
x value and current parameters.Source§fn jacobian(
&self,
x: &Self::Scalar,
) -> impl Into<GenericArray<Self::Scalar, <Self::ParamCount as Conv>::TNum>>
fn jacobian( &self, x: &Self::Scalar, ) -> impl Into<GenericArray<Self::Scalar, <Self::ParamCount as Conv>::TNum>>
Computes jacobian (array of derivatives) for supplied
x value and current parameters. Read moreSource§fn set_params(
&mut self,
new_params: GenericArray<Self::Scalar, <Self::ParamCount as Conv>::TNum>,
)
fn set_params( &mut self, new_params: GenericArray<Self::Scalar, <Self::ParamCount as Conv>::TNum>, )
Sets model parameters to ones contained in a generic array Read more
Source§fn get_params(
&self,
) -> impl Into<GenericArray<Self::Scalar, <Self::ParamCount as Conv>::TNum>>
fn get_params( &self, ) -> impl Into<GenericArray<Self::Scalar, <Self::ParamCount as Conv>::TNum>>
Returns current values of model params. Read more
Source§impl<Inner, Map> FitModelXDeriv for ModelMap<Inner, Map>where
Inner: FitModelXDeriv,
Inner::Scalar: Mul<Output = Inner::Scalar>,
Map: DifferentiableFunction<Inner::Scalar>,
Self: FitModel<Scalar = Inner::Scalar, ParamCount = Inner::ParamCount>,
impl<Inner, Map> FitModelXDeriv for ModelMap<Inner, Map>where
Inner: FitModelXDeriv,
Inner::Scalar: Mul<Output = Inner::Scalar>,
Map: DifferentiableFunction<Inner::Scalar>,
Self: FitModel<Scalar = Inner::Scalar, ParamCount = Inner::ParamCount>,
Source§impl<Inner: Hash + FitModel, Map: Hash + DifferentiableFunction<Inner::Scalar>> Hash for ModelMap<Inner, Map>
impl<Inner: Hash + FitModel, Map: Hash + DifferentiableFunction<Inner::Scalar>> Hash for ModelMap<Inner, Map>
Source§impl<Inner: Ord + FitModel, Map: Ord + DifferentiableFunction<Inner::Scalar>> Ord for ModelMap<Inner, Map>
impl<Inner: Ord + FitModel, Map: Ord + DifferentiableFunction<Inner::Scalar>> Ord for ModelMap<Inner, Map>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<Inner: PartialEq + FitModel, Map: PartialEq + DifferentiableFunction<Inner::Scalar>> PartialEq for ModelMap<Inner, Map>
impl<Inner: PartialEq + FitModel, Map: PartialEq + DifferentiableFunction<Inner::Scalar>> PartialEq for ModelMap<Inner, Map>
Source§impl<Inner: PartialOrd + FitModel, Map: PartialOrd + DifferentiableFunction<Inner::Scalar>> PartialOrd for ModelMap<Inner, Map>
impl<Inner: PartialOrd + FitModel, Map: PartialOrd + DifferentiableFunction<Inner::Scalar>> PartialOrd for ModelMap<Inner, Map>
impl<Inner: Eq + FitModel, Map: Eq + DifferentiableFunction<Inner::Scalar>> Eq for ModelMap<Inner, Map>
impl<Inner: FitModel, Map: DifferentiableFunction<Inner::Scalar>> StructuralPartialEq for ModelMap<Inner, Map>
Auto Trait Implementations§
impl<Inner, Map> Freeze for ModelMap<Inner, Map>where
Inner: Freeze,
<<Map as DifferentiableFunction<<Inner as FitModel>::Scalar>>::ValueParams as ArrayLength>::ArrayType<<Inner as FitModel>::Scalar>: Freeze,
<<Map as DifferentiableFunction<<Inner as FitModel>::Scalar>>::DerivativeParams as ArrayLength>::ArrayType<<Inner as FitModel>::Scalar>: Freeze,
impl<Inner, Map> RefUnwindSafe for ModelMap<Inner, Map>where
Inner: RefUnwindSafe,
<<Map as DifferentiableFunction<<Inner as FitModel>::Scalar>>::ValueParams as ArrayLength>::ArrayType<<Inner as FitModel>::Scalar>: RefUnwindSafe,
<<Map as DifferentiableFunction<<Inner as FitModel>::Scalar>>::DerivativeParams as ArrayLength>::ArrayType<<Inner as FitModel>::Scalar>: RefUnwindSafe,
impl<Inner, Map> Send for ModelMap<Inner, Map>
impl<Inner, Map> Sync for ModelMap<Inner, Map>
impl<Inner, Map> Unpin for ModelMap<Inner, Map>where
Inner: Unpin,
<<Map as DifferentiableFunction<<Inner as FitModel>::Scalar>>::ValueParams as ArrayLength>::ArrayType<<Inner as FitModel>::Scalar>: Unpin,
<<Map as DifferentiableFunction<<Inner as FitModel>::Scalar>>::DerivativeParams as ArrayLength>::ArrayType<<Inner as FitModel>::Scalar>: Unpin,
impl<Inner, Map> UnwindSafe for ModelMap<Inner, Map>where
Inner: UnwindSafe,
<<Map as DifferentiableFunction<<Inner as FitModel>::Scalar>>::ValueParams as ArrayLength>::ArrayType<<Inner as FitModel>::Scalar>: UnwindSafe,
<<Map as DifferentiableFunction<<Inner as FitModel>::Scalar>>::DerivativeParams as ArrayLength>::ArrayType<<Inner as FitModel>::Scalar>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Inner> CompositionExt for Innerwhere
Inner: FitModel,
impl<Inner> CompositionExt for Innerwhere
Inner: FitModel,
Source§fn compose<Outer>(self, outer: Outer) -> Composition<Inner, Outer>
fn compose<Outer>(self, outer: Outer) -> Composition<Inner, Outer>
Applies second model on top of current one.
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.