-
Notifications
You must be signed in to change notification settings - Fork 421
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
Fix #1241; correct the behavior of logpdf(d::Dirichlet, x) #1242
Conversation
…at the boundary of and outside of the support, and replace hard-coded Float64 values with more general types
Codecov Report
@@ Coverage Diff @@
## master #1242 +/- ##
==========================================
+ Coverage 81.81% 81.83% +0.02%
==========================================
Files 117 117
Lines 6587 6590 +3
==========================================
+ Hits 5389 5393 +4
+ Misses 1198 1197 -1
Continue to review full report at Codecov.
|
I doubt one can get it really perfect as function of
|
That seems to be due to a bug in julia> insupport(Dirichlet([1.0, 1.0]), [1.0 + 0.5sqrt(eps()), 0.])
true In general the summing of valid weights may result in a total greater than In your specific example there is a single weight above |
Should |
I think not, if there are any later improvements to insupport they likely require no changes to the PR, and improving insupport is tricky without going to an proper n-1 dimensional representation of probability vectors anyway |
I suspect this PR, and in particular the type promotions, broke DistributionsAD: https://github.com/TuringLang/DistributionsAD.jl/pull/143/checks?check_run_id=1592162436 Maybe the issues are fixed by #1243. |
The error |
This change is not released yet, is it? |
Hm, no, but perhaps it will be a problem? |
The error occurs only for |
Thanks for checking. |
It took me a while but in the end I figured out that the latest release of NNlib is responsible for the test failures: FluxML/NNlib.jl#251 |
This fixes
pdf(d::Dirchlet, x)
at the boundary of and outside of the support, and replaces hard-coded Float64 values with more general types.