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,UnconstrainedLeastSquaresBase<S,,SchurJacobian<S>> UnconstrainedLeastSquaresSchur<S>,VerbosePrint
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
FieldsModifier and TypeFieldDescriptionFields inherited from class org.ddogleg.optimization.lm.LevenbergMarquardt_F64
diagOrig, diagStep, jacobianType, lambda, lossFunc, lossFuncGradient, math, MAX_LAMBDA, nu, residuals, storageLossGradientFields inherited from class org.ddogleg.optimization.GaussNewtonBase_F64
config, ftest_val, fx, gradient, gtest_val, hessian, hessianScaling, mode, p, postUpdateAdjuster, sameStateAsCost, totalFullSteps, totalSelectSteps, verbose, verboseLevel, x, x_next -
Constructor Summary
ConstructorsConstructorDescriptionUnconLeastSqLevenbergMarquardtSchur_F64(MatrixMath<S> math, HessianSchurComplement<S> hessian) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcomputeResiduals(DMatrixRMaj x, DMatrixRMaj residuals) Computes the residuals at state 'x'protected voidfunctionGradientHessian(DMatrixRMaj x, boolean sameStateAsResiduals, DMatrixRMaj gradient, HessianSchurComplement<S> hessian) Computes the gradient and Hessian at 'x'.doubleReturns 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.voidinitialize(double[] initial, double ftol, double gtol) Specify the initial set of parameters from which to start from.booleanIndicates if iteration stopped due to convergence or not.booleanTrue if the parameter(s) being optimized have been updatedvoidsetFunction(FunctionNtoM function, @Nullable SchurJacobian<S> jacobian) Specifies a set of functions and their Jacobian.voidsetPostUpdate(AdjustArray_F64 adjuster) After a step has been computed and applied this function is called with the new candidate state passed in.Methods inherited from class org.ddogleg.optimization.lm.LevenbergMarquardt_F64
acceptNewState, checkConvergenceFTest, computeStep, computeStep, configure, costFromResiduals, getJacobianType, initialize, maximumLambdaNu, setLoss, updateDerivatesMethods inherited from class org.ddogleg.optimization.GaussNewtonBase_F64
applyHessianScaling, checkConvergenceGTest, computeHessianScaling, computeHessianScaling, computePredictedReduction, initialize, iterate, mode, setVerbose, setVerbose, undoHessianScalingOnParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ddogleg.optimization.IterativeOptimization
iterate, setVerboseMethods inherited from interface org.ddogleg.optimization.UnconstrainedLeastSquaresBase
getJacobianType, setLossMethods inherited from interface org.ddogleg.struct.VerbosePrint
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:UnconstrainedLeastSquaresBaseSpecifies a set of functions and their Jacobian. See class description for documentation on output data format.- Specified by:
setFunctionin interfaceUnconstrainedLeastSquaresBase<S extends DMatrix,SchurJacobian<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. If null a numerical Jacobian will be used.
-
setPostUpdate
Description copied from interface:UnconstrainedLeastSquaresBaseAfter a step has been computed and applied this function is called with the new candidate state passed in. It provides the user the opportunity to adjust the data in anyway which will not change the score. For example, if a vector is scale invariant you can ensure it always has a norm of 1.- Specified by:
setPostUpdatein interfaceUnconstrainedLeastSquaresBase<S extends DMatrix,SchurJacobian<S extends DMatrix>> - Parameters:
adjuster- The new user provided adjuster
-
initialize
public void initialize(double[] initial, double ftol, double gtol) Description copied from interface:UnconstrainedLeastSquaresBaseSpecify the initial set of parameters from which to start from. Call afterUnconstrainedLeastSquaresBase.setFunction(org.ddogleg.optimization.functions.FunctionNtoM, FunctionJacobian)has been called.- Specified by:
initializein interfaceUnconstrainedLeastSquaresBase<S extends DMatrix,SchurJacobian<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:UnconstrainedLeastSquaresBaseAfter each iteration this function can be called to get the current best set of parameters.- Specified by:
getParametersin interfaceUnconstrainedLeastSquaresBase<S extends DMatrix,SchurJacobian<S extends DMatrix>>
-
getFunctionValue
public double getFunctionValue()Description copied from interface:UnconstrainedLeastSquaresBaseReturns the value of the objective function being evaluated at the current parameters value. If not supported then an exception is thrown.- Specified by:
getFunctionValuein interfaceUnconstrainedLeastSquaresBase<S extends DMatrix,SchurJacobian<S extends DMatrix>> - Returns:
- Objective function's value.
-
isUpdated
public boolean isUpdated()Description copied from interface:IterativeOptimizationTrue if the parameter(s) being optimized have been updated- Specified by:
isUpdatedin interfaceIterativeOptimization- Returns:
- True if parameters have been updated
-
isConverged
public boolean isConverged()Description copied from interface:IterativeOptimizationIndicates if iteration stopped due to convergence or not.- Specified by:
isConvergedin 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_F64Computes 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:
functionGradientHessianin 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_F64Computes the residuals at state 'x'- Specified by:
computeResidualsin classLevenbergMarquardt_F64<S extends DMatrix,HessianSchurComplement<S extends DMatrix>> - Parameters:
x- (Input) stateresiduals- (Output) residuals F(x) - Y
-