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

Code Question #12

Closed
Ahnsun opened this issue Jan 4, 2021 · 3 comments
Closed

Code Question #12

Ahnsun opened this issue Jan 4, 2021 · 3 comments

Comments

@Ahnsun
Copy link

Ahnsun commented Jan 4, 2021

out_sim = torch.bmm(sim_map, value.transpose(1, 2))

Why do the matrix multiplication V×(Q×K) before adding Wm?

@Howal
Copy link
Owner

Howal commented Jan 4, 2021

It follows Eq.12 in our paper.

@Ahnsun
Copy link
Author

Ahnsun commented Jan 4, 2021

Thanks for your answer,but in the Fig. 2,Wv is the last one to be multiplied after adding the Wm,and in the code,value(Wv) is multiplied before adding the Wm

@Howal
Copy link
Owner

Howal commented Jan 5, 2021

Vx(QxK+Wm) = Vx(QxK) + VxWm
We follow the left term in Fig 2 and the right term in the code.

@Howal Howal closed this as completed Apr 13, 2021
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