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
— TypeOptions
A 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
x
a point with the current iteratestop
aStoppingCriterion
.
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 Options
o
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 representingDebugAction
s,Strings
used as dividers and a subsampling integer. These are passed as aDebugGroup
within:All
to theDebugOptions
decorator dictionary. Only excention is:Stop
that is passed to:Stop
.record
– (Array{Union{Symbol,RecordAction,Int},1}()
) specify recordings by usingSymbol
s orRecordAction
s 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
— TypeAbstractOptionsAction
a 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 <: AbstractOptionsAction
internal storage for AbstractOptionsAction
s to store a tuple of fields from an Options
s
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 certainSymbols
keys
– anNTuple
ofSymbols
to refer to fields ofOptions
once
– whether to update the internal values only once per iterationlastStored
– last iterate, where thisAbstractOptionsAction
was 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} <: Options
This 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
.