You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah, it's not super obvious. I borrowed the trick from here, but they don't demonstrate it either. But it's actually not too hard to show. Remember that an easy way to sample is to use an inverse transform sampler, where you map uniform noise through the inverse CDF of the desired distribution. So if we can find the CDF and invert it, we have a sampler. All you then need to do is to grab the CDF of a truncated distribution from Wikipedia, plug in the Gumbel CDF and invert it.
Since the sampler above assumes gumbel noise, you will also need to map the gumbel noise through its CDF to get uniform noise (running the original Gumbel inverse transform sampler in reverse), which means that the final expression has the form InverseTruncatedCDF(CDF(gumbel)).
I didn't know why truncated gumbel can sampled in this way
return -tf.log(EPSILON + tf.exp(-gumbel) + tf.exp(-truncation))
can u describe it?
The text was updated successfully, but these errors were encountered: