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.AbstractManoptSolverStateType
AbstractManoptSolverState

A 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 iterate
  • callbacks::D: provided callback functions`` provided as a dictionary symbols as keys
  • stop::StoppingCriterion: a functor indicating that the stopping criterion is fulfilled
source

Access functions

Manopt.get_countMethod
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

  • :Iterations is passed on to the stop field to obtain the iteration at which the solver stopped.
source
Manopt.get_iterateMethod
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.

source
Manopt.get_stateFunction
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.

source
Manopt.stopped_atMethod
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.

source

Internal functions

Manopt.get_messageMethod
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.

source