AlgorithmsInterface.jl
is a Julia package to provide a common interface to run iterative tasks.
Algorithm here refers to an iterative sequence of commands, that are run until a certain stopping criterion is met.
A first approach to algorithms is a simple for-loop for a maximum number of iterations. Using an interface instead allows to both specify different criteria to stop easily, even in their combination. Furthermore a generic interface allows to both “hook into” an algorithm easily as well as combining them.
A common interface for algorithms allows to reuse common code – especially stopping criteria, but especially also logging, debug, recording, and caching capabilities. Finally, a common interface also allows to easily combine existing algorithms, hence enhancing interoperability, for example using one algorithm as a sub routine of another one.
See the intial discussion as well as the overview on existing things
- generic stopping criteria
<:AbstractStoppingCriterion
StopAfterIteration(i)
for example
- a factory that turns certain keywords like
maxiter=
into stopping criteria - still support the
stopping_criterion=
ideas fromManopt.jl
- by default
stop()
from above would check such a stopping criterion - generic debug and record functionality – together with hooks even
- to
LineSearches.jl