The VQ-VAE implimentation:https://colab.research.google.com/github/zalandoresearch/pytorch-vq-vae/blob/master/vq-vae.ipynb

quantized = inputs + (quantized - inputs).detach()

Why are we subtracting and adding input to quantized result?

  • $\begingroup$ Numerical stability. $\endgroup$ – Abhishek Verma Mar 11 at 19:02
  • $\begingroup$ @AbhishekVerma it would be really helpful if you could please explain this with a little detail....kind of a newbie here. $\endgroup$ – Vortex Mar 12 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.