Package weka.core
Class ConjugateGradientOptimization
java.lang.Object
weka.core.Optimization
weka.core.ConjugateGradientOptimization
- All Implemented Interfaces:
RevisionHandler
,TechnicalInformationHandler
This subclass of Optimization.java implements conjugate gradient descent
rather than BFGS updates, by overriding findArgmin(), with the same tests for
convergence, and applies the same line search code. Note that constraints are
NOT actually supported. Using this class instead of Optimization.java can
reduce runtime when there are many parameters.
Uses the second hybrid method proposed in "An Efficient Hybrid Conjugate
Gradient Method for Unconstrained Optimization" by Dai and Yuan (2001). See
also information in the getTechnicalInformation() method.
- Version:
- $Revision: 10203 $
- Author:
- Eibe Frank
-
Constructor Summary
ConstructorDescriptionConstructor that sets MAXITS to 2000 by default and the parameter in the second weak Wolfe condition to 0.1. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
findArgmin
(double[] initX, double[][] constraints) Main algorithm.Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.Methods inherited from class weka.core.Optimization
getMinFunction, getVarbValues, lnsrch, setDebug, setMaxIteration, solveTriangle
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface weka.core.RevisionHandler
getRevision
-
Constructor Details
-
ConjugateGradientOptimization
public ConjugateGradientOptimization()Constructor that sets MAXITS to 2000 by default and the parameter in the second weak Wolfe condition to 0.1.
-
-
Method Details
-
getTechnicalInformation
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformation
in interfaceTechnicalInformationHandler
- Overrides:
getTechnicalInformation
in classOptimization
- Returns:
- the technical information about this class
-
findArgmin
Main algorithm. NOTE: constraints are not actually supported.- Overrides:
findArgmin
in classOptimization
- Parameters:
initX
- initial point of x, assuming no value's on the bound!constraints
- both arrays must contain Double.NaN- Returns:
- the solution of x, null if number of iterations not enough
- Throws:
Exception
- if an error occurs
-