Skip to content
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

The code of IBQ loss is mismatch with the paper eq10. #50

Closed
yufan-aslp opened this issue Feb 26, 2025 · 1 comment
Closed

The code of IBQ loss is mismatch with the paper eq10. #50

yufan-aslp opened this issue Feb 26, 2025 · 1 comment

Comments

@yufan-aslp
Copy link

quant_loss = torch.mean((z_q - z)**2) + torch.mean((z_q_2.detach()-z)**2) + self.beta * \ torch.mean((z_q_2 - z.detach()) ** 2)

this code is at src/IBQ/modules/vqvae/quantize.py 453

But in the paper eq10 the beta is for the z with the z_q_2.detach()

@ShiFengyuan1999
Copy link
Collaborator

Hi @yufan-aslp, thanks for your reminder. Actually, we follow the implementation of the official VQGAN repo, leading to the same bug. We haven’t tried the case where legacy is set to False, but it should have a small impact on the final performance.

Image
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants