D-X-Y / AutoDL-Projects

Automated deep learning algorithms implemented in PyTorch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why use exponential distribution to implement Gumbel softmax?

pingguokiller opened this issue · comments

In function select2withP of AutoDL-Projects\lib\models\shape_searchs\SoftSelect.py, the implementation of Gumbel softmax is below:

gumbels = -torch.empty_like(logits).exponential_().log()

I don't understand why to use exponential distribution to implement Gumbel softmax?