Common Record Actions
Recordings during the iteration can be added to any solver run, since all solvers accept the record= keyword. This is handled by the RecordActionFactory.
Manopt.RecordChange — Type
RecordChange <: RecordActiondebug for the amount of change of the iterate (see get_iterate(s) of the AbstractManoptSolverState) during the last iteration.
Fields
storage: aStoreStateActionto store (at least) the last iterate to use this as the last value (to compute the change) serving as a potential cache shared with other components of the solver.inverse_retraction_method::AbstractInverseRetractionMethod=default_inverse_retraction_method(M, typeof(p)): an inverse retraction $\operatorname{retr}^{-1}$ to use, see the section on retractions and their inversesrecorded_values: to store the recorded values
Constructor
RecordChange(M=DefaultManifold(); inverse_retraction_method = default_inverse_retraction_method(M), storage = StoreStateAction(M; store_points=Tuple{:Iterate}))with the previous fields as keywords. For the DefaultManifold only the field storage is used. Providing the actual manifold moves the default storage to the efficient point storage.
Manopt.RecordCost — Type
RecordCost <: RecordActionRecord the current cost function value, see get_cost.
Fields
recorded_values: to store the recorded values
Constructor
RecordCost()Manopt.RecordEntry — Type
RecordEntry{T} <: RecordActionrecord a certain fields entry of type {T} during the iterates
Fields
recorded_values: the recorded Iteratesfield: Symbol the entry can be accessed with withinAbstractManoptSolverState
Constructor
RecordEntry(::T, f::Symbol)RecordEntry(T::DataType, f::Symbol)Initialize the record action to record the state field f, and initialize the recorded_values to be a vector of element type T.
Examples
RecordEntry(rand(M), :q)to record the points fromMstored in some statess.qRecordEntry(SVDMPoint, :p)to record the fields.pwhich takes values of typeSVDMPoint.
Manopt.RecordEntryChange — Type
RecordEntryChange{T} <: RecordActionrecord a certain entries change during iterates
Additional fields
recorded_values: the recorded Iteratesfield: Symbol the field can be accessed with withinAbstractManoptSolverStatedistance: function (p,o,x1,x2) to compute the change/distance between two values of the entrystorage: aStoreStateActionto store (at least)getproperty(o, d.field)
Constructor
RecordEntryChange(f::Symbol, d, a::StoreStateAction=StoreStateAction([f]))Manopt.RecordGradient — Type
RecordGradient <: RecordActionrecord the gradient evaluated at the current iterate
Constructors
RecordGradient(ξ)initialize the RecordAction to the corresponding type of the tangent vector.
Manopt.RecordGradientNorm — Type
RecordGradientNorm{R<:Real} <: RecordActionrecord the norm of the current gradient
Constructor
RecordGradientNorm(r::Type{<:Real}=Float64)Manopt.RecordIterate — Type
RecordIterate <: RecordActionrecord the iterate
Constructors
RecordIterate(x0)initialize the iterate record array to the type of x0, which indicates the kind of iterate
RecordIterate(P)initialize the iterate record array to the data type T.
Manopt.RecordIteration — Type
RecordIteration <: RecordActionrecord the current iteration
Manopt.RecordProximalParameter — Type
RecordProximalParameter{R <: Real} <: RecordActionrecord the current iterates proximal point algorithm parameter given by in AbstractManoptSolverStates o.λ.
Constructor
RecordProximalParameter(r::Type{<:Real}=Float64)Manopt.RecordStepsize — Type
RecordStepsize <: RecordActionRecord the step size.
Constructor
RecordStepsize(r::Type{<:Real}=Float64)Manopt.RecordStoppingReason — Type
RecordStoppingReason <: RecordActionRecord reason the solver stopped, see get_reason.
Manopt.RecordTime — Type
RecordTime <: RecordActionrecord the time elapsed during the current iteration.
The three possible modes are
:cumulativerecord times without resetting the timer:iterativerecord times with resetting the timer:totalrecord a time only at the end of an algorithm (seestop_solver!)
The default is :cumulative, and any non-listed symbol default to using this mode.
Constructor
RecordTime(; mode::Symbol=:cumulative)Manopt.RecordDualBaseChange — Method
RecordDualBaseChange(e)Create an RecordAction that records the dual base point change, an RecordEntryChange of o.n with distance to the last value to store a value.
Manopt.RecordDualBaseIterate — Method
RecordDualBaseIterate(n)Create an RecordAction that records the dual base point, an RecordEntry of o.n.
Manopt.RecordDualChange — Method
RecordDualChange()Create the action either with a given (shared) Storage, which can be set to the values Tuple, if that is provided).
Manopt.RecordDualIterate — Method
RecordDualIterate(X)Create an RecordAction that records the dual base point, an RecordEntry of o.X.
Manopt.RecordPrimalBaseChange — Method
RecordPrimalBaseChange()Create an RecordAction that records the primal base point change, an RecordEntryChange of o.m with distance to the last value to store a value.
Manopt.RecordPrimalBaseIterate — Method
RecordPrimalBaseIterate(x)Create an RecordAction that records the primal base point, an RecordEntry of o.m.
Manopt.RecordPrimalChange — Method
RecordPrimalChange(a)Create an RecordAction that records the primal value change, RecordChange, to record the change of o.p.
Manopt.RecordPrimalIterate — Method
RecordPrimalIterate(x)Create an RecordAction that records the primal point, an RecordIterate of o.p.
Internal functions
Manopt.RecordActionFactory — Method
RecordActionFactory(s::AbstractManoptSolverState, a)create a RecordAction where
- a
RecordActionis passed through - a [
Symbol] creates:Changeto record the change of the iterates, seeRecordChange:Costto record the current cost function value:Gradientto record the gradient, seeRecordGradient:GradientNorm to record the norm of the gradient, see [RecordGradientNorm`](@ref):Iterateto record the iterate:Iterationto record the current iteration number:IterativeTimeto record the times taken for each iteration.:ProximalParameterto record the proximal parameter, seeRecordProximalParameter:Stepsizeto record the current step size:Timeto record the total time taken after every iteration
and every other symbol is passed to RecordEntry, which results in recording the field of the state with the symbol indicating the field of the solver to record.
Manopt.RecordActionFactory — Method
RecordActionFactory(s::AbstractManoptSolverState, t::Tuple{Symbol, T}) where {T}create a RecordAction where
- (
:Subsolver, s) creates aRecordSubsolverwithrecord=set to the second tuple entry
For other symbol the second entry is ignored and the symbol is used to generate a RecordEntry recording the field with the name symbol of s.
Manopt.RecordFactory — Method
RecordFactory(s::AbstractManoptSolverState, a)Generate a dictionary of RecordActions.
First all Symbols String, RecordActions and numbers are collected, excluding :Stop and :WhenActive. This collected vector is added to the :Iteration => [...] pair. :Stop is added as :StoppingCriterion to the :Stop => [...] pair. If any of these two pairs does not exist, it is pairs are created when adding the corresponding symbols
For each Pair of a Symbol and a Vector, the RecordGroupFactory is called for the Vector and the result is added to the debug dictionary's entry with said symbol. This is wrapped into the RecordWhenActive, when the :WhenActive symbol is present
Return value
A dictionary for the different entry points where debug can happen, each containing a RecordAction to call.
Note that upon the initialization all dictionaries but the :StartAlgorithm one are called with an i=0 for reset.
Manopt.RecordGroupFactory — Method
RecordGroupFactory(s::AbstractManoptSolverState, a)Generate a [RecordGroup] of RecordActions. The following rules are used
- Any
Symbolcontained inais passed toRecordActionFactory - Any
RecordActionis included as is.
Any Pair of a RecordAction and a symbol, that is in order RecordCost() => :A is handled, that the corresponding record action can later be accessed as g[:A], where gis the record group generated here.
If this results in more than one RecordAction a RecordGroup of these is build.
If any integers are present, the last of these is used to wrap the group in a RecordEvery(k).
If :WhenActive is present, the resulting Action is wrapped in RecordWhenActive, making it deactivatable by its parent solver.