pclucas14 / pixel-cnn-pp

Pytorch Implementation of OpenAI's PixelCNN++
Other
345 stars 76 forks source link

How to understand sample from softmax? #2

Closed npuichigo closed 6 years ago

npuichigo commented 6 years ago

I have no idea of this line about sampling from softmax. Can you give me a help?

 temp.uniform_(1e-5, 1. - 1e-5)
 temp = logit_probs.data - torch.log(- torch.log(temp))
 _, argmax = temp.max(dim=3)
pclucas14 commented 6 years ago

Hi @npuichigo

Sorry for the late reply; I took this line from the original repository. From what I understand it has to do with the definition of the CDF for the mixture of logistic distribution.