Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
ift
NIFTy
Commits
932b59d3
Commit
932b59d3
authored
May 15, 2017
by
Jakob Knollmueller
Browse files
test
parent
b35351ab
Pipeline
#12453
failed with stage
in 4 minutes and 32 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
demos/wiener_filter_hamiltonian.py
View file @
932b59d3
...
...
@@ -12,17 +12,28 @@ np.random.seed(42)
class
AdjointFFTResponse
(
LinearOperator
):
def
__init__
(
self
,
FFT
,
R
,
default_spaces
=
None
):
super
(
Response
Operator
,
self
).
__init__
(
default_spaces
)
super
(
AdjointFFT
Response
,
self
).
__init__
(
default_spaces
)
self
.
_domain
=
FFT
.
target
self
.
target
=
R
.
target
self
.
_
target
=
R
.
target
self
.
R
=
R
self
.
FFT
=
FFT
def
_times
(
self
,
x
):
def
_times
(
self
,
x
,
spaces
=
None
):
return
self
.
R
(
self
.
FFT
.
adjoint_times
(
x
))
def
_adjoint_times
(
self
,
x
):
def
_adjoint_times
(
self
,
x
,
spaces
=
None
):
return
self
.
FFT
(
self
.
R
.
adjoint_times
(
x
))
@
property
def
domain
(
self
):
return
self
.
_domain
@
property
def
target
(
self
):
return
self
.
_target
@
property
def
unitary
(
self
):
return
False
...
...
@@ -79,11 +90,11 @@ if __name__ == "__main__":
# callback=distance_measure,
# max_history_length=3)
solution
=
energy
.
analytic_solution
()
m0
=
Field
(
s_space
,
val
=
1.
)
energy
=
W
ie
nerFilterEnergy
(
position
=
m0
,
D
=
D
,
j
=
j
)
m0
=
F
ie
ld
(
s_space
,
val
=
1.
)
energy
=
WienerFilterEnergy
(
position
=
m0
,
R
=
R
,
N
=
N
,
S
=
S
)
solution
=
energy
.
analytic_solution
()
(
energy
,
convergence
)
=
minimizer
(
energy
)
m
=
fft
.
adjoint_times
(
energy
.
position
)
...
...
nifty/__init__.py
View file @
932b59d3
...
...
@@ -32,7 +32,7 @@ from config import dependency_injector,\
from
d2o
import
distributed_data_object
,
d2o_librarian
from
energies
import
*
from
field
import
Field
...
...
@@ -44,6 +44,8 @@ from nifty_utilities import *
from
field_types
import
*
from
energies
import
*
from
minimization
import
*
from
spaces
import
*
...
...
nifty/energies/__init__.py
View file @
932b59d3
...
...
@@ -19,4 +19,4 @@
from
energy
import
Energy
from
line_energy
import
LineEnergy
from
memoization
import
memo
from
wiener_filter_energy
import
WienerFilterEnergy
\ No newline at end of file
from
wiener_filter_energy
import
WienerFilterEnergy
nifty/energies/wiener_filter_energy.py
View file @
932b59d3
from
.energy
import
Energy
from
nifty.operators
import
WienerFilterCurvature
from
nifty.operators
.curvature_operators
import
WienerFilterCurvature
class
WienerFilterEnergy
(
Energy
):
"""The Energy for the Wiener filter.
...
...
nifty/operators/__init__.py
View file @
932b59d3
...
...
@@ -40,4 +40,4 @@ from composed_operator import ComposedOperator
from
response_operator
import
ResponseOperator
from
curvature_operators
import
WienerFilterCurvature
from
curvature_operators
import
*
nifty/operators/curvature_operators/__init__.py
View file @
932b59d3
from
wiener_filter_curvature
import
WienerFilterCurvature
\ No newline at end of file
from
wiener_filter_curvature
import
WienerFilterCurvature
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