Package de.labathome.trustconstr
Class FullHessianUpdateStrategy
java.lang.Object
de.labathome.trustconstr.FullHessianUpdateStrategy
- All Implemented Interfaces:
HessianUpdateStrategy,BiFunction<Matrix,Object, Matrix>
Hessian update strategy with full dimensional internal representation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFullHessianUpdateStrategy.FullHessianUpdateStrategyFactory<T extends FullHessianUpdateStrategy.FullHessianUpdateStrategyFactory<T>>Shared base factory forBFGS.BFGSFactoryandSR1.SR1Factory. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HessianApproximationTypeprotected DenseMatrixHessian approximation (used whenapproxType == HESSIAN).protected booleantrueuntil the firstupdate(Matrix, Matrix)call has been performed.protected DenseMatrixInverse-Hessian approximation (used whenapproxType == INV_HESSIAN).protected longProblem dimension.protected doubleCurrent scaling factor applied to the Hessian (or its inverse). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFullHessianUpdateStrategy(boolean initialScaleAuto, double initialScale) -
Method Summary
Modifier and TypeMethodDescriptionprotected doubleHeuristic scaling factor for the initial Hessian (or inverse-Hessian) approximation, based on Nocedal & Wright (2006), p.143 formula (6.20).Return current internal matrix.voidinitialize(long n, HessianApproximationType approxType) Initialize internal matrix.voidUpdate internal matrix.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThen
-
Field Details
-
scale
protected double scaleCurrent scaling factor applied to the Hessian (or its inverse). -
firstIteration
protected boolean firstIterationtrueuntil the firstupdate(Matrix, Matrix)call has been performed. -
approxType
-
n
protected long nProblem dimension. -
B
Hessian approximation (used whenapproxType == HESSIAN). -
H
Inverse-Hessian approximation (used whenapproxType == INV_HESSIAN).
-
-
Constructor Details
-
FullHessianUpdateStrategy
protected FullHessianUpdateStrategy(boolean initialScaleAuto, double initialScale) - Parameters:
initialScaleAuto- whether the initial scale is auto-derivedinitialScale- user-specified initial scale; ignored wheninitialScaleAutoistrue
-
-
Method Details
-
initialize
Description copied from interface:HessianUpdateStrategyInitialize internal matrix.Allocate internal memory for storing and updating the Hessian or its inverse.
- Specified by:
initializein interfaceHessianUpdateStrategy- Parameters:
n- Problem dimension.approxType- Selects either the Hessian or the inverse Hessian. When set to 'hess' the Hessian will be stored and updated. When set to 'inv_hess' its inverse will be used instead.
-
autoScale
Heuristic scaling factor for the initial Hessian (or inverse-Hessian) approximation, based on Nocedal & Wright (2006), p.143 formula (6.20).- Parameters:
deltaX- step inx:x_k - x_{k-1}deltaG- step in the gradient:g_k - g_{k-1}- Returns:
- scaling factor used to multiply the identity initialisation
-
update
Description copied from interface:HessianUpdateStrategyUpdate internal matrix.Update Hessian matrix or its inverse (depending on how 'approx_type' is defined) using information about the last evaluated points.
- Specified by:
updatein interfaceHessianUpdateStrategy- Parameters:
deltaX- The difference between two points the gradient function have been evaluated at: ``delta_x = x2 - x1``.deltaG- The difference between the gradients: ``delta_grad = grad(x2) - grad(x1)``.
-
apply
- Specified by:
applyin interfaceBiFunction<Matrix,Object, Matrix>
-
getMatrix
Description copied from interface:HessianUpdateStrategyReturn current internal matrix.- Specified by:
getMatrixin interfaceHessianUpdateStrategy- Returns:
- Dense matrix containing either the Hessian or its inverse (depending on how 'approx_type' is defined).
-