Class UnconLeastSqTrustRegionSchur_F64<S extends DMatrix>
java.lang.Object
org.ddogleg.optimization.GaussNewtonBase_F64<ConfigTrustRegion,HM>
org.ddogleg.optimization.trustregion.TrustRegionBase_F64<S,HessianSchurComplement<S>>
org.ddogleg.optimization.trustregion.UnconLeastSqTrustRegionSchur_F64<S>
- All Implemented Interfaces:
Serializable
,IterativeOptimization
,UnconstrainedLeastSquaresSchur<S>
public class UnconLeastSqTrustRegionSchur_F64<S extends DMatrix>
extends TrustRegionBase_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
Modifier and TypeFieldDescriptionprotected SchurJacobian<S>
protected FunctionNtoM
protected S
protected S
protected DMatrixRMaj
Fields inherited from class org.ddogleg.optimization.trustregion.TrustRegionBase_F64
gradientNorm, parameterUpdate, tmp_p
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
ConstructorDescriptionUnconLeastSqTrustRegionSchur_F64
(TrustRegionBase_F64.ParameterUpdate<S> update, HessianSchurComplement<S> hessian) -
Method Summary
Modifier and TypeMethodDescriptionprotected double
cost
(DMatrixRMaj x) Computes the function's value at xprotected void
functionGradientHessian
(DMatrixRMaj x, boolean sameStateAsCost, 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.trustregion.TrustRegionBase_F64
acceptNewState, checkConvergenceFTest, computeStep, configure, considerCandidate, getConfig, initialize, setVerbose, solveCauchyStepLength, updateDerivates
Methods inherited from class org.ddogleg.optimization.GaussNewtonBase_F64
applyHessianScaling, checkConvergenceGTest, computeHessianScaling, computeHessianScaling, computePredictedReduction, initialize, iterate, mode, 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
-
residuals
-
functionResiduals
-
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: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
-
cost
Description copied from class:TrustRegionBase_F64
Computes the function's value at x- Specified by:
cost
in classTrustRegionBase_F64<S extends DMatrix,
HessianSchurComplement<S extends DMatrix>> - Parameters:
x
- parameters- Returns:
- function value
-
functionGradientHessian
protected void functionGradientHessian(DMatrixRMaj x, boolean sameStateAsCost, 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<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: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.
-
getResiduals
-