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

Added support for models using the LogDensityProblems.jl interface #70

Merged
merged 8 commits into from
Dec 28, 2022

Conversation

torfjelde
Copy link
Member

With this change it's possible to use models implementing the LogDensityProblems.jl interface. This is now easy to support after TuringLang/AbstractMCMC.jl#110.

Similar PR merged for AHMC.jl: TuringLang/AdvancedHMC.jl#301

Copy link
Member

@cpfiffer cpfiffer left a comment

Choose a reason for hiding this comment

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

Excellent, thank you!

@cpfiffer
Copy link
Member

I'll merge this in after tests pass

@cpfiffer
Copy link
Member

Tests are failing because we're still testing on Julia 1.0, let me fix that.

@cpfiffer cpfiffer closed this Dec 28, 2022
@cpfiffer cpfiffer reopened this Dec 28, 2022
@cpfiffer cpfiffer merged commit e174117 into master Dec 28, 2022
@delete-merged-branch delete-merged-branch bot deleted the torfjelde/logdensitymodel branch December 28, 2022 18:25
@cpfiffer
Copy link
Member

🥳 Thank you, @torfjelde!

@@ -68,6 +68,24 @@ Quantiles

```

### Usage with [`LogDensityProblems.jl`](https://github.com/tpapp/LogDensityProblems.jl)

It can also be used with models defining the [`LogDensityProblems.jl`](https://github.com/tpapp/LogDensityProblems.jl) interface by wrapping it in `AbstractMCMC.LogDensityModel` before passing it to `sample`:
Copy link
Member

Choose a reason for hiding this comment

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

Is it really necessary to wrap the log density? Couldn't we wrap anything in a LogDensityModel that's not one of our specialized model types? We could even check LogDensityProblems.capabilities !== nothing to ensure that we do not wrap anything accidentally that does not implement the interface.

@devmotion
Copy link
Member

Tests are failing because we're still testing on Julia 1.0, let me fix that.

That means this PR should have bumped Julia compat to 1.6, shouldn't it?

@cpfiffer
Copy link
Member

Oops, thanks for catching that, @devmotion

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