Closed zhaohm14 closed 2 weeks ago
Thanks for your interest in our work! It is from https://github.com/CompVis/taming-transformers/blob/3ba01b241669f5ade541ce990f7650a3b8f65318/taming/modules/vqvae/quantize.py#L70, the initial version of VQ. We have not conducted any experiments on it. Generally, using self.embedding(min_encoding_indices) is a more prevalent way to get codebook entries, which can be found in https://github.com/CompVis/taming-transformers/blob/3ba01b241669f5ade541ce990f7650a3b8f65318/taming/modules/vqvae/quantize.py#L213.
Understood. Thanks a lot!
Hello,
While exploring the Open-MAGVIT2 repository, I noticed an interesting approach to codebook selection implemented in the following code snippet: https://github.com/TencentARC/Open-MAGVIT2/blob/main/taming/modules/vqvae/quantize.py#L53
I am curious about the decision to use the more verbose method of creating min_encodings and using matrix multiplication for obtaining quantized latent vectors (z_q), instead of directly using self.embedding(min_encoding_indices). Could there be specific reasons related to performance or implementation details that favor this approach?
Thank you for your insights!