Package org.ddogleg.optimization.lm
Class UnconLeastSqLevenbergMarquardtSchur_F64<S extends DMatrix>
java.lang.Object
org.ddogleg.optimization.GaussNewtonBase_F64<ConfigLevenbergMarquardt,HM>
org.ddogleg.optimization.lm.LevenbergMarquardt_F64<S,HessianSchurComplement<S>>
org.ddogleg.optimization.lm.UnconLeastSqLevenbergMarquardtSchur_F64<S>
- All Implemented Interfaces:
Serializable
,IterativeOptimization
,UnconstrainedLeastSquaresSchur<S>
public class UnconLeastSqLevenbergMarquardtSchur_F64<S extends DMatrix>
extends LevenbergMarquardt_F64<S,HessianSchurComplement<S>>
implements UnconstrainedLeastSquaresSchur<S>
Implementation of
LevenbergMarquardt_F64
for UnconstrainedLeastSquaresSchur
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ddogleg.optimization.GaussNewtonBase_F64
GaussNewtonBase_F64.Mode
-
Field Summary
Modifier and TypeFieldDescriptionFields inherited from class org.ddogleg.optimization.lm.LevenbergMarquardt_F64
diagOrig, diagStep, lambda, math, MAX_LAMBDA, nu, residuals
Fields inherited from class org.ddogleg.optimization.GaussNewtonBase_F64
config, ftest_val, fx, gradient, gtest_val, hessian, hessianScaling, mode, p, sameStateAsCost, totalFullSteps, totalSelectSteps, verbose, verboseLevel, x, x_next
-
Constructor Summary
ConstructorDescriptionUnconLeastSqLevenbergMarquardtSchur_F64
(MatrixMath<S> math, HessianSchurComplement<S> hessian) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
computeResiduals
(DMatrixRMaj x, DMatrixRMaj residuals) Computes the residuals at state 'x'protected void
functionGradientHessian
(DMatrixRMaj x, boolean sameStateAsResiduals, DMatrixRMaj gradient, HessianSchurComplement<S> hessian) Computes the gradient and Hessian at 'x'.double
Returns the value of the objective function being evaluated at the current parameters value.double[]
After each iteration this function can be called to get the current best set of parameters.void
initialize
(double[] initial, double ftol, double gtol) Specify the initial set of parameters from which to start from.boolean
Indicates if iteration stopped due to convergence or not.boolean
True if the parameter(s) being optimized have been updatedvoid
setFunction
(FunctionNtoM function, SchurJacobian<S> jacobian) Specifies a set of functions and their Jacobian.Methods inherited from class org.ddogleg.optimization.lm.LevenbergMarquardt_F64
checkConvergenceFTest, computeStep, computeStep, configure, costFromResiduals, initialize, maximumLambdaNu, updateDerivates
Methods inherited from class org.ddogleg.optimization.GaussNewtonBase_F64
applyHessianScaling, checkConvergenceGTest, computeHessianScaling, computeHessianScaling, computePredictedReduction, initialize, iterate, mode, setVerbose, undoHessianScalingOnParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ddogleg.optimization.IterativeOptimization
iterate, setVerbose
-
Field Details
-
jacLeft
-
jacRight
-
functionResiduals
-
functionJacobian
-
-
Constructor Details
-
UnconLeastSqLevenbergMarquardtSchur_F64
public UnconLeastSqLevenbergMarquardtSchur_F64(MatrixMath<S> math, HessianSchurComplement<S> hessian)
-
-
Method Details
-
setFunction
Description copied from interface:UnconstrainedLeastSquaresSchur
Specifies a set of functions and their Jacobian. See class description for documentation on output data format.- Specified by:
setFunction
in interfaceUnconstrainedLeastSquaresSchur<S extends DMatrix>
- Parameters:
function
- Computes the output of M functions fi(x) which take in N fit parameters as input.jacobian
- Computes the Jacobian of the M functions and breaks it up into left and right components.
-
initialize
public void initialize(double[] initial, double ftol, double gtol) Description copied from interface:UnconstrainedLeastSquaresSchur
Specify the initial set of parameters from which to start from. Call afterUnconstrainedLeastSquaresSchur.setFunction(org.ddogleg.optimization.functions.FunctionNtoM, org.ddogleg.optimization.functions.SchurJacobian<S>)
has been called.- Specified by:
initialize
in interfaceUnconstrainedLeastSquaresSchur<S extends DMatrix>
- Parameters:
initial
- Initial parameters or guess with N elements..ftol
- Relative threshold for change in function value between iterations. 0 ≤ ftol ≤ 1. Try 1e-12gtol
- Absolute threshold for convergence based on the gradient's norm. 0 disables test. 0 ≤ gtol. Try 1e-12
-
getParameters
public double[] getParameters()Description copied from interface:UnconstrainedLeastSquaresSchur
After each iteration this function can be called to get the current best set of parameters.- Specified by:
getParameters
in interfaceUnconstrainedLeastSquaresSchur<S extends DMatrix>
- Returns:
- parameters
-
getFunctionValue
public double getFunctionValue()Description copied from interface:UnconstrainedLeastSquaresSchur
Returns the value of the objective function being evaluated at the current parameters value. If not supported then an exception is thrown.- Specified by:
getFunctionValue
in interfaceUnconstrainedLeastSquaresSchur<S extends DMatrix>
- Returns:
- Objective function's value.
-
isUpdated
public boolean isUpdated()Description copied from interface:IterativeOptimization
True if the parameter(s) being optimized have been updated- Specified by:
isUpdated
in interfaceIterativeOptimization
- Returns:
- True if parameters have been updated
-
isConverged
public boolean isConverged()Description copied from interface:IterativeOptimization
Indicates if iteration stopped due to convergence or not.- Specified by:
isConverged
in interfaceIterativeOptimization
- Returns:
- True if iteration stopped because it converged.
-
functionGradientHessian
protected void functionGradientHessian(DMatrixRMaj x, boolean sameStateAsResiduals, DMatrixRMaj gradient, HessianSchurComplement<S> hessian) Description copied from class:GaussNewtonBase_F64
Computes the gradient and Hessian at 'x'. If sameStateAsCost is true then it can be assumed that 'x' has not changed since the cost was last computed.- Specified by:
functionGradientHessian
in classGaussNewtonBase_F64<ConfigLevenbergMarquardt,
HessianSchurComplement<S extends DMatrix>> sameStateAsResiduals
- (Input) If true then when the cost (or residuals) was last called it had the same value of xgradient
- (Input) xhessian
- (Output) hessian
-
computeResiduals
Description copied from class:LevenbergMarquardt_F64
Computes the residuals at state 'x'- Specified by:
computeResiduals
in classLevenbergMarquardt_F64<S extends DMatrix,
HessianSchurComplement<S extends DMatrix>> - Parameters:
x
- (Input) stateresiduals
- (Output) residuals F(x) - Y
-