-
-
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
Improvements to GP documentation #3027
Conversation
nipunbatra
commented
Feb 28, 2022
- Added xlabel and ylabel to loss v/s iterations plots
- Added animation for fitting GP
- Added plot of inducing points
- Added animation for fitting inducing point GP
- Added example showing impact of lengthscale#
2. Added animation for fitting GP 3. Added plot of inducing points 4. Added animation for fitting inducing point GP 5. Added example showing impact of lengthscale#
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This PR partially addresses: #3025 (the GP classification part in 3025 will be handled in a separate PR) |
View / edit / reply to this conversation on ReviewNB fehiepsi commented on 2022-02-28T16:11:32Z Line #19. locations.append(deepcopy(sgpr.Xu.data.numpy())) Any reason for using deepcopy? nipunbatra commented on 2022-02-28T23:09:43Z I can try once again without deep copy. I remember my locations array without deep copy was having #iterations X
nipunbatra commented on 2022-03-01T05:22:33Z I tried again without fehiepsi commented on 2022-03-01T23:59:37Z I think other variables are scalars after |
Great improvements, thanks @nipunbatra! I just concern a bit about the large diff caused by the animations. Is there a way to simplify it? |
I can try once again without deep copy. I remember my locations array without deep copy was having #iterations X
View entire conversation on ReviewNB |
Thanks, I'm not fully sure if I understand the question.
Is it:
Can we reduce the code for animation?
Or, Can we reduce the file size for animations?
Please let me know what you think and any other suggestions as well! |
I tried again without View entire conversation on ReviewNB |
I think other variables are scalars after View entire conversation on ReviewNB |
I meant that with animation, you are adding more than 200,000 lines to the notebook, which makes it heavy to load and render (took me a while to open ReviewNB for this notebook). With your suggestions, I think we can save the animation (using animation I guess) to some format like |
Thanks @fehiepsi can you please mention the folder again? The link to the previous folder you have mentioned (https://github.com/pyro-ppl/pyro/pull/using%20animation%20I%20guess) seems broken to me. I'll make these changes and revise the PR. |
Oops, here is the folder that I mentioned: https://github.com/pyro-ppl/pyro/tree/dev/tutorial/source/_static/img |
1. Adds a simple example for binary GP classification 2. Adds a simple example for multi-class GP classification using the Iris dataset 3. Removes deepcopy for inducing points location, instead use np.array.copy() 4. Changes the animations from HTML to GIFs (each GIF is 1-2 MBs) 5. Miscelleaneous trivial cleanup and Black formatting
Hi @fehiepsi
|
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.
Hi @nipunbatra, the new content looks great to me! Could you execute the output of the later cells?
Thanks, @fehiepsi I'll rerun the entire notebook and make a commit. I also wanted to propose a couple of other additions. Please let me know if they look fine to be included. If yes, should I append them in this PR itself or create a new PR.
|
Hi @nipunbatra, I think it is great to show applications of Pyro GPs those many examples, but I hope we can make the tutorial a bit concise. Illustrating deep kernel and Poisson likelihood seems unnecessary to me. For ARD, it would be nice to modify the example to illustrate it, rather than adding an additional one. Maybe for the current Binary classification, you can add RBF with an additional Martern kernel to illustrate that kernels can be combined. What do you think? |
1. trivial example for deep kernel learning 2. combination of kernels 3. using ARD in DKL example 4. miscelleanous cleanup
@fehiepsi I'd already made the Deep kernel learning minimal example and the kernel combinations minimal example, so I let them be for this commit. I thought it may be good if you can quickly skim the new changes. If they seem to make the tutorial heavy, I think there could be two options
I'd vote for 1 (to break down the tutorial into several small pages), but am happy either way. |
How about either +making blog posts for Pyro GP and adding links to them or +adding those examples to doc strings of the GP modules (e.g. docstring to Binary likelihood, Poisson likelihood, Warping kernel)? For the current content, it seems to me that:
I think we wanted to limit the number of tutorials for the GP module, to be in par with other Pyro modules. At some point in the past, we discussed on splitting the GP module into a separate PyroGP package but didn't have much bandwidth for that (we are a small team so it is necessary to limit our scope). Personally, I was interested in having a Pyro GP framework that uses Pyro primitives and is agnostic to the backend (PyTorch or JAX) but didn't find enough motivation to pursue that. Maybe it is a good item to invest on for the Pyro ecosystem. |
Hi @fehiepsi Thanks, I have now cleaned up the tutorial, and moved the suggested examples to a separate blog/Jupyter book. Let me know if this looks good to you and is mergeable. |
View / edit / reply to this conversation on ReviewNB fehiepsi commented on 2022-03-09T02:52:54Z Line #6. xx, yy = torch.meshgrid(xs, ys) I think we need to move this into try: or |
View / edit / reply to this conversation on ReviewNB fehiepsi commented on 2022-03-09T02:52:55Z Line #3. plt.scatter(X, y) nit: adding |
View / edit / reply to this conversation on ReviewNB fehiepsi commented on 2022-03-09T02:52:56Z nit: missing |
View / edit / reply to this conversation on ReviewNB fehiepsi commented on 2022-03-09T02:52:56Z Line #5. plt.plot(X, mean, color='C3', lw=2) nit: missing |
This additional content is awesome! I learned a lot while reading this. Thanks, @nipunbatra! Just have a few small comments above, otherwise I think this is good to merge. |
1. cleaned up warning using try, excepy block 2. supressed the matplotlib stray text being printed using _ = ...()
Thanks a lot @fehiepsi. I have also learnt a lot :) I have made all the suggested changes. |