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

Should encoder mask be a (1, seq_len, seq_len) matrix? #30

Open
scotthuang1989 opened this issue Sep 27, 2024 · 0 comments
Open

Should encoder mask be a (1, seq_len, seq_len) matrix? #30

scotthuang1989 opened this issue Sep 27, 2024 · 0 comments

Comments

@scotthuang1989
Copy link

If input sentence is (A, B, C, D, PAD).
In this implementation, encoder mask is [[[FALSE, FALSE, FALSE, TRUE]]]
But the encoder attention is
[
[AA, AB, AC, AD],
[BA, BB, BC, BD],
[CA, CB, CC, CD],
[DA, DB, DC, DD]
]
This encoder mask will only mask the 4th colomn. 4th row should also be mask?
So encoder mask should be

[[
[FALSE, FALSE, FALSE, TRUE]
[FALSE, FALSE, FALSE, TRUE]
[FALSE, FALSE, FALSE, TRUE]
[TRUE, TRUE, TRUE, TRUE]
]
]

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

1 participant