Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Boards
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
9dbf2577
Commit
9dbf2577
authored
Jul 25, 2017
by
Theo Steininger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding forward_x0 and backward_x0 to InvertibleOperatorMixin
parent
c034e8f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
13 deletions
+27
-13
nifty/library/critical_filter/critical_power_curvature.py
nifty/library/critical_filter/critical_power_curvature.py
+3
-2
nifty/library/wiener_filter/wiener_filter_curvature.py
nifty/library/wiener_filter/wiener_filter_curvature.py
+3
-2
nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py
...rs/invertible_operator_mixin/invertible_operator_mixin.py
+21
-9
No files found.
nifty/library/critical_filter/critical_power_curvature.py
View file @
9dbf2577
...
...
@@ -21,7 +21,7 @@ class CriticalPowerCurvature(InvertibleOperatorMixin, EndomorphicOperator):
# ---Overwritten properties and methods---
def
__init__
(
self
,
theta
,
T
,
inverter
=
None
,
preconditioner
=
None
):
def
__init__
(
self
,
theta
,
T
,
inverter
=
None
,
preconditioner
=
None
,
**
kwargs
):
self
.
theta
=
DiagonalOperator
(
theta
.
domain
,
diagonal
=
theta
)
self
.
T
=
T
...
...
@@ -30,7 +30,8 @@ class CriticalPowerCurvature(InvertibleOperatorMixin, EndomorphicOperator):
self
.
_domain
=
self
.
theta
.
domain
super
(
CriticalPowerCurvature
,
self
)
.
__init__
(
inverter
=
inverter
,
preconditioner
=
preconditioner
)
preconditioner
=
preconditioner
,
**
kwargs
)
def
_times
(
self
,
x
,
spaces
):
return
self
.
T
(
x
)
+
self
.
theta
(
x
)
...
...
nifty/library/wiener_filter/wiener_filter_curvature.py
View file @
9dbf2577
...
...
@@ -22,7 +22,7 @@ class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
"""
def
__init__
(
self
,
R
,
N
,
S
,
inverter
=
None
,
preconditioner
=
None
):
def
__init__
(
self
,
R
,
N
,
S
,
inverter
=
None
,
preconditioner
=
None
,
**
kwargs
):
self
.
R
=
R
self
.
N
=
N
...
...
@@ -32,7 +32,8 @@ class WienerFilterCurvature(InvertibleOperatorMixin, EndomorphicOperator):
self
.
_domain
=
self
.
S
.
domain
super
(
WienerFilterCurvature
,
self
)
.
__init__
(
inverter
=
inverter
,
preconditioner
=
preconditioner
)
preconditioner
=
preconditioner
,
**
kwargs
)
@
property
def
domain
(
self
):
...
...
nifty/operators/invertible_operator_mixin/invertible_operator_mixin.py
View file @
9dbf2577
...
...
@@ -60,17 +60,23 @@ class InvertibleOperatorMixin(object):
"""
def
__init__
(
self
,
inverter
=
None
,
preconditioner
=
None
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
inverter
=
None
,
preconditioner
=
None
,
forward_x0
=
None
,
backward_x0
=
None
,
*
args
,
**
kwargs
):
self
.
__preconditioner
=
preconditioner
if
inverter
is
not
None
:
self
.
__inverter
=
inverter
else
:
self
.
__inverter
=
ConjugateGradient
(
preconditioner
=
self
.
__preconditioner
)
self
.
__forward_x0
=
forward_x0
self
.
__backward_x0
=
backward_x0
super
(
InvertibleOperatorMixin
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
def
_times
(
self
,
x
,
spaces
,
x0
=
None
):
if
x0
is
None
:
def
_times
(
self
,
x
,
spaces
):
if
self
.
__forward_x0
is
not
None
:
x0
=
self
.
__forward_x0
else
:
x0
=
Field
(
self
.
target
,
val
=
0.
,
dtype
=
x
.
dtype
,
distribution_strategy
=
x
.
distribution_strategy
)
...
...
@@ -79,8 +85,10 @@ class InvertibleOperatorMixin(object):
x0
=
x0
)
return
result
def
_adjoint_times
(
self
,
x
,
spaces
,
x0
=
None
):
if
x0
is
None
:
def
_adjoint_times
(
self
,
x
,
spaces
):
if
self
.
__backward_x0
is
not
None
:
x0
=
self
.
__backward_x0
else
:
x0
=
Field
(
self
.
domain
,
val
=
0.
,
dtype
=
x
.
dtype
,
distribution_strategy
=
x
.
distribution_strategy
)
...
...
@@ -89,8 +97,10 @@ class InvertibleOperatorMixin(object):
x0
=
x0
)
return
result
def
_inverse_times
(
self
,
x
,
spaces
,
x0
=
None
):
if
x0
is
None
:
def
_inverse_times
(
self
,
x
,
spaces
):
if
self
.
__backward_x0
is
not
None
:
x0
=
self
.
__backward_x0
else
:
x0
=
Field
(
self
.
domain
,
val
=
0.
,
dtype
=
x
.
dtype
,
distribution_strategy
=
x
.
distribution_strategy
)
...
...
@@ -99,8 +109,10 @@ class InvertibleOperatorMixin(object):
x0
=
x0
)
return
result
def
_adjoint_inverse_times
(
self
,
x
,
spaces
,
x0
=
None
):
if
x0
is
None
:
def
_adjoint_inverse_times
(
self
,
x
,
spaces
):
if
self
.
__forward_x0
is
not
None
:
x0
=
self
.
__forward_x0
else
:
x0
=
Field
(
self
.
target
,
val
=
0.
,
dtype
=
x
.
dtype
,
distribution_strategy
=
x
.
distribution_strategy
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment