Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions modopt/opt/algorithms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


class SetUp(Observable):
r"""Algorithm Set-Up.
"""Algorithm Set-Up.

This class contains methods for checking the set-up of an optimisation
algorithm and produces warnings if they do not comply.
Expand All @@ -22,7 +22,7 @@ class SetUp(Observable):
metric_call_period : int, optional
Metric call period (default is ``5``)
metrics : dict, optional
Metrics to be used (default is ``\{\}``)
Metrics to be used (default is ``None``)
verbose : bool, optional
Option for verbose output (default is ``False``)
progress : bool, optional
Expand All @@ -34,6 +34,28 @@ class SetUp(Observable):
use_gpu : bool, optional
Option to use available GPU

Notes
-----
If provided, the ``metrics`` argument should be a nested dictionary of the
following form::

metrics = {
'metric_name': {
'metric': callable,
'mapping': {'x_new': 'test'},
'cst_kwargs': {'ref': ref_image},
'early_stopping': False,
}
}

Where ``callable`` is a function with arguments being for instance
``test`` and ``ref``. The mapping of the argument uses the same keys as the
output of ``get_notify_observer_kwargs``, ``cst_kwargs`` defines constant
arguments that will always be passed to the metric call.
If ``early_stopping`` is True, the metric will be used to check for
convergence of the algorithm, in that case it is recommended to have
``metric_call_period = 1``

See Also
--------
modopt.base.observable.Observable : parent class
Expand Down