Skip to content
GitLab
Menu
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
3bdf5f8a
Commit
3bdf5f8a
authored
Jul 22, 2019
by
Philipp Arras
Browse files
Revert changes not to be merged
parent
354f8482
Pipeline
#52264
passed with stages
in 8 minutes and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/sampling_enabler.py
View file @
3bdf5f8a
...
...
@@ -63,20 +63,16 @@ class SamplingEnabler(EndomorphicOperator):
s
=
self
.
_prior
.
draw_sample
(
from_inverse
=
True
)
sp
=
self
.
_prior
(
s
)
nj
=
self
.
_likelihood
.
draw_sample
()
energy
=
QuadraticEnergy
(
s
,
self
.
_op
,
sp
+
nj
,
_grad
=
self
.
_likelihood
(
s
)
-
nj
)
inverter
=
ConjugateGradient
(
self
.
_ic
)
if
self
.
_approximation
is
not
None
:
energy
=
QuadraticEnergy
(
s
,
self
.
_op
,
sp
+
nj
)
energy
,
convergence
=
inverter
(
energy
,
preconditioner
=
self
.
_approximation
.
inverse
)
else
:
energy
=
QuadraticEnergy
(
s
,
self
.
_op
,
sp
+
nj
,
_grad
=
self
.
_likelihood
(
s
)
-
nj
)
energy
,
convergence
=
inverter
(
energy
)
return
energy
.
position
def
add_approximation
(
self
,
approx
):
self
.
_approximation
=
approx
def
apply
(
self
,
x
,
mode
):
return
self
.
_op
.
apply
(
x
,
mode
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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