Closed weixsong closed 6 years ago
This is the Gumbel-max trick, used to efficiently sample from a softmax distribution: https://hips.seas.harvard.edu/blog/2013/04/06/the-gumbel-max-trick-for-discrete-distributions/
@xmasotto , thanks very much. I got it.
Hi,
In the code, logistic distribution sampling is done by:
I could not understand how it it done this way.
Do I need to compute the CDF of pdf, and then for cdf, minus a random unifrom number, and take log option?
Why here minus a random uniform number make sense?