Struct varpro::solvers::levmar::LevMarSolver [−][src]
Levenberg-Marquardt optimization algorithm.
See the module documentation for a usage example.
The runtime and termination behavior can be controlled by various hyperparameters.
Implementations
impl<F> LevenbergMarquardt<F> where
F: RealField + Float,
[src]
F: RealField + Float,
pub fn new() -> LevenbergMarquardt<F>
[src]
pub fn with_ftol(self, ftol: F) -> LevenbergMarquardt<F>
[src]
Set the relative error desired in the objective function $f$
.
Termination occurs when both the actual and
predicted relative reductions for $f$
are at most ftol
.
Panics
Panics if $\mathtt{ftol} < 0$
.
pub fn with_xtol(self, xtol: F) -> LevenbergMarquardt<F>
[src]
Set relative error between last two approximations.
Termination occurs when the relative error between
two consecutive iterates is at most xtol
.
Panics
Panics if $\mathtt{xtol} < 0$
.
pub fn with_gtol(self, gtol: F) -> LevenbergMarquardt<F>
[src]
Set orthogonality desired between the residual vector and its derivative.
Termination occurs when the cosine of the angle
between the residual vector $\vec{r}$
and any column of the Jacobian $\mathbf{J}$
is at
most gtol
in absolute value.
With other words, the algorithm will terminate if
\cos\bigl(\sphericalangle (\mathbf{J}\vec{e}_i, \vec{r})\bigr) =
\frac{|(\mathbf{J}^\top \vec{r})_i|}{\|\mathbf{J}\vec{e}_i\|\|\vec{r}\|} \leq \texttt{gtol}
\quad\text{for all }i=1,\ldots,n.
This is based on the fact that those vectors are orthognal near the optimum (gradient is zero).
The angle check is scale invariant, whereas checking that
$\nabla f(\vec{x})\approx \vec{0}$
is not.
Panics
Panics if $\mathtt{gtol} < 0$
.
pub fn with_tol(self, tol: F) -> LevenbergMarquardt<F>
[src]
Shortcut to set tol
as in MINPACK LMDER1
.
Sets ftol = xtol = tol
and gtol = 0
.
Panics
Panics if $\mathtt{tol} \leq 0$
.
pub fn with_stepbound(self, stepbound: F) -> LevenbergMarquardt<F>
[src]
Set factor for the initial step bound.
This bound is set to $\mathtt{stepbound}\cdot\|\mathbf{D}\vec{x}\|$
if nonzero, or else to stepbound
itself. In most cases stepbound
should lie
in the interval $[0.1,100]$
.
Panics
Panics if $\mathtt{stepbound} \leq 0$
.
pub fn with_patience(self, patience: usize) -> LevenbergMarquardt<F>
[src]
Set factor for the maximal number of function evaluations.
The maximal number of function evaluations is set to
$\texttt{patience}\cdot(n + 1)$
.
Panics
Panics if $\mathtt{patience} \leq 0$
.
pub fn with_scale_diag(self, scale_diag: bool) -> LevenbergMarquardt<F>
[src]
Enable or disable whether the variables will be rescaled internally.
pub fn minimize<N, M, O>(&self, target: O) -> (O, MinimizationReport<F>) where
N: Dim,
M: DimMin<N> + DimMax<N>,
O: LeastSquaresProblem<F, M, N>,
DefaultAllocator: Allocator<F, N, U1>,
DefaultAllocator: Reallocator<F, M, N, <M as DimMax<N>>::Output, N>,
DefaultAllocator: Allocator<usize, N, U1>,
[src]
N: Dim,
M: DimMin<N> + DimMax<N>,
O: LeastSquaresProblem<F, M, N>,
DefaultAllocator: Allocator<F, N, U1>,
DefaultAllocator: Reallocator<F, M, N, <M as DimMax<N>>::Output, N>,
DefaultAllocator: Allocator<usize, N, U1>,
Try to solve the given least squares problem.
The paramters of the problem which are set when this function is called
are used as the initial guess for $\vec{x}$
.
Trait Implementations
impl<F> Clone for LevenbergMarquardt<F> where
F: Clone,
[src]
F: Clone,
pub fn clone(&self) -> LevenbergMarquardt<F>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<F> Copy for LevenbergMarquardt<F> where
F: Copy,
[src]
F: Copy,
impl<F> Debug for LevenbergMarquardt<F> where
F: Debug,
[src]
F: Debug,
impl<F> Default for LevenbergMarquardt<F> where
F: RealField + Float,
[src]
F: RealField + Float,
pub fn default() -> LevenbergMarquardt<F>
[src]
impl<F> Eq for LevenbergMarquardt<F> where
F: Eq,
[src]
F: Eq,
impl<F> PartialEq<LevenbergMarquardt<F>> for LevenbergMarquardt<F> where
F: PartialEq<F>,
[src]
F: PartialEq<F>,
pub fn eq(&self, other: &LevenbergMarquardt<F>) -> bool
[src]
pub fn ne(&self, other: &LevenbergMarquardt<F>) -> bool
[src]
impl<F> StructuralEq for LevenbergMarquardt<F>
[src]
impl<F> StructuralPartialEq for LevenbergMarquardt<F>
[src]
Auto Trait Implementations
impl<F> RefUnwindSafe for LevenbergMarquardt<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for LevenbergMarquardt<F> where
F: Send,
F: Send,
impl<F> Sync for LevenbergMarquardt<F> where
F: Sync,
F: Sync,
impl<F> Unpin for LevenbergMarquardt<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for LevenbergMarquardt<F> where
F: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Scalar for T where
T: Copy + PartialEq<T> + Debug + Any,
[src]
T: Copy + PartialEq<T> + Debug + Any,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,