org.ddogleg.optimization.impl
Class DoglegStepFtF
- java.lang.Object
-
- org.ddogleg.optimization.impl.DoglegStepFtF
-
- All Implemented Interfaces:
- TrustRegionStep
public class DoglegStepFtF extends java.lang.Object implements TrustRegionStep
Approximates the optimal step within the trust region using the so called dogleg. The Gauss Newton step is computed by squaring the Jacobian. In systems where the number of functions is much larger than the number of parameters this can be faster, but slightly less precise.
This implementation is based off the description found in [1,2], but some of the equations have been modified for simplicity and correctness.
- [1] K. Madsen, H.B. Nielson,and O. Tingleff, "Methods for Non-Linear Least Squares Problems" 2nd Ed, April 2004
- [2] Jorge Nocedal,and Stephen J. Wright "Numerical Optimization" 2nd Ed. Springer 2006
-
-
Constructor Summary
Constructors Constructor and Description DoglegStepFtF()Default solverDoglegStepFtF(org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.DenseMatrix64F> pinv)Specify configuration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcomputeStep(double regionRadius, org.ejml.data.DenseMatrix64F step)Uses the Cauchy point, Gauss-Newton point, or a linear combination of both depending on the regionRadius.voidinit(int numParam, int numFunctions)Initialize internal data structures.booleanisMaxStep()Was a step equal to the regionRadius taken?doublepredictedReduction()Returns the predicted reduction for the step.voidsetInputs(org.ejml.data.DenseMatrix64F x, org.ejml.data.DenseMatrix64F residuals, org.ejml.data.DenseMatrix64F J, org.ejml.data.DenseMatrix64F gradient, double fx)Specifies the state of the system being optimized.
-
-
-
Constructor Detail
-
DoglegStepFtF
public DoglegStepFtF(org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.DenseMatrix64F> pinv)
Specify configuration- Parameters:
pinv- Linear solver for a positive semi-definite symmetric system
-
DoglegStepFtF
public DoglegStepFtF()
Default solver
-
-
Method Detail
-
init
public void init(int numParam, int numFunctions)Description copied from interface:TrustRegionStepInitialize internal data structures. Only needs to be called once.- Specified by:
initin interfaceTrustRegionStep- Parameters:
numParam- Number of parameters being optimizes. This is the length of 'x'numFunctions- Number of functions. Number of outputs to f(x)
-
setInputs
public void setInputs(org.ejml.data.DenseMatrix64F x, org.ejml.data.DenseMatrix64F residuals, org.ejml.data.DenseMatrix64F J, org.ejml.data.DenseMatrix64F gradient, double fx)Description copied from interface:TrustRegionStepSpecifies the state of the system being optimized. Call beforeTrustRegionStep.computeStep(double, org.ejml.data.DenseMatrix64F).- Specified by:
setInputsin interfaceTrustRegionStep- Parameters:
x- Sample point being considered.residuals- Function output: f(x)J- Jacobian: J(x)gradient- Gradient: JT(x)*f(x)fx- Residual at x: 0.5*fT(x)*f(x)
-
computeStep
public void computeStep(double regionRadius, org.ejml.data.DenseMatrix64F step)Uses the Cauchy point, Gauss-Newton point, or a linear combination of both depending on the regionRadius. The predicted reduction is computed differently depending on which of the 3 cases is active.- Specified by:
computeStepin interfaceTrustRegionStep- Parameters:
regionRadius- Size of the trust region.step- Output, the computed step.
-
predictedReduction
public double predictedReduction()
Description copied from interface:TrustRegionStepReturns the predicted reduction for the step. A linear model is used to predict the reduction. See class description for- Specified by:
predictedReductionin interfaceTrustRegionStep- Returns:
- The predicted reduction.
-
isMaxStep
public boolean isMaxStep()
Description copied from interface:TrustRegionStepWas a step equal to the regionRadius taken?- Specified by:
isMaxStepin interfaceTrustRegionStep- Returns:
- true if maximum step and false if less than the maximum step
-
-
DataMelt 3.0 © DataMelt by jWork.ORG