Owen-Liuyuxuan / papers_reading_sharing.github.io

Sites to share deep learning related papers and their digests
https://owen-liuyuxuan.github.io/papers_reading_sharing.github.io/
54 stars 7 forks source link

Categorical Reparameterization with Gumbel-Softmax comments #5

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Categorical Reparameterization with Gumbel-Softmax - Reading Collections

https://owen-liuyuxuan.github.io/papers_reading_sharing.github.io/Building_Blocks/GumbelSoftmax/

river-mz commented 1 year ago

你好,看了你的博客,我很有收获。对于Gumbel softmax,我的理解是可以通过调节温度的变化,将分布向均匀或onehot的形式调整,但是总体分布还是和原来分布相符合的(比如在非极端的温度下,最大值的位置应该依然保持不变)。但是在实际动手尝试调用pytorch的时候,发现使用Gumbel softmax前后,分布有较大改动,代码和输入如下。 logits = torch.randn(1, 5) logits = torch.softmax(logits,dim=-1) print(logits) soft = F.gumbel_softmax(logits, tau=1, hard=False) print(soft)

tensor([[0.2096, 0.1859, 0.1033, 0.1246, 0.3767]]) tensor([[0.0823, 0.1950, 0.1542, 0.4819, 0.0865]])

我对结果感到很困惑,请问是我对Gumbel softmax的理解存在误差吗?