Options
For most algorithms a certain set of options can either be generated beforehand of the function with keywords can be used. Generally the type
Manopt.Options — TypeOptionsA general super type for all options.
Fields
The following fields are assumed to be default. If you use different ones, provide the access functions accordingly
xa point with the current iteratestopaStoppingCriterion.
Manopt.get_options — Functionget_options(o::Options)return the undecorated Options of the (possibly) decorated o. As long as your decorated options store the options within o.options and the dispatch_options_decorator is set to Val{true}, the internal options are extracted.
Since the Options directly relate to a solver, they are documented with the corresponding solvers. You can always access the options (since they might be decorated) by calling get_options.
For easier access, and to abstract where these are actually stored, there exists
Manopt.get_iterate — Functionget_iterate(O::Options)return the (last stored) iterate within Options`O. By default also undecorates the options beforehand
Manopt.set_iterate! — Functionset_iterate!(O::Options, p)set the iterate to some (start) value p.
Decorators for Options
Options can be decorated using the following trait and function to initialize
Manopt.dispatch_options_decorator — Functiondispatch_options_decorator(o::Options)Indicate internally, whether an Options o to be of decorating type, i.e. it stores (encapsulates) options in itself, by default in the field o. options.
Decorators indicate this by returning Val{true} for further dispatch.
The default is Val{false}, i.e. by default an options is not decorated.
Manopt.is_options_decorator — Functionis_options_decorator(o::Options)Indicate, whether Options o are of decorator type.
Manopt.decorate_options — Functiondecorate_options(o)decorate the Optionso with specific decorators.
Optional Arguments
optional arguments provide necessary details on the decorators. A specific one is used to activate certain decorators.
debug– (Array{Union{Symbol,DebugAction,String,Int},1}()) a set of symbols representingDebugActions,Stringsused as dividers and a subsampling integer. These are passed as aDebugGroupwithin:Allto theDebugOptionsdecorator dictionary. Only excention is:Stopthat is passed to:Stop.record– (Array{Union{Symbol,RecordAction,Int},1}()) specify recordings by usingSymbols orRecordActions directly. The integer can again be used for only recording every $i$th iteration.return_options- (false) indicate whether to wrap the options in aReturnOptions, indicating that the solver should return options and not (only) the minimizer.
See also
In general decorators often perform actions so we introduce
Manopt.AbstractOptionsAction — TypeAbstractOptionsActiona common Type for AbstractOptionsActions that might be triggered in decoraters, for example DebugOptions or RecordOptions.
as well as a helper for storing values using keys, i.e.
Manopt.StoreOptionsAction — TypeStoreTupleAction <: AbstractOptionsActioninternal storage for AbstractOptionsActions to store a tuple of fields from an Optionss
This functor posesses the usual interface of functions called during an iteration, i.e. acts on (p,o,i), where p is a Problem, o is an Options and i is the current iteration.
Fields
values– a dictionary to store interims values based on certainSymbolskeys– anNTupleofSymbolsto refer to fields ofOptionsonce– whether to update the internal values only once per iterationlastStored– last iterate, where thisAbstractOptionsActionwas called (to determineonce
Constructiors
StoreOptionsAction([keys=(), once=true])Initialize the Functor to an (empty) set of keys, where once determines whether more that one update per iteration are effective
StoreOptionsAction(keys, once=true])Initialize the Functor to a set of keys, where the dictionary is initialized to be empty. Further, once determines whether more that one update per iteration are effective, otherwise only the first update is stored, all others are ignored.
Manopt.get_storage — Functionget_storage(a,key)return the internal value of the StoreOptionsAction a at the Symbol key.
Manopt.has_storage — Functionget_storage(a,key)return whether the StoreOptionsAction a has a value stored at the Symbol key.
Manopt.update_storage! — Functionupdate_storage!(a,o)update the StoreOptionsAction a internal values to the ones given on the Options o.
update_storage!(a,o)update the StoreOptionsAction a internal values to the ones given in the dictionary d. The values are merged, where the values from d are preferred.
A simple example is the
Manopt.ReturnOptions — TypeReturnOptions{O<:Options} <: OptionsThis internal type is used to indicate that the contained Options options should be returned at the end of a solver instead of the usual minimizer.
See also
as well as DebugOptions and RecordOptions.