New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commitment Loss Problems #27
Comments
After reading the code, I notice the commitment loss is calculated using MSE, which measures the difference between Hope I explain my idea clearly. |
I totally agree with what you say but the purpose of the commitment loss is for the encoder embeddings to "commit" in other words, be similar to at least one of the codes of the codebook. I think ideally the encoder outputs should be similar (I don't know how similar) to the codes of the codebook. EMA (Exponential Moving Average) should "push" the codes to be similar to these embeddings and this commitment loss should "push" the embeddings to be similar to the codes until they converge. In my case, it seems like the commitment loss grows indefinitely and it does not converge. Is this right? |
Oh your explain helps deepen my understanding about VQVAE. Currently I have the same problem, namely the infinite commitment loss. I tried to set the Hope someone know the answer :) |
@pedrocg42 that happened to us as well, what is your decay and commitment_cost? |
i've seen a number of papers omit commitment loss i don't think it is necessary |
Right now I am following @lucidrains recommendation of not using any commitmen_loss and just using EMA to update the VQ codebooks. At the time I tried several configurations of both decay and commitment_cost with the same outcome, commitment loss growing continuously. The range I tried for decay was 0.5-0.99 being 0.99 my starting point, and the range for the commitment cost I tried was 0.5-2. The results only using EMA are good though, so I recommend you to not worry that much even if you use the commitment cost and your commitment loss is huge. |
It's great that it worked without using the commitment loss. However, why would the commitment loss increase continuously? |
Hello,
First of all, thank you so much for this powerful implementation.
I have been researching to train some VQ-VAE to generate faces from FFHQ 128x128 and I always have the same problem if I use the commitment loss (0.25) and the gamma (0.99) like in the original paper, the commitment loss seems to grow infinitely. I know you said that it is an auxiliary loss and that is not that important but is this normal behavior? If not, how can I avoid for that to happen in the case I wanted to use this loss?
Thank you so much in advance!
The text was updated successfully, but these errors were encountered: