Repo for all sorts of Gen distributions ....
- Module:
GenDistributionZoo
So far we have:
-
diagnormal
:- Diagonal Gaussian (faster than
mvnormal
) - There already is a
broadcasted_normal
— it's similar in performance
- Diagonal Gaussian (faster than
-
ProductDistribution
:HomogeneousProduct
wrong args, under constr ...HeterogeneousProduct
- One can specify the dimension along which the args of each distribution are "stacked".
-
PushForward
: ... -
...
using BenchmarkTools
using Gen: logpdf, mvnormal
using GenDistributionZoo: diagnormal
n = 1_000
mus = rand(n);
stds = ones(n);s
xs = rand(n);
@btime diagnormal($mus, $stds);
@btime logpdf($diagnormal, $xs, $mus, $stds);
# >> 4.847 μs (1 allocation: 7.94 KiB)
# >> 6.006 μs (0 allocations: 0 bytes)