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

Class BacktrackingArmijoLineSearch

  • All Implemented Interfaces:
    LineSearch


    public class BacktrackingArmijoLineSearch
    extends java.lang.Object
    implements LineSearch
    An implementation of Backtraking line search using the Armijo rule. The search for alpha is done by quadratic and cubic interpolation without using any derivative evaluations.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      BacktrackingArmijoLineSearch clone()
      Returns a clone of the line search object
      double getC1()
      Returns the sufficient decrease condition constant
      double lineSearch(double alpha_max, Vec x_k, Vec x_grad, Vec p_k, Function f, FunctionVec fp, double f_x, double gradP, Vec x_alpha_pk, double[] fxApRet, Vec grad_x_alpha_pk, boolean parallel)
      Attempts to find the value of α that minimizes f(xp)
      void setC1(double c1)
      Sets the constant used for the sufficient decrease condition f(x+α p) ≤ f(x) + c1 α pT∇f(x)
      boolean updatesGrad()
      When performing the linear search step some line searches may or may not use the gradient information.
      • Methods inherited from class java.lang.Object

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

      • BacktrackingArmijoLineSearch

        public BacktrackingArmijoLineSearch()
        Creates a new Backtracking line search
      • BacktrackingArmijoLineSearch

        public BacktrackingArmijoLineSearch(double rho,
                                            double c1)
        Creates a new Backtracking line search object
        Parameters:
        rho - constant to decrease alpha by in (0, 1) when interpolation is not possible
        c1 - the sufficient decrease condition condition constant in (0, 1/2)
    • Method Detail

      • setC1

        public void setC1(double c1)
        Sets the constant used for the sufficient decrease condition f(x+α p) ≤ f(x) + c1 α pT∇f(x)
        Parameters:
        c1 - the sufficient decrease condition
      • getC1

        public double getC1()
        Returns the sufficient decrease condition constant
        Returns:
        the sufficient decrease condition constant
      • lineSearch

        public double lineSearch(double alpha_max,
                                 Vec x_k,
                                 Vec x_grad,
                                 Vec p_k,
                                 Function f,
                                 FunctionVec fp,
                                 double f_x,
                                 double gradP,
                                 Vec x_alpha_pk,
                                 double[] fxApRet,
                                 Vec grad_x_alpha_pk,
                                 boolean parallel)
        Description copied from interface: LineSearch
        Attempts to find the value of α that minimizes f(xp)
        Specified by:
        lineSearch in interface LineSearch
        Parameters:
        alpha_max - the maximum value for α to search for
        x_k - the initial value to search from
        x_grad - the gradient of ∇ f(xk)
        p_k - the direction update
        f - the function to minimize the value of f(xk + α pk)
        fp - the gradient of f, ∇f(x), may be null depending upon the line search method
        f_x - the value of f(xk), or Double.NaN if it needs to be computed
        gradP - the value of ∇f(xk)Tpk, or Double.NaN if it needs to be computed
        x_alpha_pk - the location to store the value of xk + α pk
        fxApRet - an array to store the computed result of f(xk + α pk) in the first index contain. May be null and the value will not be returned
        grad_x_alpha_pk - location to store the value of ∇ f(xkα+pk). May be null, local storage will be allocated if needed
        parallel - true if this line search should be done using multiple cores, or false to be single threaded.
        Returns:
        the value of α that satisfies the line search in minimizing f(xk + α pk)
      • updatesGrad

        public boolean updatesGrad()
        Description copied from interface: LineSearch
        When performing the linear search step some line searches may or may not use the gradient information. If the gradient information is used and updated, this method will return true. If not the given vector will be unused and not updated, and this method will return false
        Specified by:
        updatesGrad in interface LineSearch
        Returns:
        true if the grad_x_alpha_pk parameter of lineSearch will be up-to-date after the call, or false if the gradient value will need to be computed after.
      • clone

        public BacktrackingArmijoLineSearch clone()
        Description copied from interface: LineSearch
        Returns a clone of the line search object
        Specified by:
        clone in interface LineSearch
        Overrides:
        clone in class java.lang.Object
        Returns:
        a clone of the line search object

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.