The solver interface functions

A solver is the combination of a problem, usually providing at least the manifold and the objective, together with a state.

Given these two, the function to call is solve!, which is a framework that you in general should not change or redefine. It uses the following methods, which also need to be implemented for your own algorithm, if you want to provide one.

Manopt.decorate_objective!Method
decorate_objective!(M, o::AbstractManifoldObjective; kwargs...)

Decorate the AbstractManifoldObjective o with specific decorators.

Optional arguments

The optional arguments provide necessary details on the decorators; providing one of them activates the corresponding decorator.

  • cache=missing: specify a cache. Currently :Simple is supported and :LRU if you load LRUCache.jl. For this case a tuple specifying what to cache and how many entries to keep has to be provided. For example (:LRU, [:Cost, :Gradient], 10) states that the last 10 used cost function evaluations and gradient evaluations should be stored. See objective_cache_factory for details.
  • count=missing: specify which calls to the objective should be counted, see ManifoldCountObjective for the full list.
  • objective_type=:Riemannian: specify that an objective is :Riemannian or :Euclidean. The :Euclidean symbol is equivalent to specifying it as :Embedding, since in the end, both refer to converting an objective from the embedding (whether it is Euclidean or not) to the Riemannian one.
  • return_objective=false: indicate whether to wrap the objective in a ReturnManifoldObjective, indicating that the solver should return the objective as well.

See also

objective_cache_factory

source
Manopt.decorate_state!Method
decorate_state!(s::AbstractManoptSolverState; kwargs...)

Decorate the AbstractManoptSolverState s with specific decorators.

Optional arguments

The optional arguments provide necessary details on the decorators.

  • callback=missing: (deprecated) add an arbitrary (simple) callback function cb() to be called every iteration.
  • debug=Array{Union{Symbol,DebugAction,String,Int, Function},1}(): a set of symbols representing DebugActions, Strings used as dividers and a sub-sampling integer. These are passed as a DebugGroup within :Iteration to the DebugSolverState decorator dictionary. A function is added as a (non-simple) callback within a DebugCallback. Only exception is :Stop that is passed to :Stop.
  • record=Array{Union{Symbol,RecordAction,Int},1}(): specify recordings by using Symbols or RecordActions directly. An integer can again be used for only recording every $k$-th iteration.
  • return_state=false: indicate whether to wrap the state in a ReturnSolverState, indicating that the solver should return the state and not (only) the minimizer.

All other keywords are ignored.

See also

DebugSolverState, RecordSolverState, ReturnSolverState

source
Manopt.get_costMethod
get_cost(p::AbstractManoptProblem, s::AbstractManoptSolverState)

Get cost at the current iterate of the solver state s for the problem p. The method may be implemented by particular solvers if they store the cost at the current iterate in the state, but by default it is obtained by calling get_cost(p, get_iterate(s)).

source

Internal functions

Manopt.ClosedFormSubSolverStateType
ClosedFormSubSolverState <: AbstractManoptSolverState

Subsolver state indicating that a closed-form solution is available.

Constructor

ClosedFormSubSolverState()
source