-
Notifications
You must be signed in to change notification settings - Fork 0
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
Boosting BBVI Tutorial #13
base: master
Are you sure you want to change the base?
Conversation
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 made some changes mostly to the text and committed them to a new branch (see #14). Below are two additional comments:
-
you are using 3 different naming conventions for the latent and observed variables: z and x (intro), mu and y (model description), loc and obs (code). It might make sense to unify this if it is not too much work.
-
can we get away with not replicating the observations 10 times?
suggested changes to bbbvi tutorial
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.
Sorry for taking so long to get to this.
There are some code things to be cleaned up: mainly removing commented out code and refactoring plotting code.
More importantly, have we been able to factor out the relbo in a modular fashion?
# pyplot.title('-ELBO against time for component {}'.format(t)); | ||
# pyplot.show() | ||
|
||
pyplot.plot(range(len(guide_log_prob)), -1 * np.array(guide_log_prob), 'b-', label='- Guide log prob') |
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.
Generally want to separate plotting code from the algorithm itself.
…ts2019-boosting-bbvi-pyro into wip/bimodal_experiments
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.
This is great, thanks!
A collection of fairly random comments on the notebook primarily:
- Do we need to set
max_plate_nesting
? - Maybe stick with the
p
,q
notation in the Variational Inference section, and stick withs
for the boosting component? - Any mechanism for attribution etc - not clear at first glance if all the examples are contributed by the Pyro team?
- Agree with Yu re the
data*10
statement - if we do need to keep it, perhaps just mention it as an aside?
Again, looks really good to me. Will let you know if I come across anything else, but this seems basically ready to try and submit AFAIC.
Thanks for the review, @TNU-yaoy. Your changes to the notebook look good to me; I've merged them into this branch.
Good point, I've changed it to be z and x everywhere.
The approximation we get is quite a bit better if we use more data. Instead of replicating the list ten times, a cleaner way would be to draw some samples from N(4, 0.1) to get the observations. I've updated the notebook in this way, what do you think about that? |
looks good to me |
Hey @sharrison5, thanks a lot for having a look at the tutorial!
I think we don't strictly need to, i.e. Pyro will try to infer it if it's not explicitly given.
Makes sense, I've changed this.
Hmm, I didn't find any information on this on the Pyro repo or in the documentation. Maybe there's no such mechanism but that might be negotiable.
Fixed this by creating observations by sampling from N(4, 0.1).
|
boosting_bbvi_tutorial.ipynb
contains my draft of the boosting BBVI tutorial for the Pyro documentation. Please review it - I'd be happy about any kind of feedback and suggestions.I used
pylint
to check for PEP8 compliance. I've prioritised consistency with existing tutorials over being compliant with PEP8 in cases where there were conflict between these two.I've fixed the import order with
isort
as recommended in the Pyro contribution guidelines .I don' think there's a need to review the other files in this PR at this point.