-
-
Notifications
You must be signed in to change notification settings - Fork 986
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
Add a new intro tutorial #2991
Add a new intro tutorial #2991
Conversation
…gression tutorials
cool looks good! will take a closer look tomorrow but two comments from a quick perusal:
|
more detailed comments/questions/etc:
|
@martinjankowiak thanks, addressed most of your comments and added the rest to the PR todos. |
This is ready for more content review, the other tasks are mostly boilerplate. |
looks great!!! a bit long, but such is the price of thoroughness...
|
How about |
Ok, I think I've finished everything and this should be OK to merge pending final reviews. I'd prefer to merge an imperfect version and release to update the website and docs rather than iterate this PR too much more so that the old intro tutorials are moved out of sight of new users. |
This is the one thing that I don't have an obvious idea for improving, suggestions and/or direct edits are welcome. |
:name: deprecated | ||
|
||
intro_part_i | ||
intro_part_ii |
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 kept these and stuck them under a "Deprecated" header because there are links on the forum to the old intro tutorials that I don't want to break (yet).
@eb8680 looks great. i'd suggest this last change but we can merge as is if you prefer: "the meaning of every other sample statement in a model changes following Bayes' rule" bayes rule is good. how about "...the cumulative effect of all the sample statements in a model changes following Bayes' rule" |
Looks great, this is a big improvement!
Whoa, no need to recommend switching to JAX, we just need to tune the optimizer and use multiple particles. This is a tiny model and inference should easily run in 1000 steps and <30sec. nits:
|
Can I tune the optimizers and add |
@fritzo sure, although I think it's still going to be pretty slow. I had also turned down the learning rates at @martinjankowiak's suggestion but you could turn them up again. |
the issue is that users will copy paste code, change models, and then generate lots of forum questions that wonder why their elbos don't converge using a giant LR. i'd recommend not going above lr = 0.005 to discourage high LRs as a default choice |
@martinjankowiak could you |
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.
Looks great to me!! Some minor nits:
- Add
plt.show()
at the end of cell 17 to remove the text<matplotlib.legend.Legend at 0x7f93ab767090>
- The first formula in section "Example: revisiting Bayesian regression with a full-rank guide" is not split into two lines
- Probably add links to docs for each reference classes (rather than the first one that appears) just in case some users jump to a random section and still can click to go the the docs.
It's really important to give users a good first impression. Inference easily converges in 5 seconds with a fast learning rate. I see lower loss using |
@fritzo I am inclined to agree given how slow 20000 steps is, how about adding @martinjankowiak's caveat about lowering learning rates in other models or a link to SVI part 4? We can always change it to a safer value later if it becomes an issue. |
If you're worried about too-high learning rates, then the right solution is to add an example with a too-high learning rate and say "oops the learning rate was too high and loss didn't decrease, see this loss plot. let's try decreasing learning rate". |
Agreed this would be an improvement. I'll do this in a followup PR that doesn't block the release because there are quite a lot of references and I need to figure out how to get Sphinx to render links whose names are formatted as code. |
Can we please remove the "Use JAX instead" statement before merging though? This is a silly thing to say in a first tutorial with mis-used optimization. |
Sure, do you want to do this along with your fixes or should I? |
Sure, I can make some minor edits and push |
@eb8680 I added a comment about convergence, tuned the optimizers, and encouraged users to look at the loss curve over time. However I haven't been able to regenerate plots due to a missing |
Hmm this is concerning. FYI I have
Will do |
can address later but typo: espcially |
I'll address |
open in nbviewer
Derived from Bayesian regression tutorials
Tasks:
pyro.condition
in sample sectionAdd images separately if necessaryFix model renderingintro_long.ipynb
code
markdown