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

what is the difference between z_q_x and z_q_x_bar? #4

Closed
PanXiebit opened this issue Sep 16, 2021 · 2 comments
Closed

what is the difference between z_q_x and z_q_x_bar? #4

PanXiebit opened this issue Sep 16, 2021 · 2 comments

Comments

@PanXiebit
Copy link

hi @rakhimovv, thanks for your perfect work on video generation.

z_q_x_, indices = vq_st(z_e_x_, self.embedding.weight.detach())
z_q_x = z_q_x_.permute(0, 3, 1, 2).contiguous()

z_q_x_bar_flatten = torch.index_select(self.embedding.weight,
dim=0, index=indices)
z_q_x_bar_ = z_q_x_bar_flatten.view_as(z_e_x_)
z_q_x_bar = z_q_x_bar_.permute(0, 3, 1, 2).contiguous()

In the codes of the VQEmbedding, I am confused on this line, it seems that z_q_x and z_q_z_bar are the same for z_q(x) which is the produced codes. Hope for your response.

@rakhimovv
Copy link
Owner

rakhimovv commented Sep 16, 2021

Hi, @PanXiebit ! z_q_x and z_q_z_bar will differ if you use EMA for updating the dictionary. As you can see z_q_x_bar is obtained using self.embedding.weight, but the last one is updated inside the if clause

@PanXiebit
Copy link
Author

@rakhimovv thanks!

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