Algorithms¶
Module: pycsou.core.solver
This module provides the base class for iterative algorithms.
|
Base class for iterative algorithms. |
-
class
GenericIterativeAlgorithm
(objective_functional: pycsou.core.map.Map, init_iterand: Any, max_iter: int = 500, min_iter: int = 10, accuracy_threshold: float = 0.001, verbose: Optional[int] = None)[source]¶ Bases:
abc.ABC
Base class for iterative algorithms.
Any instance/subclass of this class must at least implement the abstract methods
update_iterand
,print_diagnostics
update_diagnostics
andstopping_metric
.-
__init__
(objective_functional: pycsou.core.map.Map, init_iterand: Any, max_iter: int = 500, min_iter: int = 10, accuracy_threshold: float = 0.001, verbose: Optional[int] = None)[source]¶ - Parameters
objective_functional (Map) – Objective functional to minimise.
init_iterand (Any) – Initial guess for warm start.
max_iter (int) – Maximum number of iterations.
min_iter (int) – Minimum number of iterations.
accuracy_threshold (float) – Accuracy threshold for stopping criterion.
verbose (int) – Print diagnostics every
verbose
iterations. IfNone
does not print anything.
-
iterates
(n: int) → Tuple[source]¶ Generator allowing to loop through the n first iterates.
Useful for debugging/plotting purposes.
- Parameters
n (int) – Max number of iterates to loop through.
-