DistributionsAD.jl
DistributionsAD.jl copied to clipboard
Automatic differentiation of Distributions using Tracker, Zygote, ForwardDiff and ReverseDiff
Trying to compute gradients of the `rand` function wrt to parameters for certain distributions will produce incorrect results, because some of these functions use branching or iterated algorithms and AD...
```julia using Turing, ReverseDiff, LoopVectorization using ReverseDiff: @grad, TrackedArray Turing.setadbackend(:reversediff) logsumexp(x::TrackedArray) = ReverseDiff.track(logsumexp, x) @grad function logsumexp(x::AbstractArray) lse = logsumexp(ReverseDiff.value(x)) return lse, Δ -> (Δ .* exp.(ReverseDiff.value(x) .- lse),) end...
AbstractGPs.jl has the following default implementation (https://github.com/JuliaGaussianProcesses/AbstractGPs.jl/blob/04e4c53a3a66c62c83cdb4f47aabcfb04543acf4/src/abstract_gp/finite_gp.jl#L298-L309): ```julia function Distributions._logpdf(f::FiniteGP, y::AbstractVector{
While computing logpdf of Multivariate normal distributions, the logpdf is of type Float64, even when the mean, covariance matrix and observation all have eltype Float32. MVE for TuringDiagMvNormal (TuringScalMvNormal and...
The only explanation of `filldist` I could find is here: https://turing.ml/dev/docs/using-turing/performancetips#special-care-for-tracker-and-zygote > `filldist(dist, N)` creates a multivariate distribution that is composed of `N` identical and independent copies of the univariate...
Currently, these distributions are broken due to https://github.com/FluxML/Zygote.jl/issues/873. As discussed in https://github.com/TuringLang/Bijectors.jl/pull/155, the corresponding tests are marked as broken. The issue will be fixed upstream.
After much digging and testing, it appears you are currently not supporting sparse matrix constructions for AD. Is this correct? In particular, I am in need of a MvNormal distribution...
Hello, I'm trying to use quadrature to compute basic statistics for different multivariate distributions such as Dirichlet and Matrix Beta, such as the sum(x_i), variance(sum(x_i)) and mean of sqrt(sum(x_i^2)) where...
I'm trying to setup InverseWishart prior in my Turing.jl model as follows: τ ~ filldist(InverseWishart(2+1, Matrix{Float64}([[3,0.5] [0.5,3]])), 10) and getting error message: MethodError: no method matching filldist(::InverseWishart{Float64,PDMats.PDMat{Float64,Array{Float64,2}}}, ::Int64) This is...
It seems Distributions 0.24 broke ReverseDiff for the multivariate distribution `filldist(::Skellam, n)` (https://github.com/TuringLang/DistributionsAD.jl/pull/119#issuecomment-705769224).