Static Line Search
Static line search is the simplest form of line search in which the guess for $\alpha$ is always just a fixed value.
Example
We show how to use linesearches in SimpleSolvers to solve a simple toy problem:
x = [3., 1.3]
y = similar(x)
f(y, x, params) = y .= 10 .* x .^ 3 ./ 6 .- x .^ 2 ./ 2
_params = NullParameters()
f(y, x, _params)
s = NewtonSolver(x, y; F = f)
c₁ = 1e-4
state = NonlinearSolverState(x)
update!(state, x, y)
direction!(s, x, _params, 0)
params = (x = state.x, parameters = _params)
α = .1
ls_method = Static(α)SimpleSolvers contains a function linesearch_problem that allocates a LinesearchProblem that only depends on $\alpha$:
ls_obj = linesearch_problem(s)We now use this to compute a static line search:
ls = Linesearch(ls_obj, ls_method)
solve(ls, 1.0, params)0.1