-
Notifications
You must be signed in to change notification settings - Fork 17
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
Added dynamic rhat #77
Conversation
The code looks great and I really like the result!
Since this is a rough indicator, I thought we could only display the "worst" value of Rhat among all variables (in terms of distance to 1). Other values can be shown in the inference summary. The ideal would be to update a graph with all the values of Rhat over time, but that's a project in itself.
As discussed, implementing the rank-normalized Rhat for the inference summary would be best. Adding a warning if a value is too high is a good idea, and it is even better if that warning is actionable: what can I do as a modeler with this information? Where should it be displayed? After the progress bar or do we print (at least part of) the inference summary first?
Indeed, multivariate random variables are more error-prone :) The best is probably to take examples from the paper and check that computing Rhat on these chains gives the expected result. |
Btw for the sake of making incremental changes it would be better to address (3) in a separate PR. |
f8f3e6b
to
965f6dd
Compare
Hey @sidravi1 what's the status on this PR? |
Hey Rémi - thanks for the push. Been too occupied by work and kids these
last few weeks (months?). I haven’t worked on this since the refactor. I’ll
work on it on Thursday.
…On Mon, Apr 12, 2021 at 2:18 AM Rémi Louf ***@***.***> wrote:
Hey @sidravi1 <https://github.com/sidravi1> what's the status on this PR?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#77 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADLYXBNVDANACHUHK3TATJ3TIKGD7ANCNFSM4XHD6WVA>
.
|
No problem, this is open source, not paid work 🙂 |
Hi @rlouf - Got dynamic rhat working though using Tested it with this mvnormal model as well.
If all good, i'll clean up the commit history before the merge. |
Great! Could you try using the |
Should also point out that the bottleneck is most noticeable when the model is simple (the linear example), when it's more complex (multivariate example) then it doesn't really reduce it that much. |
It's all a question of user interface. The original idea was that, since we spend 99% of our time debugging models, the Now, if you have to wait an extra few seconds for simple models but it does not affect large models, it is not really a problem. Nevertheless, I like your idea of designing these online metrics as callbacks. This would allow users to customize the metrics being displayed and/or follow their own metrics. It is also cleaner from a code perspective. This way PS: is the multiple progress bar a bug? |
Ok. Make sense. Should we merge this in and switch to callback design pattern in another PR (when we implement ESS or divergences) or do you want me to update this one? The multiple progress bars are because of the |
Would you mind updating this one? |
Yep! Can do :) |
Thanks for your patience @rlouf - I've made those changes. Let me know what you think. |
mcx/sample.py
Outdated
call_backs: | ||
The functions to run after each state update |
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 does not appear in the function's signature
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.
Oops. Fixed! I'll also squash all the commits so it's ready to merge in
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.
Apart from my small comment on a docstring, everything is perfect. Ready to merge once that's fixed.
allows online metrics to be passed to sample_loop
@rlouf - Thanks for reviewing. I've made that one docstring fix and squashed all the commits. |
Great work, the code was really clean and self-explanatory! |
Overview
Displays Rhat values in the progress bar. Partially addresses #8.
Details
Here it is in action:
rhat_dynamic.mov
To do