Code Monkey home page Code Monkey logo

Comments (5)

torfjelde avatar torfjelde commented on August 15, 2024 1

So I don't think this is an issue with the RadialFlow:

d = MvNormal(zeros(2), I(2))
b = inverse(bijector(Dirichlet(ones(3))))

# RadialLayer
z_0 = zeros(length(d))
α = 0
β = 1
r = RadialLayer(α, β, z_0)

# Without simplex.
xs = eachcol(rand(transformed(d, r), 10000))
histogram2d(first.(xs), Base.Fix2(getindex, 2).(xs), nbins=50)

results in

tmp

So it's indeed symmetric.

The "issue" I guess is that the simplex bijector is not. The transformation is described here: https://mc-stan.org/docs/reference-manual/simplex-transform.html

It's not immediately obvious to me why this would be symmetric, though the resulting distribution indeed looks symmetric if you use a zero-mean isotropic Gaussian as the base.

I think @sethaxen might be the best guy to answer this:)

from bijectors.jl.

sethaxen avatar sethaxen commented on August 15, 2024 1

Cool, just don't use softmax directly, as it's not bijective. You might want to try out "NormalizedExponential" or "AugmentedSoftmax" here: https://github.com/mjhajharia/transforms/tree/main/transforms/simplex . Both are bijective by augmenting softmax with logsumexp, but they do different things to the inputs to softmax to try to improve the geometry, and they use different priors for the discarded parameter (the output of logsumexp).

from bijectors.jl.

sethaxen avatar sethaxen commented on August 15, 2024

All stick-breaking transforms are indeed not symmetric. There are symmetric transforms on the simplex though (in particular, several softmax-based transforms, e.g. the additive log ratio transform from compositional data analysis), though some are better for MCMC than others. How important is this symmetry to you?

from bijectors.jl.

theogf avatar theogf commented on August 15, 2024

@sethaxen Quite crucial, my general goal is to have some kind of circular prior in the simplex, but all components should have equal chances. Since the bijection aspect is not so important to me, I could try using the softmax approach.

from bijectors.jl.

theogf avatar theogf commented on August 15, 2024

Since it's not a bug but just a specificity of the model used I will close this issue

from bijectors.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.