Skip to content
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 simple notebook comparing the results of ExactGP and viGP #50

Merged
merged 5 commits into from
Oct 16, 2023

Conversation

matthewcarbone
Copy link
Collaborator

I've created a simple example for people to compare the results of an ExactGP and a viGP. Nothing too fancy here.

@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2023

Codecov Report

Merging #50 (f642573) into main (a8e46a0) will increase coverage by 0.02%.
The diff coverage is n/a.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
+ Coverage   95.98%   96.01%   +0.02%     
==========================================
  Files          44       44              
  Lines        3541     3541              
==========================================
+ Hits         3399     3400       +1     
+ Misses        142      141       -1     
Flag Coverage Δ
unittests 96.01% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ziatdinovmax
Copy link
Owner

Thanks! I feel it could benefit a bit from a discussion on when one should use a fully Bayesian (HMC/NUTS) approach vs variational inference approximation. In my experience,

HMC/NUTS:
Sensitivity to Priors: This can be perceived as a strength or a weakness, depending on the context. However, many researchers appreciate it because it offers a more intuitive grasp of the model.
Reliable Uncertainty Estimates: Offers robust evaluations of uncertainties as it directly samples from the posterior. The variational methods are known to lead to underestimation of uncertainties.
Integration with Classical Bayesian Models: This is particularly evident when you consider the combination of Gaussian Processes with traditional Bayesian models, as demonstrated in structured GP and hypothesis learning.
Comprehensive Convergence Diagnostics: Indicators such as n_eff, r_hat, and acc_prob for each inferred parameter.
Speed Limitations: One of the primary drawbacks is its computational speed.

SVI:
Efficiency: It's significantly faster and is memory-efficient (performs equally well with 32-bit precision)
Acceptable Trade-offs: For many real-world tasks, the slight decrease in the accuracy of predictive uncertainty estimates is either negligible or acceptable.
Convergence Indicator Limitations: The loss may not be a very good indicator of convergence - can easily overshoot or undershoot.

@matthewcarbone
Copy link
Collaborator Author

matthewcarbone commented Oct 13, 2023

Would you like me to add this to the notebook or perhaps it belongs in a README/docs somewhere? I am definitely not an authority on these matters but I can try to explain.

@ziatdinovmax
Copy link
Owner

I would add it to the notebook for now. I plan to add some general advice to the README later on or maybe make a separate tutorial.

@matthewcarbone
Copy link
Collaborator Author

Ok will do. I'll add your text to the notebook a little later and will push the changes. I can also use this PR to run the smoke tests on all of the notebooks. Stay tuned.

@ziatdinovmax
Copy link
Owner

Sounds good - looking forward to it

@ziatdinovmax ziatdinovmax self-requested a review October 16, 2023 00:03
Copy link
Owner

@ziatdinovmax ziatdinovmax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I noticed it takes almost 2 hours for the notebook smoke tests. Perhaps we can add lines like num_samples=5 if smoke_test else 500 to the notebooks to make their testing faster. This can be addressed in a separate issue / pull request.

@ziatdinovmax ziatdinovmax merged commit 83c0113 into ziatdinovmax:main Oct 16, 2023
6 checks passed
@matthewcarbone matthewcarbone deleted the mc/nb branch October 16, 2023 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants