Class UnconLeastSqTrustRegionSchur_F64<S extends DMatrix>
java.lang.Object
org.ddogleg.optimization.GaussNewtonBase_F64<ConfigTrustRegion,HM>
org.ddogleg.optimization.trustregion.TrustRegionBase_F64<S,HM>
org.ddogleg.optimization.trustregion.TrustRegionLeastSqBase_F64<S,HessianSchurComplement<S>>
org.ddogleg.optimization.trustregion.UnconLeastSqTrustRegionSchur_F64<S>
- All Implemented Interfaces:
Serializable,IterativeOptimization,UnconstrainedLeastSquaresBase<S,,SchurJacobian<S>> UnconstrainedLeastSquaresSchur<S>,VerbosePrint
public class UnconLeastSqTrustRegionSchur_F64<S extends DMatrix>
extends TrustRegionLeastSqBase_F64<S,HessianSchurComplement<S>>
implements UnconstrainedLeastSquaresSchur<S>
Implementations of
UnconstrainedLeastSquaresSchur. Uses HessianSchurComplement_DSCC
to compute the Schur complement and perform all math related to the Hessian. The Hessian
is stored in a custom block format and the Hessian referenced in the parent class is ignored.
All functions which reference the original Hessian are overriden.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ddogleg.optimization.trustregion.TrustRegionBase_F64
TrustRegionBase_F64.ParameterUpdate<S extends DMatrix>Nested classes/interfaces inherited from class org.ddogleg.optimization.GaussNewtonBase_F64
GaussNewtonBase_F64.Mode -
Field Summary
FieldsFields inherited from class org.ddogleg.optimization.trustregion.TrustRegionLeastSqBase_F64
functionResiduals, lossFunc, lossFuncGradient, residuals, storageLossGradientFields inherited from class org.ddogleg.optimization.trustregion.TrustRegionBase_F64
gradientNorm, parameterUpdate, tmp_pFields 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
ConstructorsConstructorDescriptionUnconLeastSqTrustRegionSchur_F64(TrustRegionBase_F64.ParameterUpdate<S> update, HessianSchurComplement<S> hessian) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfunctionGradientHessian(DMatrixRMaj x, boolean sameStateAsCost, 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.Returns theClassused to store Jacobian matricesdouble[]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.trustregion.TrustRegionLeastSqBase_F64
acceptNewState, computeCostAtInitialization, cost, setLossMethods inherited from class org.ddogleg.optimization.trustregion.TrustRegionBase_F64
checkConvergenceFTest, computeStep, configure, considerCandidate, getConfig, initialize, setVerbose, solveCauchyStepLength, updateDerivatesMethods inherited from class org.ddogleg.optimization.GaussNewtonBase_F64
applyHessianScaling, checkConvergenceGTest, computeHessianScaling, computeHessianScaling, computePredictedReduction, initialize, iterate, mode, 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
setLossMethods inherited from interface org.ddogleg.struct.VerbosePrint
setVerbose
-
Field Details
-
functionJacobian
-
jacLeft
-
jacRight
-
-
Constructor Details
-
UnconLeastSqTrustRegionSchur_F64
public UnconLeastSqTrustRegionSchur_F64(TrustRegionBase_F64.ParameterUpdate<S> update, 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
-
functionGradientHessian
protected void functionGradientHessian(DMatrixRMaj x, boolean sameStateAsCost, 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<ConfigTrustRegion,HessianSchurComplement<S extends DMatrix>> sameStateAsCost- (Input) If true then when the cost (or residuals) was last called it had the same value of xgradient- (Input) xhessian- (Output) hessian
-
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.
-
getResiduals
-
getJacobianType
Description copied from interface:UnconstrainedLeastSquaresBaseReturns theClassused to store Jacobian matrices- Specified by:
getJacobianTypein interfaceUnconstrainedLeastSquaresBase<S extends DMatrix,SchurJacobian<S extends DMatrix>>
-