Skip to content

Commit ce7fa88

Browse files
committed
update docs
1 parent e58e583 commit ce7fa88

1 file changed

Lines changed: 34 additions & 20 deletions

File tree

src/plans/stepsize/initial_guess.jl

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,56 @@
1+
"""
2+
AbstractInitialLinesearchGuess
3+
4+
An abstract type for initial line search guess strategies. These are functors that map
5+
`(problem, state, k, last_stepsize, η) -> α_0`, where `α_0` is the initial step size,
6+
based on
7+
8+
* an [`AbstractManoptProblem`](@ref) `problem`
9+
* an [`AbstractManoptSolverState`](@ref) `state`
10+
* the current iterate `k`
11+
* the last step size `last_stepsize`
12+
* the search direction `η`
13+
"""
114
abstract type AbstractInitialLinesearchGuess end
215

16+
"""
17+
ConstantInitialGuess{TF} <: AbstractInitialLinesearchGuess
18+
19+
Implement a constant initial guess for line searches.
20+
21+
# Constructor
22+
23+
ConstantInitialGuess(α::TF)
24+
25+
where `α` is the constant initial step size.
26+
"""
327
struct ConstantInitialGuess{TF} <: AbstractInitialLinesearchGuess
428
α::TF
529
end
630
ConstantInitialGuess() = ConstantInitialGuess(1.0)
731

832
function (cig::ConstantInitialGuess)(
9-
mp::AbstractManoptProblem, s::AbstractManoptSolverState, ::Int, l::Real, η; kwargs...
33+
::AbstractManoptProblem, ::AbstractManoptSolverState, ::Int, ::Real, η; kwargs...
1034
)
1135
return cig.α
1236
end
1337

14-
15-
struct ArmijoInitialGuess <: AbstractInitialLinesearchGuess end
16-
1738
"""
18-
(::ArmijoInitialGuess)(mp::AbstractManoptProblem, s::AbstractManoptSolverState, k, l, η; kwargs...)
39+
ArmijoInitialGuess <: AbstractInitialLinesearchGuess
1940
20-
# Input
41+
Implement the initial guess for an Armijo line search.
2142
22-
* `mp`: the [`AbstractManoptProblem`](@ref) we are aiming to minimize
23-
* `s`: the [`AbstractManoptSolverState`](@ref) for the current solver
24-
* `k`: the current iteration
25-
* `l`: the last step size computed in the previous iteration.
26-
* `η`: the search direction
43+
The initial step size is chosen as `min(l, max_stepsize(M, p) / norm(M, p, η))`,
44+
where `l` is the last step size used, `p` the current point and `η` the search direction.
2745
28-
Return an initial guess for the [`ArmijoLinesearchStepsize`](@ref).
46+
The default provided is based on the [`max_stepsize`](@ref)`(M)`.
2947
30-
The default provided is based on the [`max_stepsize`](@ref)`(M)`, which we denote by ``m``.
31-
Let further ``X`` be the current descent direction with norm ``n=$(_tex(:norm, "X"; index = "p"))`` its length.
32-
Then this (default) initial guess returns
48+
# Constructor
3349
34-
* ``l`` if ``m`` is not finite
35-
* ``$(_tex(:min))(l, $(_tex(:frac, "m", "n")))`` otherwise
36-
37-
This ensures that the initial guess does not yield to large (initial) steps.
50+
ArmijoInitialGuess()
3851
"""
52+
struct ArmijoInitialGuess <: AbstractInitialLinesearchGuess end
53+
3954
function (::ArmijoInitialGuess)(
4055
mp::AbstractManoptProblem, s::AbstractManoptSolverState, ::Int, l::Real, η; kwargs...
4156
)
@@ -58,7 +73,6 @@ _doc_stepsize_initial_guess(default = "") = """
5873
and should at least accept the keywords
5974
* `lf0 = `[`get_cost`](@ref)`(problem, get_iterate(state))` the current cost at ^p` here interpreted as the initial point of `f` along the line search direction`
6075
* `Dlf0 = `[`get_differential`](@ref)`(problem, get_iterate(state), η)` the directional derivative at point `p` in direction `η`
61-
6276
"""
6377

6478
"""

0 commit comments

Comments
 (0)