Line searches and initial step guesses of LineSearches.jl
Source:R/optimization-optimjl.R
optim_linesearches.RdHagerZhang(), Static(), BackTracking(), StrongWolfe() (Nocedal
and Wright, Algorithms 3.5 and 3.6) and MoreThuente() (More and Thuente,
1994) are the line searches of LineSearches.jl, and InitialStatic(), InitialPrevious(),
InitialHagerZhang(), InitialQuadratic() and InitialConstantChange()
its initial step length guesses. They are reached as
Optim$LineSearches$HagerZhang() and so on (Julia's
Optim.LineSearches.HagerZhang()), and passed as the linesearch and
alphaguess arguments of the Optim methods.
Arguments
- delta, sigma
The Wolfe conditions of the Hager Zhang search.
- alphamax
The largest step.
- rho
The expansion factor of the bracketing phase.
- epsilon
The approximate Wolfe tolerance.
- gamma
The interval shrinking factor.
- linesearchmax
The largest number of iterations.
- psi3
The factor that shrinks a step with a non finite value.
- check_flatness
Stop when the function is flat on the bracket.
- c_1
The sufficient decrease constant.
- c_2
The curvature constant of the strong Wolfe conditions.
- f_tol, gtol
The sufficient decrease and curvature constants of the More Thuente search.
- x_tol
The relative width of the interval of uncertainty at which the More Thuente search stops.
- maxfev
The largest number of evaluations of the More Thuente search.
- rho_hi, rho_lo
The safeguards of the backtracking step.
- iterations
The largest number of backtracking steps.
- order
The order of the interpolation (2 or 3).
- maxstep
The largest step norm.
- alpha
The step length.
- scaled
Scale the step by the norm of the direction.
- alphamin
The smallest step.
- psi0, psi1, psi2
The parameters of the Hager Zhang initial guess.
- alpha0
The first initial step.
- quadstep
Use the quadratic step of the Hager Zhang guess.
- alpha_min, alpha_max, rho_0
The bounds and the largest decrease of the quadratic and constant change guesses.
- snap2one
Step lengths in this closed interval become 1.
Examples
ls <- Optim$LineSearches$HagerZhang()
ag <- Optim$LineSearches$InitialStatic(alpha = 0.5)
prob <- OptimizationProblem(function(x, p) sum((x - 1)^2), c(0, 0),
grad = function(x, p) 2 * (x - 1))
solve(prob, GradientDescent(alphaguess = ag, linesearch = ls))$u
#> [1] 1 1