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
c9cf46c9
Commit
c9cf46c9
authored
Jul 03, 2018
by
Martin Reinecke
Browse files
PEP8
parent
64bec04e
Changes
1
Hide whitespace changes
Inline
Side-by-side
demos/bernoulli_demo.py
View file @
c9cf46c9
...
...
@@ -2,8 +2,6 @@ import nifty5 as ift
import
numpy
as
np
if
__name__
==
'__main__'
:
# ABOUT THIS CODE
np
.
random
.
seed
(
41
)
...
...
@@ -52,7 +50,7 @@ if __name__ == '__main__':
p
=
R
(
sky
)
mock_position
=
ift
.
from_random
(
'normal'
,
p
.
position
.
domain
)
pp
=
p
.
at
(
mock_position
).
value
data
=
np
.
random
.
binomial
(
1
,
pp
.
to_global_data
().
astype
(
np
.
float64
))
data
=
np
.
random
.
binomial
(
1
,
pp
.
to_global_data
().
astype
(
np
.
float64
))
data
=
ift
.
Field
.
from_global_data
(
d_space
,
data
)
# Compute likelihood and Hamiltonian
...
...
@@ -69,7 +67,6 @@ if __name__ == '__main__':
H
=
H
.
makeInvertible
(
ic_cg
)
# minimizer = ift.SteepestDescent(ic_newton)
H
,
convergence
=
minimizer
(
H
)
# result_sky = sky.at(H.position).value
# ift.plot(result_sky)
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