TuringLang / AbstractMCMC.jl

Abstract types and interfaces for Markov chain Monte Carlo methods
https://turinglang.org/AbstractMCMC.jl
MIT License
78 stars 18 forks source link

Add AbstractModel implementation of LogDensityProblems interface #110

Closed torfjelde closed 1 year ago

torfjelde commented 1 year ago

This PR adds an implementation of AbstractModel which supports the LogDensityProblems.jl interface.

Benefits:

  1. We get a good "default" implementation for a AbstractModel, allowing sharing of model definitions between different sampler packages, e.g. with this AdvancedHMC.jl (see https://github.com/TuringLang/AdvancedHMC.jl/pull/301 for related discussion) and AdvancedMH.jl can both use LogDensityModel instead of defining their own.
  2. We get AD "for free" through LogDensityProblemsAD.jl.
torfjelde commented 1 year ago

Do we still support Julia 1.3?

torfjelde commented 1 year ago

And we should at least be testing on Julia 1.6, which we currently are not doing.

codecov[bot] commented 1 year ago

Codecov Report

Base: 97.19% // Head: 97.19% // No change to project coverage :thumbsup:

Coverage data is based on head (314cb57) compared to base (6ef1dcb). Patch has no changes to coverable lines.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #110 +/- ## ======================================= Coverage 97.19% 97.19% ======================================= Files 7 7 Lines 285 285 ======================================= Hits 277 277 Misses 8 8 ``` | [Impacted Files](https://codecov.io/gh/TuringLang/AbstractMCMC.jl/pull/110?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TuringLang) | Coverage Δ | | |---|---|---| | [src/AbstractMCMC.jl](https://codecov.io/gh/TuringLang/AbstractMCMC.jl/pull/110/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TuringLang#diff-c3JjL0Fic3RyYWN0TUNNQy5qbA==) | `100.00% <ø> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TuringLang). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TuringLang)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

torfjelde commented 1 year ago

As long as you're happy with the bump to 1.6, this should now be ready to go:)