@PublicationReference(author="R. Fletcher",title="Practical Methods of Optimization, Second Edition",type=Book,year=1987,pages={80,87},notes="Section 4.1") @PublicationReference(author="Wikipedia",title="Nonlinear conjugate gradient method",type=WebPage,url="http://en.wikipedia.org/wiki/Nonlinear_conjugate_gradient_method",year=2008) @PublicationReference(author={"William H. Press","Saul A. Teukolsky","William T. Vetterling","Brian P. Flannery"},title="Numerical Recipes in C, Second Edition",type=Book,year=1992,pages={423,424},notes="Section 10.6",url="http://www.nrbook.com/a/bookcpdf.php") public abstract class FunctionMinimizerConjugateGradient extends AbstractAnytimeFunctionMinimizer<Vector,java.lang.Double,DifferentiableEvaluator<? super Vector,java.lang.Double,Vector>>
FunctionMinimizerQuasiNewton
,
Serialized FormModifier and Type | Field and Description |
---|---|
static LineMinimizer<?> |
DEFAULT_LINE_MINIMIZER
Default line minimization algorithm, LineMinimizerDerivativeBased
|
static int |
DEFAULT_MAX_ITERATIONS
Default maximum number of iterations before stopping, 1000
|
static double |
DEFAULT_TOLERANCE
Default tolerance, 1.0E-5
|
protected DirectionalVectorToDifferentiableScalarFunction |
lineFunction
Function that maps a Evaluator
|
initialGuess, result, tolerance
data, keepGoing
maxIterations
DEFAULT_ITERATION, iteration
Constructor and Description |
---|
FunctionMinimizerConjugateGradient(LineMinimizer<?> lineMinimizer,
Vector initialGuess,
double tolerance,
int maxIterations)
Creates a new instance of FunctionMinimizerConjugateGradient
|
Modifier and Type | Method and Description |
---|---|
protected void |
cleanupAlgorithm()
Called to clean up the learning algorithm's state after learning has
finished.
|
protected abstract double |
computeScaleFactor(Vector gradientCurrent,
Vector gradientPrevious)
Computes the conjugate gradient parameter for the particular update
scheme.
|
LineMinimizer<?> |
getLineMinimizer()
Getter for lineMinimizer
|
protected boolean |
initializeAlgorithm()
Called to initialize the learning algorithm's state based on the
data that is stored in the data field.
|
void |
setLineMinimizer(LineMinimizer<?> lineMinimizer)
Setter for lineMinimizer
|
protected boolean |
step()
Called to take a single step of the learning algorithm.
|
getInitialGuess, getResult, getTolerance, setInitialGuess, setResult, setTolerance
clone, getData, getKeepGoing, learn, setData, setKeepGoing, stop
getMaxIterations, isResultValid, setMaxIterations
addIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getIteration, getListeners, removeIterativeAlgorithmListener, setIteration, setListeners
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
learn
clone
getMaxIterations, setMaxIterations
addIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListener
isResultValid, stop
public static final int DEFAULT_MAX_ITERATIONS
public static final double DEFAULT_TOLERANCE
public static final LineMinimizer<?> DEFAULT_LINE_MINIMIZER
protected DirectionalVectorToDifferentiableScalarFunction lineFunction
public FunctionMinimizerConjugateGradient(LineMinimizer<?> lineMinimizer, Vector initialGuess, double tolerance, int maxIterations)
initialGuess
- Initial guess about the minimum of the methodtolerance
- Tolerance of the minimization algorithm, must be >= 0.0, typically ~1e-10lineMinimizer
- Work-horse algorithm that minimizes the function along a directionmaxIterations
- Maximum number of iterations, must be >0, typically ~100public LineMinimizer<?> getLineMinimizer()
public void setLineMinimizer(LineMinimizer<?> lineMinimizer)
lineMinimizer
- Work-horse algorithm that minimizes the function along a directionprotected boolean initializeAlgorithm()
AbstractAnytimeBatchLearner
initializeAlgorithm
in class AbstractAnytimeBatchLearner<DifferentiableEvaluator<? super Vector,java.lang.Double,Vector>,InputOutputPair<Vector,java.lang.Double>>
protected boolean step()
AbstractAnytimeBatchLearner
step
in class AbstractAnytimeBatchLearner<DifferentiableEvaluator<? super Vector,java.lang.Double,Vector>,InputOutputPair<Vector,java.lang.Double>>
protected void cleanupAlgorithm()
AbstractAnytimeBatchLearner
cleanupAlgorithm
in class AbstractAnytimeBatchLearner<DifferentiableEvaluator<? super Vector,java.lang.Double,Vector>,InputOutputPair<Vector,java.lang.Double>>
protected abstract double computeScaleFactor(Vector gradientCurrent, Vector gradientPrevious)
gradientCurrent
- Gradient at the current evaluation pointgradientPrevious
- Gradient at the previous evaluation point