vq-vae-2-pytorch icon indicating copy to clipboard operation
vq-vae-2-pytorch copied to clipboard

about one_hot

Open Sky-zhan opened this issue 5 years ago • 2 comments
trafficstars

Thanks for sharing your helpful work. There is a question I am wondering, that is the code ‘dist = (...)’ and ‘embed_onehot = F.one_hot(...)’, existing in class Quantize. I didn't find the corresponding content in the original paper,i.e., ‘Generating Diverse High-Fidelity Images with VQ-VAE-2’. Could you tell me where it comes from? Thanks a lot.

Sky-zhan avatar Jul 25 '20 00:07 Sky-zhan

You can refer to VQ-VAE implementation of Sonnet. (https://github.com/deepmind/sonnet/blob/master/sonnet/python/modules/nets/vqvae.py) It is for efficiently implement quantization.

rosinality avatar Jul 25 '20 00:07 rosinality

thanks

Sky-zhan avatar Jul 25 '20 11:07 Sky-zhan