Introduction

Solvers

Solvers can be applied to Problems with solver specific Options.

List of Algorithms

The following algorithms are currently available

SolverFileProblem & Option
steepest DescentsteepestDescent.jlGradientProblem, GradientDescentOptions
Cyclic Proximal PointcyclicProximalPoint.jlProximalProblem, CyclicProximalPointOptions
Douglas–RachfordDouglasRachford.jlProximalProblem, DouglasRachfordOptions
Subgradient MethodsubGradientMethod.jlSubGradientProblem, SubGradientMethodOptions

Note that the Options can also be decorated to enhance your algorithm by general additional properties.

StoppingCriteria

Stopping criteria are implemented as a functor, i.e. inherit from the base type

StoppingCriterion

An abstract type for the functors representing stoping criteria, i.e. they are callable structures. The naming Scheme follows functions, see for example stopAfterIteration.

Every StoppingCriterion has to provide a constructor and its function has to have the interface (p,o,i) where a Problem as well as Options and the current number of iterations are the arguments and returns a Bool whether to stop or not.

By default each StoppingCriterion should provide a fiels reason to provide details when a criteion is met (and that is empty otherwise).

source
stopAfter <: StoppingCriterion

store a threshold when to stop looking at the complete runtime. It uses time_ns() to measure the time and you provide a Period as a time limit, i.e. Minute(15)

Constructor

stopAfter(t)

initialize the stopping criterion to a Period t to stop after.

source
stopAfterIteration <: StoppingCriterion

A functor for an easy stopping criterion, i.e. to stop after a maximal number of iterations.

Fields

  • maxIter – stores the maximal iteration number where to stop at
  • reason – stores a reason of stopping if the stopping criterion has one be reached, see getReason.

Constructor

stopAfterIteration(maxIter)

initialize the stopafterIteration functor to indicate to stop after maxIter iterations.

source
stopWhenAll <: StoppingCriterion

store an array of StoppingCriterion elements and indicates to stop, when all indicate to stop. The reseason is given by the concatenation of all reasons.

Constructor

stopWhenAll(c::Array{StoppingCriterion,1})
stopWhenAll(c::StoppingCriterion,...)
source
stopWhenAny <: StoppingCriterion

store an array of StoppingCriterion elements and indicates to stop, when any single one indicates to stop. The reseason is given by the concatenation of all reasons (assuming that all non-indicating return "").

Constructor

stopWhenAny(c::Array{StoppingCriterion,1})
stopWhenAny(c::StoppingCriterion,...)
source
stopWhenChangeLess <: StoppingCriterion

stores a threshold when to stop looking at the norm of the change of the optimization variable from within a Options, i.e o.x. For the storage a StoreOptionsAction is used

Constructor

stopWhenChangeLess(ε[, a])

initialize the stopping criterion to a threshold ε using the StoreOptionsAction a, which is initialized to just store :x by default.

source
stopWhenCostLess <: StoppingCriterion

store a threshold when to stop looking at the cost function of the optimization problem from within a Problem, i.e getCost(p,o.x).

Constructor

stopWhenCostLess(ε)

initialize the stopping criterion to a threshold ε.

source
stopWhenGradientNormLess <: StoppingCriterion

stores a threshold when to stop looking at the norm of the gradient from within a GradientProblem.

source

as well as the function

Manopt.getReasonFunction.
getReason(o)

return the current reason stored within the StoppingCriterion from within the Options This reason is empty if the criterion has never been met.

source
getReason(c)

return the current reason stored within a StoppingCriterion c. This reason is empty if the criterion has never been met.

source

further stopping criteria might be available for individual Solvers.

Decorated Solvers

The following decorators are available.

Debug Solver

The decorator to print debug during the iterations can be activated by decorating the Options with DebugOptions and implementing your own DebugActions. For example printing a gradient from the GradientDescentOptions is automatically available, as explained in the steepestDescent solver.

initializeSolver!(p,o)

Initialize the solver to the optimization Problem by initializing all values in the DebugOptionso.

source
doSolverStep!(p,o,iter)

Do one iteration step (the iterth) for Problemp by modifying the values in the Optionso.options and print Debug.

source
getSolverResult(p,o)

Return the final result after all iterations that is stored within the (modified during the iterations) Options o.

source
Manopt.stopSolver!Method.
stopSolver!(p,o,i)

determine whether the solver for Problem p and the DebugOptions o should stop at iteration i. If so, print all debug from :All and :Final.

source

Record Solver

The decorator to record certain values during the iterations can be activated by decorating the Options with RecordOptions and implementing your own RecordActions. For example recording the gradient from the GradientDescentOptions is automatically available, as explained in the steepestDescent solver.

initializeSolver!(p,o)

Initialize the solver to the optimization Problem by initializing the encapsulated options from within the RecordOptionso.

source
doSolverStep!(p,o,iter)

Do one iteration step (the iterth) for Problemp by modifying the values in the Optionso.options and record the result(s).

source
getSolverResult(p,o)

Return the final result after all iterations that is stored within the (modified during the iterations) Optionso.

source
Manopt.stopSolver!Method.
stopSolver!(p,o,i)

determine whether the solver for Problem p and the RecordOptions o should stop at iteration i. If so, do a (final) record to :All and :Stop.

source

Technical Details

The main function a solver calls is

Manopt.solveMethod.
solve(p,o)

run the solver implemented for the Problemp and the Optionso employing initializeSolver!, doSolverStep!, as well as the stopSolver! of the solver.

source

which is a framework, that you in general should not change or redefine. It uses the following methods, which also need to be implemented on your own algorithm, if you want to provide one.

initializeSolver!(p,o)

Initialize the solver to the optimization Problem by initializing all values in the Optionso.

source
doSolverStep!(p,o,iter)

Do one iteration step (the iterth) for Problemp by modifying the values in the Options o.

source
getSolverResult(p,o)

Return the final result after all iterations that is stored within the (modified during the iterations) Options o.

source
Manopt.stopSolver!Method.
stopSolver!(p,o,i)

depending on the current Problem p, the current state of the solver stored in Options o and the current iterate i this function determines whether to stop the solver by calling the StoppingCriterion.

source