Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
2b33d347
Commit
2b33d347
authored
Jun 16, 2018
by
Martin Reinecke
Browse files
cosmetics
parent
bf72e471
Pipeline
#31115
passed with stages
in 1 minute and 26 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
demos/critical_filtering.py
View file @
2b33d347
...
...
@@ -14,8 +14,8 @@ def adjust_zero_mode(m0, t0):
return
(
ift
.
Field
.
from_global_data
(
m0
.
domain
,
mtmp
),
ift
.
Field
.
from_global_data
(
t0
.
domain
,
ttmp
))
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
noise_level
=
1.
p_spec
=
(
lambda
k
:
(.
5
/
(
k
+
1
)
**
3
))
...
...
demos/nonlinear_critical_filter.py
View file @
2b33d347
...
...
@@ -14,8 +14,8 @@ def adjust_zero_mode(m0, t0):
return
(
ift
.
Field
.
from_global_data
(
m0
.
domain
,
mtmp
),
ift
.
Field
.
from_global_data
(
t0
.
domain
,
ttmp
))
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
noise_level
=
1.
p_spec
=
(
lambda
k
:
(
1.
/
(
k
+
1
)
**
2
))
...
...
demos/poisson_demo.py
View file @
2b33d347
# Program to generate figures of article "Information theory for fields"
# by Torsten Ensslin, Annalen der Physik, submitted to special edition
# "Physics of Information" in April 2018, arXiv:1804.03350
# to get exact figure of paper comment out lines marked by "COMMENT OUT"
# to get exact figure of paper comment out lines marked by "COMMENT OUT"
import
numpy
as
np
import
nifty4
as
ift
...
...
@@ -28,7 +28,7 @@ if __name__ == "__main__":
L
=
1.
# Total length of interval or volume the field lives on
nprobes
=
1000
# Number of probes for uncertainty quantification used in paper
nprobes
=
10
# COMMENT OUT TO REPRODUCE PAPER FIGURE EXACTLY
# Define resolution (pixels per dimension)
N_pixels
=
1024
...
...
demos/wiener_filter_data_space_noiseless.py
View file @
2b33d347
...
...
@@ -43,6 +43,7 @@ class CustomResponse(ift.LinearOperator):
def
capability
(
self
):
return
self
.
TIMES
|
self
.
ADJOINT_TIMES
if
__name__
==
"__main__"
:
np
.
random
.
seed
(
43
)
# Set up physical constants
...
...
demos/wiener_filter_via_curvature.py
View file @
2b33d347
...
...
@@ -11,6 +11,7 @@ def init_nu():
data
=
comm
.
bcast
(
data
,
root
=
0
)
nu
.
reset_units
(
data
[
0
])
if
__name__
==
"__main__"
:
# In MPI mode, the random seed for numericalunits must be set by hand
init_nu
()
...
...
nifty4/operators/sandwich_operator.py
View file @
2b33d347
...
...
@@ -80,7 +80,7 @@ class SandwichOperator(EndomorphicOperator):
try
:
s
=
self
.
_cheese
.
draw_sample
(
from_inverse
,
dtype
)
return
self
.
_bun
.
inverse_times
(
s
)
except
:
except
NotImplementedError
:
pass
raise
NotImplementedError
(
"cannot draw from inverse of this operator"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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