Commit ad3a7d38 authored by Jakob Knollmueller's avatar Jakob Knollmueller
Browse files

documentation Energy added

parent e5f51246
Pipeline #12133 passed with stage
in 4 minutes and 58 seconds
...@@ -20,6 +20,46 @@ from keepers import Loggable ...@@ -20,6 +20,46 @@ from keepers import Loggable
class Energy(Loggable, object): class Energy(Loggable, object):
""" The Energy object provides the structure required for minimization schemes.
It is the abstract implementation of a scalar function with its gradient and curvature at some position.
position : Field
The parameter of the scalar function and its first and second derivative.
position : Field
The Field location in parameter space where value, gradient and curvature is evaluated.
value : float
The evaluation of the energy functional at given position.
gradient : Field
The gradient at given position in parameter direction.
curvature : InvertibleOperator
An implicit operator encoding the curvature at given position.
Raised if
* value, gradient or curvature is called
Raised if
* copying of the position fails
The Energy object gives the blueprint how to formulate the model in order to apply
various inference schemes. The functions value, gradient and curvature have to be
implemented according to the concrete inference problem.
Memorizing the evaluations of some quantities minimizes the computational effort
for multiple calls.
def __init__(self, position): def __init__(self, position):
self._cache = {} self._cache = {}
try: try:
...@@ -29,6 +69,19 @@ class Energy(Loggable, object): ...@@ -29,6 +69,19 @@ class Energy(Loggable, object):
self.position = position self.position = position
def at(self, position): def at(self, position):
""" Initializes and returns new Energy object at new position.
position : Field
Parameter for the new Energy object.
out : Energy
Energy object at new position.
return self.__class__(position) return self.__class__(position)
@property @property
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