The Manopt.jl Solver state
The solver state represents all parameters that determine the solver's setup as well as interims memory, e.g. to avoid allocations or to keep certain variables in between iterations. These should also allow insight into how the solver is performing.
A state can be decorated to add functionality
Abstract state
Manopt.AbstractManoptSolverState — Type
AbstractManoptSolverStateA general super type for all solver states.
Fields
The following fields are assumed to be available by default. If you use different ones, adapt the the access functions get_iterate, get_stopping_criterion, and get_callbacks accordingly
p::P: a point on the manifold $\mathcal{M}$ storing the current iteratecallbacks::D: provided callback functions`` provided as a dictionary symbols as keysstop::StoppingCriterion: a functor indicating that the stopping criterion is fulfilled
Access functions
Manopt.get_count — Method
get_count(ams::AbstractManoptSolverState, ::Symbol)Obtain the count for a certain countable size, for example the :Iterations. This function returns 0 if there was nothing to count
Available symbols from within the solver state
:Iterationsis passed on to thestopfield to obtain the iteration at which the solver stopped.
Manopt.get_iterate — Method
get_iterate(state::AbstractManoptSolverState)return the (last stored) iterate within AbstractManoptSolverStatestate`. This should usually refer to a single point on the manifold the solver is working on
By default this also removes all decorators of the state beforehand.
Manopt.get_state — Function
get_state(s::AbstractManoptSolverState, recursive::Bool=true)return the (one step) undecorated AbstractManoptSolverState of the (possibly) decorated s. As long as your decorated state stores the state within s.state and the dispatch_objective_decorator is set to Val{true}, the internal state are extracted automatically.
By default the state that is stored within a decorated state is assumed to be at s.state. Overwrite _get_state(s, ::Val{true}, recursive) to change this behaviour for your states` for both the recursive and the direct case.
If recursive is set to false, only the most outer decorator is taken away instead of all.
Manopt.get_stopping_criterion — Method
get_stopping_criterion(ams::AbstractManoptSolverState)Return the StoppingCriterion stored within the AbstractManoptSolverState ams.
For an undecorated state, this is assumed to be in ams.stop. Overwrite _get_stopping_criterion(yms::YMS) to change this for your manopt solver (yms) assuming it has type YMS`.
Manopt.has_converged — Method
has_converged(ams::AbstractManoptSolverState)Return whether the solver has converged, based on the internal StoppingCriterion.
Manopt.set_iterate! — Method
set_iterate!(s::AbstractManoptSolverState, M::AbstractManifold, p)set the iterate within an AbstractManoptSolverState to some (start) value p.
Manopt.stopped_at — Method
stopped_at(state::AbstractManoptSolverState)Return the number of iterations the solver represented by the state took to stop. If the solver has not yet stopped, this function returns -1.
By default, this function calls get_count function on the state's stopping criterion to access its :Iteration count.
Internal functions
Manopt.get_message — Method
get_message(du::AbstractManoptSolverState)get a message (String) from internal functors, in a summary. This should return any message a sub-step might have issued as well.