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
9e615bf1
Commit
9e615bf1
authored
Jul 10, 2018
by
Philipp Arras
Browse files
Output pngs for demo
parent
9e7a367b
Changes
2
Hide whitespace changes
Inline
Side-by-side
demos/bernoulli_demo.py
View file @
9e615bf1
...
...
@@ -70,6 +70,6 @@ if __name__ == '__main__':
reconstruction
=
sky
.
at
(
H
.
position
).
value
ift
.
plot
(
reconstruction
,
title
=
'reconstruction'
,
name
=
'reconstruction.p
df
'
)
ift
.
plot
(
GR
.
adjoint_times
(
data
),
title
=
'data'
,
name
=
'data.p
df
'
)
ift
.
plot
(
sky
.
at
(
mock_position
).
value
,
title
=
'truth'
,
name
=
'truth.p
df
'
)
ift
.
plot
(
reconstruction
,
title
=
'reconstruction'
,
name
=
'reconstruction.p
ng
'
)
ift
.
plot
(
GR
.
adjoint_times
(
data
),
title
=
'data'
,
name
=
'data.p
ng
'
)
ift
.
plot
(
sky
.
at
(
mock_position
).
value
,
title
=
'truth'
,
name
=
'truth.p
ng
'
)
demos/getting_started_3.py
View file @
9e615bf1
...
...
@@ -65,9 +65,9 @@ if __name__ == '__main__':
INITIAL_POSITION
=
ift
.
from_random
(
'normal'
,
H
.
position
.
domain
)
position
=
INITIAL_POSITION
ift
.
plot
(
signal
.
at
(
MOCK_POSITION
).
value
,
name
=
'truth.p
df
'
)
ift
.
plot
(
R
.
adjoint_times
(
data
),
name
=
'data.p
df
'
)
ift
.
plot
([
A
.
at
(
MOCK_POSITION
).
value
],
name
=
'power.p
df
'
)
ift
.
plot
(
signal
.
at
(
MOCK_POSITION
).
value
,
name
=
'truth.p
ng
'
)
ift
.
plot
(
R
.
adjoint_times
(
data
),
name
=
'data.p
ng
'
)
ift
.
plot
([
A
.
at
(
MOCK_POSITION
).
value
],
name
=
'power.p
ng
'
)
# number of samples used to estimate the KL
N_samples
=
20
...
...
@@ -81,17 +81,17 @@ if __name__ == '__main__':
KL
,
convergence
=
minimizer
(
KL
)
position
=
KL
.
position
ift
.
plot
(
signal
.
at
(
position
).
value
,
name
=
'reconstruction.p
df
'
)
ift
.
plot
(
signal
.
at
(
position
).
value
,
name
=
'reconstruction.p
ng
'
)
ift
.
plot
([
A
.
at
(
position
).
value
,
A
.
at
(
MOCK_POSITION
).
value
],
name
=
'power.p
df
'
)
name
=
'power.p
ng
'
)
sc
=
ift
.
StatCalculator
()
for
sample
in
samples
:
sc
.
add
(
signal
.
at
(
sample
+
position
).
value
)
ift
.
plot
(
sc
.
mean
,
name
=
'avrg.p
df
'
)
ift
.
plot
(
ift
.
sqrt
(
sc
.
var
),
name
=
'std.p
df
'
)
ift
.
plot
(
sc
.
mean
,
name
=
'avrg.p
ng
'
)
ift
.
plot
(
ift
.
sqrt
(
sc
.
var
),
name
=
'std.p
ng
'
)
powers
=
[
A
.
at
(
s
+
position
).
value
for
s
in
samples
]
ift
.
plot
([
A
.
at
(
position
).
value
,
A
.
at
(
MOCK_POSITION
).
value
]
+
powers
,
name
=
'power.p
df
'
)
name
=
'power.p
ng
'
)
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