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
389c1190
Commit
389c1190
authored
Jul 10, 2018
by
Martin Reinecke
Browse files
make assumption explicit
parent
7426a730
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/sampling_enabler.py
View file @
389c1190
...
...
@@ -48,8 +48,8 @@ class SamplingEnabler(EndomorphicOperator):
def
__init__
(
self
,
likelihood
,
prior
,
iteration_controller
,
approximation
=
None
):
self
.
_op
=
likelihood
+
prior
super
(
SamplingEnabler
,
self
).
__init__
()
self
.
_op
=
likelihood
+
prior
self
.
_likelihood
=
likelihood
self
.
_prior
=
prior
self
.
_ic
=
iteration_controller
...
...
@@ -59,9 +59,8 @@ class SamplingEnabler(EndomorphicOperator):
try
:
return
self
.
_op
.
draw_sample
(
from_inverse
,
dtype
)
except
NotImplementedError
:
# MR FIXME: I think there is a silent assumption that
# from_inverse==True when we arrive here.
# Can we make this explicit?
if
not
from_inverse
:
raise
ValueError
(
"from_inverse must be True here"
)
s
=
self
.
_prior
.
draw_sample
(
from_inverse
=
True
)
sp
=
self
.
_prior
(
s
)
nj
=
self
.
_likelihood
.
draw_sample
()
...
...
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