Class LineSearch

java.lang.Object
opennlp.tools.ml.maxent.quasinewton.LineSearch

public class LineSearch extends Object
Performs line search to find a minimum.
See Also:
  • Constructor Details

    • LineSearch

      public LineSearch()
  • Method Details

    • doLineSearch

      public static void doLineSearch(Function function, double[] direction, LineSearch.LineSearchResult lsr, double initialStepSize)
      Conducts a backtracking line search.
      Parameters:
      function - The Function to apply.
      direction - The double[] representing the direction to search into.
      lsr - The LineSearch.LineSearchResult to transport results in.
      initialStepSize - The initial step size to apply. Must be greater than 0.
    • doConstrainedLineSearch

      public static void doConstrainedLineSearch(Function function, double[] direction, LineSearch.LineSearchResult lsr, double l1Cost, double initialStepSize)
      Conducts a constrained line search (see section 3.2 in the paper "Scalable Training of L1-Regularized Log-Linear Models", Andrew et al. 2007)
      Parameters:
      function - The Function to apply.
      direction - The double[] representing the direction to search into.
      lsr - The LineSearch.LineSearchResult to transport results in.
      l1Cost - The L1-regularization costs. Must be equal or greater than 0.
      initialStepSize - The initial step size to apply. Must be greater than 0.