rosinality / vq-vae-2-pytorch

Implementation of Generating Diverse High-Fidelity Images with VQ-VAE-2 in PyTorch
Other
1.65k stars 275 forks source link

why we are including z_e(x) also for decoder input #20

Closed shiva1393 closed 4 years ago

shiva1393 commented 5 years ago

Hi @rosinality, In vqvae.py line no 65, quantize = input + (quantize - input).detach() Next this quantize variable we are using input to the decoder. but from paper we have to give only embeddings(e_i) there we shouldn't include z_e(x) means input variable .Please Can you clarify this question.

rosinality commented 5 years ago

quantize = input - input.detach() + quantize.detach(), so input is cancelled at the forward time.