Adopting DensityInterface#342
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.
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.25logdensitytologdensityof(deprecating the former), check interface complianceDistributionsubtype check in compiler to usehasdensitytraitIIDDensity(Support DensityInterface API JuliaStats/Distributions.jl#1416 (comment))loglikelihoodtologdensityofwithIIDDensityBijectors.logpdf_with_trans