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

Update for DynamicPPL 0.33 and 0.34 #2459

Merged
merged 5 commits into from
Jan 23, 2025
Merged

Update for DynamicPPL 0.33 and 0.34 #2459

merged 5 commits into from
Jan 23, 2025

Conversation

penelopeysm
Copy link
Member

@penelopeysm penelopeysm commented Jan 10, 2025

This PR:

DPPL 0.34 removed certain methods of values_as_in_model, but those weren't used by Turing, so this release will be compatible with both 0.33 and 0.34.

@penelopeysm penelopeysm reopened this Jan 10, 2025
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.45%. Comparing base (24d5556) to head (d91cb48).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2459      +/-   ##
==========================================
- Coverage   85.01%   84.45%   -0.57%     
==========================================
  Files          21       21              
  Lines        1582     1570      -12     
==========================================
- Hits         1345     1326      -19     
- Misses        237      244       +7     

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

@coveralls
Copy link

coveralls commented Jan 10, 2025

Pull Request Test Coverage Report for Build 12877203451

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 8 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+8.0%) to 84.459%

Files with Coverage Reduction New Missed Lines %
src/mcmc/Inference.jl 8 80.89%
Totals Coverage Status
Change from base Build 12786420948: 8.0%
Covered Lines: 1326
Relevant Lines: 1570

💛 - Coveralls

@penelopeysm penelopeysm marked this pull request as draft January 13, 2025 11:16
@penelopeysm penelopeysm changed the title Update for DynamicPPL 0.33 Update for DynamicPPL 0.33 and 0.34 Jan 16, 2025
@penelopeysm penelopeysm marked this pull request as ready for review January 17, 2025 18:11
@penelopeysm penelopeysm requested a review from sunxd3 January 17, 2025 18:11
@penelopeysm
Copy link
Member Author

@sunxd3 Pinging you since the main breaking change (apart from me messing with values_as_in_model) was predict. Is it ok to just remove the function here entirely? :)

@sunxd3
Copy link
Member

sunxd3 commented Jan 19, 2025

Is it ok to just remove the function here entirely?

I think so. The tests for predict are here. Not certain we want to keep a subset of them just to test the interface (probably not necessary).

@sunxd3
Copy link
Member

sunxd3 commented Jan 19, 2025

Another question: currently Turing's predict is imported from StatsBase, while DPPL's predict is from AbstractPPL. Because AbstractPPL is implementing StatsBase.predict, so Turing's predict should be same as PDDL's. (Sorry for the tongue twister.)

But should be start using AbstractPPL's predict?

@penelopeysm
Copy link
Member Author

tests

Oh, good catch - the tests should definitely be only in DynamicPPL, I don't think there's a need to keep them here. Will remove

imports

That's a good point! I was wondering the same about sample, actually, which is from AbstractMCMC but that's in turn also from StatsBase (I think). I'll investigate this properly on Monday if I get the time:)

@penelopeysm
Copy link
Member Author

penelopeysm commented Jan 20, 2025

I looked into it a bit and I feel like the most sensible option is this:

  • in DynamicPPL, overload and export AbstractPPL.predict
  • in Turing, import and re-export DynamicPPL.predict (I think it all resolves to the same function? after all, DPPL doesn't have an issue importing AbstractPPL.predict when it's actually from StatsBase). The point being that we could import StatsBase.predict in Turing, but I feel like that kind of hides the fact that we're substantially overloading its behaviour in DynamicPPL, and importing predict from DynamicPPL at least reminds us where we're getting the implementation from.

Since we fixed the immediate issue with :=, would you feel comfortable re-exporting predict from DPPL?

@sunxd3
Copy link
Member

sunxd3 commented Jan 22, 2025

On the importing/exporting front, I don't have more to add to this PR.

But maybe delete the tests for predict?

@penelopeysm
Copy link
Member Author

penelopeysm commented Jan 22, 2025

Yup, I got rid of the tests already!

Re the exports I just realised AbstractPPL doesn't export predict either, so that's why we probably have to import it from StatsBase. let's keep it that way for now (until we sort out the exports in AbstractPPL/DynamicPPL 😬)

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