Skip to content

🧮 AlgorithmsInterface: WIP – collecting ideas for a common algorithm interface.

Notifications You must be signed in to change notification settings

JuliaManifolds/AlgorithmsInterface.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

IterativeAlgorithmsInterface.jl

IterativeAlgorithmsInterface.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.

Statement of need

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.

Main features

We consider solving Tasks, which consist of

  • An AbstractProblem to solve, which contains all information that is static to the problem and usually does not change during the iterations, this might for example be a cost function and its gradient in an optimisation problem.
  • An AbstractAlgorithmState that both specifies which algorithm to use to solve the problem, but also stores all parameters that an algorithm needs as well as everything the algorithm needs to store between two iterations.

This generic data structures are accompanied by the methods

  • step!(problem::Problem, state::AlgorithmState, k) to perform the kth iteration of the algorithm.
  • solve!(problem::Problem, state::AlgorithmState) to solve a problem with a given algorithm, which is identified by the AlgorithmState.
  • stop(problem::Problem, state::AlgorithmState) to check whether the algorithm should stop.

where the first is the main one to implement for a new algorithm.

Further ideas

  • 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 from Manopt.jl
  • by default stop() from above would check such a stopping criterion
  • generic debug and record functionality – together with hooks even

possible extensions

  • to LineSearches.jl

About

🧮 AlgorithmsInterface: WIP – collecting ideas for a common algorithm interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages