Class UnconLeastSqTrustRegion_F64<S extends DMatrix>
java.lang.Object
org.ddogleg.optimization.GaussNewtonBase_F64<ConfigTrustRegion,HM>
org.ddogleg.optimization.trustregion.TrustRegionBase_F64<S,HessianLeastSquares<S>>
org.ddogleg.optimization.trustregion.UnconLeastSqTrustRegion_F64<S>
- All Implemented Interfaces:
Serializable
,IterativeOptimization
,UnconstrainedLeastSquares<S>
public class UnconLeastSqTrustRegion_F64<S extends DMatrix>
extends TrustRegionBase_F64<S,HessianLeastSquares<S>>
implements UnconstrainedLeastSquares<S>
Implementations of
Trust Region
for UnconstrainedLeastSquares
.- 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 FunctionNtoMxN<S>
protected FunctionNtoM
protected S
protected MatrixMath<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
ConstructorDescriptionUnconLeastSqTrustRegion_F64
(TrustRegionBase_F64.ParameterUpdate<S> parameterUpdate, HessianLeastSquares<S> hessian, MatrixMath<S> math) -
Method Summary
Modifier and TypeMethodDescriptionprotected double
cost
(DMatrixRMaj x) Computes the function's value at xprotected void
functionGradientHessian
(DMatrixRMaj x, boolean sameStateAsCost, DMatrixRMaj gradient, HessianLeastSquares<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.void
initialize
(double[] initial, int numberOfParameters, double minimumFunctionValue) Specifies initial state of the search and completion criteriaboolean
Indicates if iteration stopped due to convergence or not.boolean
True if the parameter(s) being optimized have been updatedvoid
setFunction
(FunctionNtoM function, @Nullable FunctionNtoMxN<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, 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
-
math
-
residuals
-
jacobian
-
functionResiduals
-
functionJacobian
-
-
Constructor Details
-
UnconLeastSqTrustRegion_F64
public UnconLeastSqTrustRegion_F64(TrustRegionBase_F64.ParameterUpdate<S> parameterUpdate, HessianLeastSquares<S> hessian, MatrixMath<S> math)
-
-
Method Details
-
setFunction
Description copied from interface:UnconstrainedLeastSquares
Specifies a set of functions and their Jacobian. See class description for documentation on output data format.- Specified by:
setFunction
in interfaceUnconstrainedLeastSquares<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.
-
initialize
public void initialize(double[] initial, double ftol, double gtol) Description copied from interface:UnconstrainedLeastSquares
Specify the initial set of parameters from which to start from. Call afterUnconstrainedLeastSquares.setFunction(org.ddogleg.optimization.functions.FunctionNtoM, org.ddogleg.optimization.functions.FunctionNtoMxN<S>)
has been called.- Specified by:
initialize
in interfaceUnconstrainedLeastSquares<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
-
initialize
public void initialize(double[] initial, int numberOfParameters, double minimumFunctionValue) Description copied from class:TrustRegionBase_F64
Specifies initial state of the search and completion criteria- Overrides:
initialize
in classTrustRegionBase_F64<S extends DMatrix,
HessianLeastSquares<S extends DMatrix>> - Parameters:
initial
- Initial parameter statenumberOfParameters
- Number many parameters are being optimized.minimumFunctionValue
- The minimum possible value that the function can output
-
cost
Description copied from class:TrustRegionBase_F64
Computes the function's value at x- Specified by:
cost
in classTrustRegionBase_F64<S extends DMatrix,
HessianLeastSquares<S extends DMatrix>> - Parameters:
x
- parameters- Returns:
- function value
-
functionGradientHessian
protected void functionGradientHessian(DMatrixRMaj x, boolean sameStateAsCost, DMatrixRMaj gradient, HessianLeastSquares<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,
HessianLeastSquares<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:UnconstrainedLeastSquares
After each iteration this function can be called to get the current best set of parameters.- Specified by:
getParameters
in interfaceUnconstrainedLeastSquares<S extends DMatrix>
-
getFunctionValue
public double getFunctionValue()Description copied from interface:UnconstrainedLeastSquares
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 interfaceUnconstrainedLeastSquares<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
-
getJacobian
-