Commit db5502f3 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

more documentation

parent c61a1a40
Pipeline #16899 passed with stage
in 10 minutes and 13 seconds
......@@ -4,6 +4,8 @@ from nifty.energies.memoization import memo
class QuadraticEnergy(Energy):
"""The Energy for a quadratic form.
The most important aspect of this energy is that its curvature must be
def __init__(self, position, A, b):
......@@ -24,6 +24,22 @@ import numpy as np
from keepers import Loggable
class IterationController(Loggable, object):
"""The abstract base class for all iteration controllers.
An iteration controller is an object that monitors the progress of a
minimization iteration. At the begin of the minimization, its start()
method is called with the energy object at the initial position.
Afterwards, its check() method is called during every iteration step with
the energy object describing the current position.
Based on that information, the iteration controller has to decide whether
iteration needs to progress further (in this case it returns CONTINUE), or
if sufficient convergence has been reached (in this case it returns
CONVERGED), or if some error has been detected (then it returns ERROR).
The concrete convergence criteria can be chosen by inheriting from this
class; the implementer has full flexibility to use whichever criteria are
appropriate for a particular problem - as ong as they can be computed from
the information passed to the controller during the iteration process.
__metaclass__ = NiftyMeta
......@@ -21,7 +21,6 @@ from .line_searching import LineSearchStrongWolfe
class RelaxedNewton(DescentMinimizer):
def __init__(self, controller, line_searcher=LineSearchStrongWolfe()):
super(RelaxedNewton, self).__init__(
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment