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
f30e88f9
Commit
f30e88f9
authored
Aug 20, 2018
by
Martin Reinecke
Browse files
fix
parent
a2916703
Changes
1
Hide whitespace changes
Inline
Side-by-side
demos/polynomial_fit.py
View file @
f30e88f9
...
...
@@ -86,15 +86,16 @@ N = ift.DiagonalOperator(ift.from_global_data(d_space, var))
IC
=
ift
.
GradientNormController
(
tol_abs_gradnorm
=
1e-8
)
likelihood
=
ift
.
GaussianEnergy
(
d
,
N
)(
R
)
H
=
ift
.
Hamiltonian
(
likelihood
,
IC
)
H
=
ift
.
EnergyAdapter
(
params
,
H
,
IC
)
H
am
=
ift
.
Hamiltonian
(
likelihood
,
IC
)
H
=
ift
.
EnergyAdapter
(
params
,
H
am
)
# Minimize
minimizer
=
ift
.
NewtonCG
(
IC
)
H
,
_
=
minimizer
(
H
)
# Draw posterior samples
samples
=
[
H
.
metric
.
draw_sample
(
from_inverse
=
True
)
+
H
.
position
metric
=
Ham
(
ift
.
Linearization
.
make_var
(
H
.
position
)).
metric
samples
=
[
metric
.
draw_sample
(
from_inverse
=
True
)
+
H
.
position
for
_
in
range
(
N_samples
)]
# Plotting
...
...
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