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 multi head external attetion can't work #29

Closed
DRJYYDS opened this issue Apr 11, 2022 · 3 comments
Closed

the code of multi head external attetion can't work #29

DRJYYDS opened this issue Apr 11, 2022 · 3 comments

Comments

@DRJYYDS
Copy link

DRJYYDS commented Apr 11, 2022

85ed43e6f2f7159a117ad374faa6570
It's obvious that the code is wrong. You should check the reshape and transpose part in your code.
And what is the coef? It has not been mentioned in the paper.
And also you didn't import the torch.
And the qkv_bias, qk_scale is not used here.
Did you really run the multi-head version in your paper?

@MenghaoGuo
Copy link
Owner

I think the code is correct.
We import toch in this line.

You can read the code carefully and run it and you will find it is correct.

Some code comments may inaccurate and we will organize this repo after this article is accepted.

@DRJYYDS
Copy link
Author

DRJYYDS commented Apr 12, 2022

I think the code is correct. We import toch in this line.

You can read the code carefully and run it and you will find it is correct.

Some code comments may inaccurate and we will organize this repo after this article is accepted.

So the actual shape for X is [B,C,N]? or the code can't work at all.
image

Btw, the screenshot is from the file 'multi_head_attention_torch.py'. You did not import torch here.

@MenghaoGuo
Copy link
Owner

it is b n c and nn.Linear can be used in this situation.

We do not import this multi head file in the EAMLP,Please check it.

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