-
-
Notifications
You must be signed in to change notification settings - Fork 272
Modify compound steps notebook #141
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
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
finally fixed this git rebase thing oof, excuse the bad open/close history ;-; |
@OriolAbril I considered explaining the two variable part of compound sampling over here, and just mentioning it along with showing the outliers in the sample_stats notebook. Does that make sense? |
@@ -12,10 +12,24 @@ | |||
"# Compound Steps in Sampling\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the original code because it has 2 advantages. 1st is that it shows how one can sample the same model as many times as they want with different samplers, iterations or whatever. 2nd is that this is an actual model with observed variables, the mu1, mu2 example only samples from free variables, it doen't sample from a posterior. We can still use coords and dims by using idata_kwargs
(in which case we don't need to use coords when defining the model)
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried keeping the original code and for some reason that didn't give me two values for "accept", so I was somewhat confused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the original code was not sampling with the custom steps defined, only printing them to show which order they define, so trace probably referred to the trace from the other model, sampled combining nuts and metropolis instead of combining two metropolis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the latest commit, i sampled after defining steps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a look at the code, it's probably due to BinaryGibbsMetropolis not having accept unline BinaryMetropolis, so there is no repeated name on which to concatenate the accept stat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I should go for binarymetropolis and metropolis instead of binarygibbs and metropolis right? (because it feels like explaining this is an imp point(?))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use BinaryMetropolis
. I am not sure how used are compound methods, but all the order and other explanations done with BinaryGibbsMetropolis will still be relevant, we will only be adding the repreated stats component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it worked like a charm, I'll push the latest commit, I think it looks almost ready now
@OriolAbril I've made changes except the last two comments, it'd be great if you could have a look and tell me if i missed something, was idata_kwargs supposed to be given once, or during every consecutive event of sampling? (else I'll get back to it tomo and go over again) - check latest commit for context. |
@@ -12,10 +12,11 @@ | |||
"# Compound Steps in Sampling\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does printing one chain work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trace1.sample_stats["accept"].sel(chain=1).values
I'm going for this because it helps actually notice the two sampler step accept thing and this doesnt take up much space
@OriolAbril thanks for the suggestions! everything's done |
This PR addresses issue #113