Skip to content
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

[FR] add Gumbel distribution #548

Closed
fehiepsi opened this issue Feb 26, 2020 · 3 comments
Closed

[FR] add Gumbel distribution #548

fehiepsi opened this issue Feb 26, 2020 · 3 comments
Labels
good first issue Good for newcomers

Comments

@fehiepsi
Copy link
Member

As requested @tbsexton at #545, it would be nice to have Gumbel distribution in NumPyro.

References: wikipedia, pytorch dist, jax sampler.

@fehiepsi fehiepsi added the good first issue Good for newcomers label Feb 26, 2020
@rtbs-dev
Copy link

Also commenting to add info on gumbel-softmax, which kicked off this discussion (continuous approximation of categorical distribution).

Paper, (deprecated?) Pytorch version with straight-through forward-mode support

@rtbs-dev
Copy link

rtbs-dev commented Mar 2, 2020

Wow, thanks to @daydreamt! That was fast. I'd be happy to close this, or re-name it as "Gumbel-Softmax" if that functionality is also wanted.

Based on the pytorch link above, it seems like they are making use of some pytorch-specific detachments, etc. to implement the straight-through version (argmax in the fwd/sampling direction, softmax in the backward/gradient direction, if I'm understanding correctly). Not sure how such a thing could be done with the JAX backend.

@fehiepsi
Copy link
Member Author

fehiepsi commented Mar 3, 2020

@tbsexton A similar version can be implemented using jax.lax.stop_gradient, which plays the role of PyTorch detach. However, I am not sure how useful it is to solve your problem. Could you open a new issue which sketches your ideas and your feature request? FYI, we have RelaxedOneHotCategoricalStraightThrough distribution in Pyro, which can be ported to NumPyro without much difficulty.

I would like to close this issue for now and discuss on the new one. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants