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

Variational inference with PyMC #1306

Merged
merged 42 commits into from
May 21, 2024
Merged

Variational inference with PyMC #1306

merged 42 commits into from
May 21, 2024

Conversation

arrjon
Copy link
Contributor

@arrjon arrjon commented Feb 14, 2024

I added a wrapper for variational inference with PyMC. The wrapper uses the PymcSampler as basis and directly supports all functions and methods from PyMC see here for details on VI.

To include this properly in pyPESTO one would need to add proper testing and write a Result Object to save the estimated parameters of the variational distribution.

@arrjon arrjon added the enhancement New feature or request label Feb 14, 2024
@arrjon arrjon self-assigned this Feb 14, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2024

Codecov Report

Attention: Patch coverage is 1.08696% with 91 lines in your changes are missing coverage. Please review.

Project coverage is 83.90%. Comparing base (7fe40ba) to head (bdd8873).

Files Patch % Lines
pypesto/variational/pymc.py 0.00% 53 Missing ⚠️
pypesto/variational/variational_inference.py 0.00% 35 Missing ⚠️
pypesto/variational/__init__.py 0.00% 2 Missing ⚠️
pypesto/store/save_to_hdf5.py 50.00% 1 Missing ⚠️

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

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1306      +/-   ##
===========================================
- Coverage    84.48%   83.90%   -0.59%     
===========================================
  Files          157      160       +3     
  Lines        12959    13051      +92     
===========================================
+ Hits         10949    10950       +1     
- Misses        2010     2101      +91     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@PaulJonasJost PaulJonasJost left a comment

Choose a reason for hiding this comment

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

Thanks a lot for putting this first draft together :)

Should discuss about further things needed aside from testing, before it can be merged.

pypesto/sample/__init__.py Outdated Show resolved Hide resolved
pypesto/sample/pymc.py Outdated Show resolved Hide resolved
pypesto/sample/variational_inference.py Outdated Show resolved Hide resolved
pypesto/sample/variational_inference.py Outdated Show resolved Hide resolved
pypesto/sample/variational_inference.py Outdated Show resolved Hide resolved
@arrjon
Copy link
Contributor Author

arrjon commented Mar 12, 2024

Mainly tests are missing, but otherwise ready

@arrjon arrjon marked this pull request as ready for review April 8, 2024 08:17
Copy link
Contributor

@Doresic Doresic left a comment

Choose a reason for hiding this comment

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

All in all, very nice implementation! Thanks.
I left some questions/recommendations that would come up to my mind if I would try to use the module myself.

pypesto/variational/pymc.py Outdated Show resolved Hide resolved
pypesto/variational/pymc.py Show resolved Hide resolved
pypesto/variational/variational_inference.py Show resolved Hide resolved
pypesto/variational/variational_inference.py Show resolved Hide resolved
pypesto/variational/variational_inference.py Show resolved Hide resolved
pypesto/variational/pymc.py Show resolved Hide resolved
test/variational/test_variational.py Outdated Show resolved Hide resolved
@arrjon arrjon merged commit fefefd5 into develop May 21, 2024
18 checks passed
@arrjon arrjon deleted the variational_inference branch May 21, 2024 12:52
This was referenced May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants