org.ddogleg.optimization.impl
Class CauchyStep
- java.lang.Object
-
- org.ddogleg.optimization.impl.CauchyStep
-
- All Implemented Interfaces:
- TrustRegionStep
public class CauchyStep extends java.lang.Object implements TrustRegionStep
Selects the optimal point along the gradient line within the trust region's constraint.
The negative definite case is not considered because it is impossible when the Hessian is approximated by squaring the Jacobian. For a matrix to be negative definite there must be a vector 'x' which will produce a negative result:
x'*H*x < 0 --> x'*J'*J*x --> (J*x)'*(J*x)
which is clearly always ≥ 0
-
-
Constructor Summary
Constructors Constructor and Description CauchyStep()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcomputeStep(double regionRadius, org.ejml.data.DenseMatrix64F step)Computes the Cauchy step.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.
-
-
-
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)Computes the Cauchy step. See comment in class description for why negative definite case is not considered.- Specified by:
computeStepin interfaceTrustRegionStep- Parameters:
regionRadius-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