Abstraction for iterative algorithms.
The standard way of using an
Algobject, say alg, is as follows:
>>> while not alg.done(): >>> alg.update()
The user is free to run other things in the while loop. An
Algobject is meant to run once. Once done, the object should not be run again.
When creating a new
Algclass, the user should supply an _update() function to perform the iterative update, and optionally a _done() function to determine when to terminate the iteration. The default _done() function simply checks whether the number of iterations has reached the maximum.
The interface for each
Algclass should not depend on Linop or Prox explicitly. For example, if the user wants to design an
Algclass to accept a Linop, say A, as an argument, then it should also accept any function that can be called to compute x -> A(x). Similarly, to accept a Prox, say proxg, as an argument, the Alg class should accept any function that can be called to compute alpha, x -> proxg(x).
Parameters: max_iter (int) – Maximum number of iterations.
Maximum number of iterations.
Initialize self. See help(type(self)) for accurate signature.
Return whether the algorithm is done.
Perform one update step.