-
Notifications
You must be signed in to change notification settings - Fork 29
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
Adopting DensityInterface #342
base: master
Are you sure you want to change the base?
Conversation
Distributions 0.25.25 is the release where DensityInterface is introduced there. I guess we don't want to explicitely restrict on that; instead, should be able to just specialize distributions for now, and The bigger "problem" is that
Technically this shifts the burden to implementors of DensityInterface to also implement @torfjelde were there any big hurdles other than the bijetors when you tried to make DPPL work with Soss? For comparison:
|
check_tilde_rhs(x) = check_tilde_rhs(x, DensityInterface.DensityKind(x)) | ||
check_tilde_rhs(x::Distribution) = x | ||
check_tilde_rhs(x::AbstractArray{<:Distribution}) = x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this could be simplified and generalized to
check_tilde_rhs(x) = check_tilde_rhs(x, DensityInterface.DensityKind(x)) | |
check_tilde_rhs(x::Distribution) = x | |
check_tilde_rhs(x::AbstractArray{<:Distribution}) = x | |
check_tilde_rhs(x) = check_tilde_rhs(x, DensityInterface.DensityKind(x)) | |
check_tilde_rhs(x::AbstractArray) = check_tilde_rhs(x, DensityInterface.DensityKind(first(x))) |
or, if DensityKind
works with types, to
check_tilde_rhs(x) = check_tilde_rhs(x, DensityInterface.DensityKind(x)) | |
check_tilde_rhs(x::Distribution) = x | |
check_tilde_rhs(x::AbstractArray{<:Distribution}) = x | |
check_tilde_rhs(x) = check_tilde_rhs(x, DensityInterface.DensityKind(x)) | |
check_tilde_rhs(x::AbstractArray) = check_tilde_rhs(x, DensityInterface.DensityKind(eltype(x))) |
So @torfjelde should |
It'll be the same for now: TuringLang/Bijectors.jl#212 |
Pull Request Test Coverage Report for Build 8974831544Details
💛 - Coveralls |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #342 +/- ##
==========================================
- Coverage 76.64% 76.38% -0.26%
==========================================
Files 30 21 -9
Lines 3288 2524 -764
==========================================
- Hits 2520 1928 -592
+ Misses 768 596 -172 ☔ View full report in Codecov by Sentry. |
Implements #340
TODO:
Require Distributions 0.25.25logdensity
tologdensityof
(deprecating the former), check interface complianceDistribution
subtype check in compiler to usehasdensity
traitIIDDensity
(Support DensityInterface API JuliaStats/Distributions.jl#1416 (comment))loglikelihood
tologdensityof
withIIDDensity
Bijectors.logpdf_with_trans