Documentation of 'jsat.math.optimization.BFGS' Java class
BFGS
jsat.math.optimization

Class BFGS

  • All Implemented Interfaces:
    Optimizer


    public class BFGS
    extends java.lang.Object
    implements Optimizer
    Implementation of the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm for function minimization. For n dimensional problems it requires O(n2) work per iteration and uses first order information to approximate the Hessian.
    • Constructor Summary

      Constructors 
      Constructor and Description
      BFGS()
      Creates a new BFGS optimization object that uses a maximum of 250 iterations and a backtracking line search.
      BFGS(int maxIterations, LineSearch lineSearch)
      Creates a new BFGS optimization object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      Optimizer clone() 
      LineSearch getLineSearch()
      Returns the line search method used at each iteration
      int getMaximumIterations()
      Returns the maximum number of iterations to perform
      boolean isInftNormCriterion()
      Returns whether or not the infinity norm (true) or 2 norm (false) is used to determine convergence.
      void optimize(double tolerance, Vec w, Vec x0, Function f, FunctionVec fp, boolean parallel)
      Attempts to optimize the given function by finding the value of w that will minimize the value returned by f(w), using w = x0 as an initial starting point.
      void setInftNormCriterion(boolean inftNormCriterion)
      By default the infinity norm is used to judge convergence.
      void setLineSearch(LineSearch lineSearch)
      Sets the line search method used at each iteration
      void setMaximumIterations(int iterations)
      Sets the maximum number of iterations allowed for the optimization method
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BFGS

        public BFGS()
        Creates a new BFGS optimization object that uses a maximum of 250 iterations and a backtracking line search.
      • BFGS

        public BFGS(int maxIterations,
                    LineSearch lineSearch)
        Creates a new BFGS optimization object
        Parameters:
        maxIterations - the maximum number of iterations to allow before stopping
        lineSearch - the line search method to use on updates
    • Method Detail

      • optimize

        public void optimize(double tolerance,
                             Vec w,
                             Vec x0,
                             Function f,
                             FunctionVec fp,
                             boolean parallel)
        Description copied from interface: Optimizer
        Attempts to optimize the given function by finding the value of w that will minimize the value returned by f(w), using w = x0 as an initial starting point.
        Specified by:
        optimize in interface Optimizer
        Parameters:
        tolerance - the value that the gradient norm must be less than to consider converged
        w - the the location to store the final solution
        x0 - the initial guess for the solution. This value will not be changed, and intermediate matrices will be created as the same type.
        f - the objective function to minimizer
        fp - the derivative of the objective function, may be null depending on the optimizer
        parallel - true if multiple threads should be used for optimization, or false if a single thread should be used.
      • setInftNormCriterion

        public void setInftNormCriterion(boolean inftNormCriterion)
        By default the infinity norm is used to judge convergence. If set to false, the 2 norm will be used instead.
        Parameters:
        inftNormCriterion -
      • isInftNormCriterion

        public boolean isInftNormCriterion()
        Returns whether or not the infinity norm (true) or 2 norm (false) is used to determine convergence.
        Returns:
        true if the infinity norm is in use, false for the 2 norm
      • setMaximumIterations

        public void setMaximumIterations(int iterations)
        Description copied from interface: Optimizer
        Sets the maximum number of iterations allowed for the optimization method
        Specified by:
        setMaximumIterations in interface Optimizer
        Parameters:
        iterations - the maximum number of iterations to perform
      • getMaximumIterations

        public int getMaximumIterations()
        Description copied from interface: Optimizer
        Returns the maximum number of iterations to perform
        Specified by:
        getMaximumIterations in interface Optimizer
        Returns:
        the maximum number of iterations to perform
      • setLineSearch

        public void setLineSearch(LineSearch lineSearch)
        Sets the line search method used at each iteration
        Parameters:
        lineSearch - the line search method used at each iteration
      • getLineSearch

        public LineSearch getLineSearch()
        Returns the line search method used at each iteration
        Returns:
        the line search method used at each iteration
      • clone

        public Optimizer clone()
        Specified by:
        clone in interface Optimizer
        Overrides:
        clone in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.