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

Missing parameter of beta #22

Open
Corleone-Huang opened this issue Aug 9, 2022 · 3 comments
Open

Missing parameter of beta #22

Corleone-Huang opened this issue Aug 9, 2022 · 3 comments

Comments

@Corleone-Huang
Copy link

Hi, in the original VQVAE paper, the commit_loss is defined as

(quantize.detach()-x) ** 2 + beta * (quantize - x.detach() ** 2)

where the beta is usually to be 0.25. But the commit_loss is defined as the following in your implementation:

F.mse_loss(quantize.detach(), x)

So I wonder if the parameter beta is set to be 1 by default or if the second term is missing? Thank you very much.

@lucidrains
Copy link
Owner

lucidrains commented Aug 9, 2022

@dortenenboim314
Copy link

dortenenboim314 commented Mar 12, 2023

Hi @lucidrains, seems that the commitment loss in your code refers only to the first term of the equation:

(quantize.detach()-x) ** 2 + beta * (quantize - x.detach() ** 2)

Does the second term appears in you code somewhere? If it does, can you please help me find it? I tried and found no references to it.

If it doesn't, what "moves" the codebook towards the encoder's output? The commit loss seems to "move" only the encoder outputs.

I'm asking beacsue I'm trying to train RVQ+Decoder on top of a fixed pre trained Encoder (without fine tune the encoder). And it seems that the commit loss is just getting bigger.

@naitian
Copy link

naitian commented Jun 2, 2023

In this repository, the codebook is updated based on exponential moving averages.

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

4 participants