-
Notifications
You must be signed in to change notification settings - Fork 35
Make Sampler a field of DefaultContext (renamed to SamplingContext) #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This was referenced Apr 13, 2021
bors bot
pushed a commit
that referenced
this issue
Apr 18, 2021
…niform` (#232) This PR is a quick fix for TuringLang/Turing.jl#1563 and TuringLang/Turing.jl#1588. As explained in TuringLang/Turing.jl#1588 (comment), the problem is that currently `SampleFromUniform` always resamples variables in every run, and hence also initial parameters provided by users are resampled in https://github.com/TuringLang/DynamicPPL.jl/blob/9d4137eb33e83f34c484bf78f9a57f828b3c92a0/src/sampler.jl#L80. As mentioned in TuringLang/Turing.jl#1588 (comment), a better long term solution would be to fix this inconsistency and use dedicated evaluation and sampling contexts, as suggested in #80.
5 tasks
@penelopeysm is this now fixed? |
Totally missed this! But yes, (1) and (3) are fixed.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Currently we have 2 arguments for changing the behavior of
assume
andobserve
,context
andsampler
. I think:Sampler
belongs in a field inDefaultContext
, perhaps renaming it toSamplingContext
,SampleFromPrior
should always overwrite the values inVarInfo
much likeSampleFromUniform
in Fix SampleFromUniform #78, andComputeLogpContext
can be another context which encompassesLikelihoodContext
,PriorContext
and the current behavior ofDefaultContext
withSampleFromPrior
.I always found it confusing the
SampleFromPrior
doesn't actually sample anything ifVarInfo
already has values.The text was updated successfully, but these errors were encountered: