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
9ee541a0
Commit
9ee541a0
authored
Aug 23, 2017
by
Theo Steininger
Browse files
Fixed wiener_filter_via_hamiltonian.py
parent
e0f1f873
Changes
2
Hide whitespace changes
Inline
Side-by-side
demos/wiener_filter_via_hamiltonian.py
View file @
9ee541a0
...
...
@@ -117,13 +117,13 @@ if __name__ == "__main__":
# Solving the problem analytically
m0
=
D0
.
inverse_times
(
j
)
sample_variance
=
Field
(
sh
.
domain
,
val
=
0.
+
0j
)
sample_mean
=
Field
(
sh
.
domain
,
val
=
0.
+
0j
)
sample_variance
=
Field
(
sh
.
domain
,
val
=
0.
)
sample_mean
=
Field
(
sh
.
domain
,
val
=
0.
)
# sampling the uncertainty map
n_samples
=
1
n_samples
=
1
0
for
i
in
range
(
n_samples
):
sample
=
sugar
.
generate_posterior_sample
(
m
0
,
D0
)
sample
=
fft
(
sugar
.
generate_posterior_sample
(
0
.
,
D0
)
)
Martin Reinecke
@mtr
·
Aug 24, 2017
Owner
This causes the demo to crash because of non-matching fields ...
This causes the demo to crash because of non-matching fields ...
Please
register
or
sign in
to reply
sample_variance
+=
sample
**
2
sample_mean
+=
sample
variance
=
sample_variance
/
n_samples
-
(
sample_mean
/
n_samples
)
variance
=
(
sample_variance
-
sample_mean
**
2
)
/
n_samples
nifty/sugar.py
View file @
9ee541a0
...
...
@@ -108,7 +108,7 @@ def generate_posterior_sample(mean, covariance):
R
=
covariance
.
R
N
=
covariance
.
N
power
=
S
.
diagonal
().
power_analyze
()
**
.
5
power
=
sqrt
(
S
.
diagonal
().
power_analyze
()
)
mock_signal
=
power
.
power_synthesize
(
real_signal
=
True
)
noise
=
N
.
diagonal
(
bare
=
True
)
...
...
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