Commit 2866d426 authored by Philipp Arras's avatar Philipp Arras
Browse files

Cosmetics

parent c8773202
......@@ -27,6 +27,7 @@ from ..utilities import NiftyMetaBase
class Domain(NiftyMetaBase()):
"""The abstract class repesenting a (structured or unstructured) domain.
"""
def __init__(self):
self._hash = None
......
......@@ -132,6 +132,7 @@ class LOSResponse(LinearOperator):
every calling MPI task (i.e. the full LOS information has to be provided on
every task).
"""
def __init__(self, domain, starts, ends, sigmas_low=None, sigmas_up=None):
super(LOSResponse, self).__init__()
......
......@@ -29,6 +29,7 @@ class RelaxedNewton(DescentMinimizer):
The descent direction is determined by weighting the gradient at the
current parameter position with the inverse local metric.
"""
def __init__(self, controller, line_searcher=None):
if line_searcher is None:
line_searcher = LineSearchStrongWolfe(
......
......@@ -28,5 +28,6 @@ class SteepestDescent(DescentMinimizer):
Also known as 'gradient descent'. This algorithm simply follows the
functional's gradient for minimization.
"""
def get_descent_direction(self, energy):
return -energy.gradient
......@@ -106,6 +106,7 @@ class _InformationStore(object):
yy : numpy.ndarray
2D circular buffer of scalar products between different elements of y.
"""
def __init__(self, max_history_length, x0, gradient):
self.max_history_length = max_history_length
self.s = [None]*max_history_length
......
......@@ -35,6 +35,7 @@ def _joint_position(model1, model2):
class ScalarMul(Model):
"""Class representing a model multiplied by a scalar factor."""
def __init__(self, factor, model):
super(ScalarMul, self).__init__(model.position)
# TODO -> floating
......@@ -53,6 +54,7 @@ class ScalarMul(Model):
class Add(Model):
"""Class representing the sum of two models."""
def __init__(self, position, model1, model2):
super(Add, self).__init__(position)
......@@ -83,6 +85,7 @@ class Add(Model):
class Mul(Model):
"""Class representing the pointwise product of two models."""
def __init__(self, position, model1, model2):
super(Mul, self).__init__(position)
......
......@@ -39,6 +39,7 @@ class Constant(Model):
- Position has no influence on value.
- The Jacobian is a null matrix.
"""
def __init__(self, position, constant):
super(Constant, self).__init__(position)
self._constant = constant
......
......@@ -47,6 +47,7 @@ class Model(NiftyMetaBase()):
one automatically gets the value and Jacobian of the model. The 'at' method
creates a new instance of the class.
"""
def __init__(self, position):
self._position = position
......
......@@ -27,6 +27,7 @@ from .model import Model
class MultiModel(Model):
""" """
def __init__(self, model, key):
# TODO Rewrite it such that it takes a dictionary as input.
# (just like MultiFields).
......
......@@ -31,6 +31,7 @@ class Variable(Model):
position : Field or MultiField
The current position in parameter space.
"""
def __init__(self, position):
super(Variable, self).__init__(position)
......
......@@ -34,6 +34,7 @@ class NullOperator(LinearOperator):
target : DomainTuple or MultiDomain
output domain
"""
def __init__(self, domain, target):
from ..sugar import makeDomain
self._domain = makeDomain(domain)
......
......@@ -42,6 +42,7 @@ class QHTOperator(LinearOperator):
The index of the domain on which the operator acts.
target[space] must be a nonharmonic LogRGSpace.
"""
def __init__(self, target, space=0):
self._target = DomainTuple.make(target)
self._space = infer_space(self._target, space)
......
......@@ -35,6 +35,7 @@ class SelectionOperator(LinearOperator):
key : :class:`str`
String identifier of the wanted subdomain
"""
def __init__(self, domain, key):
self._domain = MultiDomain.make(domain)
self._key = key
......
Markdown is supported
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