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

Foward compile_kwargs to ADVI when init = "advi+..." #7640

Merged
merged 5 commits into from
Jan 9, 2025

Conversation

jessegrabowski
Copy link
Member

@jessegrabowski jessegrabowski commented Jan 9, 2025

Description

See title. Now that we are allowed to pass compile_kwargs to pm.sample, it would be nice if these kwargs were also passed to any subroutines that are called before/after sampling. An obvious example is the call to pm.fit when the user sets init = "advi+something". This PR forwards the compile_kwargs to ADVI.

It also renames fn_kwargs to compile_kwargs in the variational sub-module. This harmonizes the naming convention across the library. A depreciation warning is added when fn_kwargs is used for backwards compatibility.

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

📚 Documentation preview 📚: https://pymc--7640.org.readthedocs.build/en/7640/

@github-actions github-actions bot added VI Variational Inference maintenance labels Jan 9, 2025
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 54.54545% with 10 lines in your changes missing coverage. Please review.

Project coverage is 92.17%. Comparing base (82716fb) to head (ce09972).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pymc/variational/opvi.py 50.00% 8 Missing ⚠️
pymc/variational/inference.py 66.66% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7640      +/-   ##
==========================================
- Coverage   92.85%   92.17%   -0.68%     
==========================================
  Files         106      106              
  Lines       17771    17765       -6     
==========================================
- Hits        16501    16375     -126     
- Misses       1270     1390     +120     
Files with missing lines Coverage Δ
pymc/pytensorf.py 90.66% <ø> (+0.09%) ⬆️
pymc/sampling/mcmc.py 86.18% <ø> (ø)
pymc/variational/inference.py 87.12% <66.66%> (-0.82%) ⬇️
pymc/variational/opvi.py 86.83% <50.00%> (-0.60%) ⬇️

... and 3 files with indirect coverage changes

@ricardoV94 ricardoV94 merged commit 52f7fe1 into pymc-devs:main Jan 9, 2025
23 checks passed
@jessegrabowski jessegrabowski deleted the advi-compile-kwargs branch January 10, 2025 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance VI Variational Inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Respect compile_kwargs in ADVI when init = 'advi+...'
2 participants