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
0ee3afdc
Commit
0ee3afdc
authored
Aug 24, 2018
by
Philipp Arras
Browse files
Nicer plots for demo 3
parent
63789fe6
Changes
1
Hide whitespace changes
Inline
Side-by-side
demos/getting_started_3.py
View file @
0ee3afdc
...
...
@@ -83,10 +83,10 @@ if __name__ == '__main__':
INITIAL_POSITION
=
ift
.
from_random
(
'normal'
,
domain
)
position
=
INITIAL_POSITION
ift
.
plot
(
signal
(
MOCK_POSITION
),
title
=
'
g
round
t
ruth'
)
ift
.
plot
(
R
.
adjoint_times
(
data
),
title
=
'
d
ata'
)
ift
.
plot
([
A
(
MOCK_POSITION
)],
title
=
'
p
ower'
)
ift
.
plot_finish
(
nx
=
3
,
xsize
=
16
,
ysize
=
5
,
title
=
"setup"
,
name
=
"setup.png"
)
ift
.
plot
(
signal
(
MOCK_POSITION
),
title
=
'
G
round
T
ruth'
)
ift
.
plot
(
R
.
adjoint_times
(
data
),
title
=
'
D
ata'
)
ift
.
plot
([
A
(
MOCK_POSITION
)],
title
=
'
P
ower
Spectrum
'
)
ift
.
plot_finish
(
ny
=
1
,
nx
=
3
,
xsize
=
24
,
ysize
=
6
,
name
=
"setup.png"
)
# number of samples used to estimate the KL
N_samples
=
20
...
...
@@ -102,15 +102,14 @@ if __name__ == '__main__':
ift
.
plot
(
signal
(
position
),
title
=
"reconstruction"
)
ift
.
plot
([
A
(
position
),
A
(
MOCK_POSITION
)],
title
=
"power"
)
ift
.
plot_finish
(
n
x
=
2
,
xsize
=
1
2
,
ysize
=
6
,
title
=
"loop"
,
name
=
"loop.png"
)
ift
.
plot_finish
(
n
y
=
1
,
ysize
=
6
,
xsize
=
16
,
name
=
"loop.png"
)
sc
=
ift
.
StatCalculator
()
for
sample
in
samples
:
sc
.
add
(
signal
(
sample
+
position
))
ift
.
plot
(
sc
.
mean
,
title
=
"
m
ean"
)
ift
.
plot
(
ift
.
sqrt
(
sc
.
var
),
title
=
"
std d
eviation"
)
ift
.
plot
(
sc
.
mean
,
title
=
"
Posterior M
ean"
)
ift
.
plot
(
ift
.
sqrt
(
sc
.
var
),
title
=
"
Posterior Standard D
eviation"
)
powers
=
[
A
(
s
+
position
)
for
s
in
samples
]
ift
.
plot
([
A
(
position
),
A
(
MOCK_POSITION
)]
+
powers
,
title
=
"power"
)
ift
.
plot_finish
(
nx
=
3
,
xsize
=
16
,
ysize
=
5
,
title
=
"results"
,
name
=
"results.png"
)
ift
.
plot
([
A
(
position
),
A
(
MOCK_POSITION
)]
+
powers
,
title
=
"Sampled Posterior Power Spectrum"
)
ift
.
plot_finish
(
ny
=
1
,
nx
=
3
,
xsize
=
24
,
ysize
=
6
,
name
=
"results.png"
)
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