Bijectors.jl
Bijectors.jl copied to clipboard
Implementation of normalising flows and constrained random variable transformations
Here's a MWE ```julia using Distributions, Bijectors, Zygote dists = [Beta(), InverseGamma()] ranges = [1:2, 3:3] bs = Bijectors.bijector.(dists) binvs = inverse.(bs) stacked = Bijectors.Stacked(binvs, ranges) display(stacked(randn(3))) Zygote.gradient(x -> Bijectors.with_logabsdet_jacobian(stacked,...
Hi, It appears that `torch.probability` simply uses [softmax](https://github.com/pytorch/pytorch/blob/8472c24e3b5b60150096486616d98b7bea01500b/torch/distributions/constraint_registry.py#L246C41-L246C41) for the simplex bijector. Is there a reason our simplex transform is much more complicated? I was also thinking about a GPU-friendly...
Hi there, Thanks for all the hard work and for updating all the transforms! I noticed I get a domain error when evaluating 'logabsdetjac' after mapping the parameter in the...
There are a number of bijective matrix factorizations that it might make sense to include here, e.g. - unique QR (usual QR but constraining the diagonal of R to be...
This PR adds two new bijectors: `CDFBijector` and `QuantileBijector`, which do exactly what they sound like. To-do: - [x] add code - [x] add docstrings with doctests - [ ]...
The implementation introduced in #271 is not "natively" a vector-based implementation, but instead just re-uses the old matrix--version. We should improve this.
After #246, `CorrBijector` is no longer in use. This was the old bijector for `LKJ` which mapped a correlation matrix to a matrix of the same dimensions in unconstrained space...
https://github.com/JuliaStats/Distributions.jl/pull/1668 added distributions for [sample order statistics](https://juliastats.org/Distributions.jl/stable/order_statistics/)" `OrderStatistic` and `JointOrderStatistics`. `OrderStatistic` has the same constraints as the distribution it wraps and should get the same bijector. ```julia bijector(d::OrderStatistic) = bijector(d.dist)...
Taking the `logpdf` of a `MultivariateTransformed` works. ``` julia julia> td = transformed(MvNormal(zeros(2), ones(2)), PlanarLayer(2)) MultivariateTransformed{DiagNormal, PlanarLayer{Vector{Float64}, Vector{Float64}}}( dist: DiagNormal( dim: 2 μ: [0.0, 0.0] Σ: [1.0 0.0; 0.0 1.0]...
Hi, thank you for the nice package! When I am looking into the `PlanarLayer` and `RadialLayer`, is it worth considering adding `rng` like: ```julia function PlanarLayer(dims::Int, wrapper=identity, rng=Random.GLOBAL_RNG) w =...