Package weka.core

Class ConjugateGradientOptimization

  • All Implemented Interfaces:
    RevisionHandler, TechnicalInformationHandler

    public abstract class ConjugateGradientOptimization
    extends Optimization
    implements RevisionHandler
    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 Detail

      • ConjugateGradientOptimization

        public ConjugateGradientOptimization()
        Constructor that sets MAXITS to 2000 by default and the parameter in the second weak Wolfe condition to 0.1.
    • Method Detail

      • findArgmin

        public double[] findArgmin​(double[] initX,
                                   double[][] constraints)
                            throws java.lang.Exception
        Main algorithm. NOTE: constraints are not actually supported.
        Overrides:
        findArgmin in class Optimization
        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:
        java.lang.Exception - if an error occurs