Commit d6341dcb authored by Theo Steininger's avatar Theo Steininger
Browse files

Fixes in the import structure.

parent d3fe4057
Pipeline #14551 passed with stage
in 6 minutes and 44 seconds
from nifty.operators import EndomorphicOperator,\
from nifty.operators.endomorphic_operator import EndomorphicOperator
from nifty.operators.invertible_operator_mixin import InvertibleOperatorMixin
from nifty.operators.diagonal_operator import DiagonalOperator
class CriticalPowerCurvature(InvertibleOperatorMixin, EndomorphicOperator):
......@@ -18,6 +18,9 @@ class CriticalPowerCurvature(InvertibleOperatorMixin, EndomorphicOperator):
T : SmoothnessOperator,
The smoothness prior contribution to the curvature.
# ---Overwritten properties and methods---
def __init__(self, theta, T, inverter=None, preconditioner=None):
self.theta = DiagonalOperator(theta.domain, diagonal=theta)
......@@ -25,8 +28,15 @@ class CriticalPowerCurvature(InvertibleOperatorMixin, EndomorphicOperator):
if preconditioner is None:
preconditioner = self.theta.inverse_times
self._domain = self.theta.domain
super(CriticalPowerCurvature, self).__init__(inverter=inverter,
super(CriticalPowerCurvature, self).__init__(
def _times(self, x, spaces):
return self.T(x) + self.theta(x)
# ---Mandatory properties and methods---
def domain(self):
return self._domain
......@@ -38,8 +48,3 @@ class CriticalPowerCurvature(InvertibleOperatorMixin, EndomorphicOperator):
def unitary(self):
return False
# ---Added properties and methods---
def _times(self, x, spaces):
return self.T(x) + self.theta(x)
from import Energy
from nifty.library.operator_library import CriticalPowerCurvature,\
from nifty.operators.smoothness_operator import SmoothnessOperator
from nifty.library.critical_filter import CriticalPowerCurvature
from nifty.sugar import generate_posterior_sample
from nifty import Field, exp
from import Energy
from nifty.energies.memoization import memo
from nifty.library.operator_library import WienerFilterCurvature
from nifty.library.wiener_filter import WienerFilterCurvature
class WienerFilterEnergy(Energy):
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