Class LineSearch
java.lang.Object
opennlp.tools.ml.maxent.quasinewton.LineSearch
Performs line search to find a minimum.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents aLineSearch
result encapsulating the relevant data at a point in time during computation. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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)static void
doLineSearch
(Function function, double[] direction, LineSearch.LineSearchResult lsr, double initialStepSize) Conducts a backtracking line search.
-
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
- TheFunction
to apply.direction
- Thedouble[]
representing the direction to search into.lsr
- TheLineSearch.LineSearchResult
to transport results in.initialStepSize
- The initial step size to apply. Must be greater than0
.
-
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
- TheFunction
to apply.direction
- Thedouble[]
representing the direction to search into.lsr
- TheLineSearch.LineSearchResult
to transport results in.l1Cost
- The L1-regularization costs. Must be equal or greater than0
.initialStepSize
- The initial step size to apply. Must be greater than0
.
-