Commit a890fda5 authored by Martin Reinecke's avatar Martin Reinecke

Merge branch 'NIFTy_5' into renamings

parents bbf22449 d05da638
NIFTy - Numerical Information Field Theory
==========================================
[![build status](https://gitlab.mpcdf.mpg.de/ift/NIFTy/badges/NIFTy_5/build.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/NIFTy_5)
[![coverage report](https://gitlab.mpcdf.mpg.de/ift/NIFTy/badges/NIFTy_5/coverage.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/NIFTy_5)
[![build status](https://gitlab.mpcdf.mpg.de/ift/nifty-dev/badges/NIFTy_5/build.svg)](https://gitlab.mpcdf.mpg.de/ift/nifty-dev/commits/NIFTy_5)
[![coverage report](https://gitlab.mpcdf.mpg.de/ift/nifty-dev/badges/NIFTy_5/coverage.svg)](https://gitlab.mpcdf.mpg.de/ift/nifty-dev/commits/NIFTy_5)
**NIFTy** project homepage:
[http://ift.pages.mpcdf.de/NIFTy](http://ift.pages.mpcdf.de/NIFTy)
......
......@@ -21,7 +21,7 @@ from .nonlinearities import Exponential, Linear, PositiveTanh, Tanh
from .models.constant import Constant
from .models.linear_model import LinearModel
from .models.local_nonlinearity import (LocalModel, PointwiseExponential,
PointwisePositiveTanh, PointwiseTanh)
PointwisePositiveTanh, PointwiseTanh)
from .models.model import Model
from .models.multi_model import MultiModel
from .models.variable import Variable
......@@ -65,7 +65,8 @@ from .minimization.steepest_descent import SteepestDescent
from .minimization.vl_bfgs import VL_BFGS
from .minimization.l_bfgs import L_BFGS
from .minimization.relaxed_newton import RelaxedNewton
from .minimization.scipy_minimizer import ScipyMinimizer, NewtonCG, L_BFGS_B, ScipyCG
from .minimization.scipy_minimizer import (ScipyMinimizer, NewtonCG, L_BFGS_B,
ScipyCG)
from .minimization.energy import Energy
from .minimization.quadratic_energy import QuadraticEnergy
from .minimization.line_energy import LineEnergy
......@@ -82,7 +83,8 @@ from .library.point_sources import PointSources
from .library.poissonian_energy import PoissonianEnergy
from .library.wiener_filter_curvature import WienerFilterCurvature
from .library.wiener_filter_energy import WienerFilterEnergy
from .library.correlated_fields import make_correlated_field, make_mf_correlated_field
from .library.correlated_fields import (make_correlated_field,
make_mf_correlated_field)
from . import extra
......
......@@ -34,5 +34,5 @@ class SampledKullbachLeiblerDivergence(Energy):
@property
@memo
def curvature(self):
return (my_sum(map(lambda v: v.curvature, self._energy_list)) *
(1./len(self._energy_list)))
return (my_sum(map(lambda v: v.curvature, self._energy_list)) *
(1./len(self._energy_list)))
......@@ -47,7 +47,8 @@ def make_mf_correlated_field(s_space_spatial, s_space_energy,
from ..models.variable import Variable
from ..domain_tuple import DomainTuple
from ..operators.domain_distributor import DomainDistributor
from ..operators.harmonic_transform_operator import HarmonicTransformOperator
from ..operators.harmonic_transform_operator \
import HarmonicTransformOperator
h_space_spatial = s_space_spatial.get_default_codomain()
h_space_energy = s_space_energy.get_default_codomain()
h_space = DomainTuple.make((h_space_spatial, h_space_energy))
......
......@@ -51,7 +51,8 @@ class PointSources(Model):
@staticmethod
def IG_prime(field, alpha, q):
inner = norm.pdf(field.local_data)
outer = invgamma.pdf(invgamma.ppf(norm.cdf(field.local_data), alpha, scale=q), alpha, scale=q)
outer = invgamma.pdf(invgamma.ppf(norm.cdf(field.local_data), alpha,
scale=q), alpha, scale=q)
# # FIXME
# outer = np.clip(outer, 1e-20, None)
outer = 1/outer
......
......@@ -94,9 +94,8 @@ class ChainOperator(LinearOperator):
@staticmethod
def make(ops):
"""Build a ChainOperator (or something simpler if possible),
"""Build a ChainOperator (or something simpler if possible),
a sequence of concatenated LinearOperators.
Parameters
----------
......
......@@ -277,7 +277,8 @@ class LinearOperator(NiftyMetaBase()):
if not self._validMode[mode]:
raise NotImplementedError("invalid operator mode specified")
if mode & self.capability == 0:
raise NotImplementedError("requested operator mode is not supported")
raise NotImplementedError(
"requested operator mode is not supported")
def _check_input(self, x, mode):
self._check_mode(mode)
......
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