Package org.ddogleg.optimization
Interface UnconstrainedLeastSquaresBase<S extends DMatrix,FunctionJacobian>
- All Superinterfaces:
IterativeOptimization
,Serializable
,VerbosePrint
- All Known Subinterfaces:
UnconstrainedLeastSquares<S>
,UnconstrainedLeastSquaresSchur<S>
- All Known Implementing Classes:
UnconLeastSqLevenbergMarquardt_F64
,UnconLeastSqLevenbergMarquardtSchur_F64
,UnconLeastSqTrustRegion_F64
,UnconLeastSqTrustRegionSchur_F64
public interface UnconstrainedLeastSquaresBase<S extends DMatrix,FunctionJacobian>
extends IterativeOptimization
Common base for implementations of
UnconstrainedLeastSquares
that differ in the JacobianFunction-
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the value of the objective function being evaluated at the current parameters value.Returns theClass
used to store Jacobian matricesdouble[]
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
setFunction
(FunctionNtoM function, FunctionJacobian jacobian) Specifies a set of functions and their Jacobian.void
setLoss
(LossFunction loss, LossFunctionGradient lossGradient) Specifies a specialized loss function, typically to improve robustness to outliers.void
setPostUpdate
(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 interface org.ddogleg.optimization.IterativeOptimization
isConverged, isUpdated, iterate, setVerbose
Methods inherited from interface org.ddogleg.struct.VerbosePrint
setVerbose
-
Method Details
-
setFunction
Specifies a set of functions and their Jacobian. See class description for documentation on output data format.- 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.
-
setLoss
Specifies a specialized loss function, typically to improve robustness to outliers. Squared error is the default. -
setPostUpdate
After 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.- Parameters:
adjuster
- The new user provided adjuster
-
initialize
void initialize(double[] initial, double ftol, double gtol) Specify the initial set of parameters from which to start from. Call aftersetFunction(org.ddogleg.optimization.functions.FunctionNtoM, FunctionJacobian)
has been called.- 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
double[] getParameters()After each iteration this function can be called to get the current best set of parameters. -
getFunctionValue
double getFunctionValue()Returns the value of the objective function being evaluated at the current parameters value. If not supported then an exception is thrown.- Returns:
- Objective function's value.
-
getJacobianType
Returns theClass
used to store Jacobian matrices
-