The Debug decorator for solver states

Manopt.DebugActionType
DebugAction

A DebugAction is a small functor to print/issue debug output. The usual call is given by (p::AbstractManoptProblem, s::AbstractManoptSolverState, k) -> s, where k is the current iteration.

By convention k=0 is interpreted as “for initialization only”: only debug info that prints initialization reacts. k<0 triggers updates of variables internally but does not trigger any output.

Fields (assumed by subtypes to exist)

  • print: method to perform the actual print. Can for example be set to a file export, or to @info. The default is the print function on the default Base.stdout.
source
Manopt.DebugEveryType
DebugEvery <: DebugAction

Evaluate and print debug only every $k$-th iteration. Otherwise no print is performed. Whether internal variables are updated is determined by always_update.

This method does not perform any print itself but relies on its children's print.

It also sets the sub solvers active parameter, see DebugWhenActive. Here, the activation_offset can be used to specify whether it refers to this iteration, the $k$-th: when this call is before the iteration, then the offset should be 0; for the next iteration, that is if this is called after an iteration, it has to be set to 1. Since usual debug is happening after the iteration, 1 is the default.

Constructor

DebugEvery(d::DebugAction, every=1, always_update=true; activation_offset=1)
source
Manopt.DebugGroupType
DebugGroup <: DebugAction

Group a set of DebugActions into one action, where the internal prints are removed by default and the resulting strings are concatenated.

Constructor

DebugGroup(g)

Construct a group consisting of an Array of DebugActions g, that are evaluated en bloc; the method does not perform any print itself, but relies on the internal prints. It still concatenates the result and returns the complete string.

source
Manopt.DebugSolverStateType
DebugSolverState <: AbstractManoptSolverState

The debug state appends debug to any state; it acts as a decorator. Internally a dictionary is kept that stores a DebugAction for several occasions using a Symbol as reference.

The original state can still be accessed using the get_state function.

Fields

  • state: the state that is extended by debug information
  • debug_dictionary: a Dict{Symbol,DebugAction} to keep track of debug output for different occasions

Constructors

DebugSolverState(st, dD)

Construct a debug decorated state, where dD can be

  • a DebugAction, then it is stored within the dictionary at :Iteration.
  • an Array of DebugActions.
  • a Dict{Symbol,DebugAction}.
  • an Array of Symbols, Strings and an Int for the DebugFactory.
  • a Function used as a callback, which is passed to the DebugFactory.
source

The solver implementation

Internal functions

Further reading

For concrete debug actions available, see the common debugs.