Skip to contents

The line searches of LineSearch.jl, for the linesearch argument of the nonlinear solvers (and the gradient based optimizers). The merit is ResidualMerit(), 0.5 |F(u + alpha du)|^2, for nonlinear problems and ObjectiveMerit(), the objective, for optimization.

Usage

ResidualMerit()

ObjectiveMerit()

NoLineSearch(alpha = 1)

BackTracking(
  autodiff = NULL,
  c_1 = 1e-04,
  rho_hi = 0.5,
  rho_lo = 0.1,
  order = 3L,
  maxstep = Inf,
  initial_alpha = 1,
  maxiters = 1000L
)

ArmijoLineSearch(
  autodiff = NULL,
  c_1 = 1e-04,
  contraction = 0.5,
  initial_alpha = 1,
  maxiters = 40L
)

ProjectedBackTracking(
  c_1 = 1e-04,
  contraction = 0.5,
  initial_alpha = 1,
  maxiters = 40L
)

GoldenSection(tol = 1e-07, maxiters = 100L)

LiFukushimaLineSearch(
  lambda_0 = 1,
  beta = 0.5,
  sigma_1 = 0.001,
  sigma_2 = 0.001,
  eta = 0.1,
  rho = 0.9,
  nan_maxiters = 5L,
  maxiters = 100L
)

RobustNonMonotoneLineSearch(
  gamma = 1e-04,
  sigma_1 = 1,
  M = 10L,
  tau_min = 0.1,
  tau_max = 0.5,
  n_exp = 2L,
  maxiters = 100L,
  eta_strategy = function(fn_1, n, u, f) fn_1/n^2
)

StrongWolfeLineSearch(
  autodiff = NULL,
  c1 = 1e-04,
  c2 = 0.9,
  alpha_init = 1,
  alpha_max = 65536,
  maxiters = 10L,
  zoom_maxiters = 10L
)

MoreThuenteLineSearch(
  autodiff = NULL,
  ftol = 1e-04,
  gtol = 0.9,
  xtol = 1e-10,
  alpha_init = 1,
  alpha_min = 0,
  alpha_max = Inf,
  maxiters = 50L
)

HagerZhangLineSearch(
  autodiff = NULL,
  delta = 0.1,
  sigma = 0.9,
  epsilon = 1e-06,
  theta = 0.5,
  rho = 5,
  maxiters = 50L,
  alpha_init = 1,
  alpha_max = Inf
)

LineSearchesJL(method = "BackTracking", initial_alpha = 1, autodiff = NULL)

LineSearchSolution(step_size, retcode = "Success")

get_trial(cache)

set_initial_step(cache, alpha)

Arguments

alpha, initial_alpha, alpha_init, lambda_0

Initial steps.

autodiff

Ignored (derivatives are finite differences or exact).

c_1, c1, c2, ftol, gtol, xtol, delta, sigma, epsilon, theta, rho, beta, sigma_1, sigma_2, eta, gamma, tau_min, tau_max

Line search constants.

rho_hi, rho_lo

Bounds of the backtracking factor.

order

Interpolation order of BackTracking().

maxstep, alpha_max, alpha_min

Step limits.

maxiters, nan_maxiters, zoom_maxiters

Iteration limits.

contraction

Contraction factor.

tol

Tolerance of the golden section.

M, n_exp, eta_strategy

Settings of the non monotone search.

method

LineSearches.jl method name.

step_size, retcode

Fields of a solution.

cache

A line search cache.

Value

A line search algorithm or solution.

Details

NoLineSearch(alpha) takes the step alpha. BackTracking(c_1, rho_hi, rho_lo, order, maxstep, initial_alpha, maxiters) backtracks from initial_alpha by quadratic (order = 2) or cubic interpolation until the Armijo condition holds; ArmijoLineSearch(c_1, contraction, initial_alpha, maxiters) contracts by a fixed factor, and ProjectedBackTracking() does so on the projection of the trial point onto the bounds. GoldenSection(tol, maxiters) minimizes the merit on [0, 1] by golden section. LiFukushimaLineSearch() is the derivative free search of Li and Fukushima and RobustNonMonotoneLineSearch() the non monotone search of La Cruz, Martinez and Raydan used by DFSane(). StrongWolfeLineSearch(c1, c2, ...), MoreThuenteLineSearch(ftol, gtol, xtol, ...) and HagerZhangLineSearch(delta, sigma, ...) find a step that satisfies the strong Wolfe conditions (the latter two with the safeguarded cubic steps of More and Thuente and the bracketing of Hager and Zhang). LineSearchesJL(method) selects one of these by the name of its LineSearches.jl method ("BackTracking", "StrongWolfe", "MoreThuente", "HagerZhang", "Static"). LineSearchSolution(step_size, retcode) is the result of a search; get_trial() and set_initial_step() are its cache interface.

Examples

prob <- NonlinearProblem(function(u, p) c(u[1]^2 - 2, u[2] - u[1]), c(5, 5))
solve(prob, NewtonRaphson(linesearch = BackTracking()))$u
#> [1] 1.414214 1.414214