jsat.math.optimization
Interface LineSearch
-
- All Known Implementing Classes:
- BacktrackingArmijoLineSearch, WolfeNWLineSearch
public interface LineSearchLine search defines a method of minimizing a function φ(α) = f(x+α p) where α > 0 is a scalar value, and x and p are fixed vectors.
Different line search methods may or may not use all the input variables.
The LineSearch is allowed to maintain a history of update values to use on future calls. For this reason, acloneof the line search should be used for each new optimization problem.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method and Description LineSearchclone()Returns a clone of the line search objectdefault doublelineSearch(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)Attempts to find the value of α that minimizes f(x+α p)doublelineSearch(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(x+α p)booleanupdatesGrad()When performing thelinear searchstep some line searches may or may not use the gradient information.
-
-
-
Method Detail
-
lineSearch
default 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)Attempts to find the value of α that minimizes f(x+α p)- Parameters:
alpha_max- the maximum value for α to search forx_k- the initial value to search fromx_grad- the gradient of ∇ f(xk)p_k- the direction updatef- the function to minimize the value of f(xk + α pk)fp- the gradient of f, ∇f(x), may benulldepending upon the linesearch methodf_x- the value of f(xk), orDouble.NaNif it needs to be computedgradP- the value of ∇f(xk)Tpk, orDouble.NaNif it needs to be computedx_alpha_pk- the location to store the value of xk + α pkfxApRet- an array to store the computed result of f(xk + α pk) in the first index contain. May benulland the value will not be returnedgrad_x_alpha_pk- location to store the value of ∇ f(xkα+pk). May benull, local storage will be allocated if needed- Returns:
- the value of α that satisfies the line search in minimizing f(xk + α pk)
-
lineSearch
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(x+α p)- Parameters:
alpha_max- the maximum value for α to search forx_k- the initial value to search fromx_grad- the gradient of ∇ f(xk)p_k- the direction updatef- the function to minimize the value of f(xk + α pk)fp- the gradient of f, ∇f(x), may benulldepending upon the line search methodf_x- the value of f(xk), orDouble.NaNif it needs to be computedgradP- the value of ∇f(xk)Tpk, orDouble.NaNif it needs to be computedx_alpha_pk- the location to store the value of xk + α pkfxApRet- an array to store the computed result of f(xk + α pk) in the first index contain. May benulland the value will not be returnedgrad_x_alpha_pk- location to store the value of ∇ f(xkα+pk). May benull, local storage will be allocated if neededparallel-trueif this line search should be done using multiple cores, orfalseto be single threaded.- Returns:
- the value of α that satisfies the line search in minimizing f(xk + α pk)
-
updatesGrad
boolean updatesGrad()
When performing thelinear searchstep some line searches may or may not use the gradient information. If the gradient information is used and updated, this method will returntrue. If not the given vector will be unused and not updated, and this method will returnfalse- Returns:
trueif thegrad_x_alpha_pkparameter of lineSearch will be up-to-date after the call, orfalseif the gradient value will need to be computed after.
-
clone
LineSearch clone()
Returns a clone of the line search object- Returns:
- a clone of the line search object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG