-
Notifications
You must be signed in to change notification settings - Fork 31
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
Use twoπ
and convert it
#258
Conversation
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.
Thank you for the PR!
Two suggestions:
- Can you remove the Tau dependency and just use
twoπ
which is already available via StatsFuns (and IrrationalConstants)? - Can you remove the
eltype
definitions? They are not supposed to denote the parameter types and likely to be changed/clarified in Distributions, sp it's safer to not implememt them for now (and they are not needed for the fix)?
I used |
end | ||
|
||
function Distributions._logpdf(d::TuringDiagMvNormal, x::AbstractVector) | ||
return -(length(x) * log(2π) + 2 * sum(log.(d.σ)) + sum(abs2.((x .- d.m) ./ d.σ))) / 2 | ||
s = sum(log, d.σ) |
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.
sum(log....) to sum(log, ...)) which in the past caused sometimes problems with AD. Better not include such changes.
Closed in favour of #259 to avoid unrelated changes. |
Thank you for the PR but I think it's better to keep it as minimal as possible 🙂 |
OK, thanks for reviewing. |
Fixes #156