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

N/C ? #2

Open
Mrfanl opened this issue Jun 23, 2022 · 1 comment
Open

N/C ? #2

Mrfanl opened this issue Jun 23, 2022 · 1 comment

Comments

@Mrfanl
Copy link

Mrfanl commented Jun 23, 2022

if (N / C) < 1: x = ((q @ k.transpose(-2, -1)) @ v).transpose(1, 2).reshape(B, N, C) else: x = (q @ (k.transpose(-2, -1) @ v)).transpose(1, 2).reshape(B, N, C)
should be
if (N / (C/H)) < 1: x = ((q @ k.transpose(-2, -1)) @ v).transpose(1, 2).reshape(B, N, C) else: x = (q @ (k.transpose(-2, -1) @ v)).transpose(1, 2).reshape(B, N, C)

@soroush-abbasi
Copy link
Collaborator

soroush-abbasi commented Jul 20, 2022

Hi,

Sorry for the late reply. You are correct. Thanks for pointing out this bug!

BTW, in the paper we show that SimA works well even without multi-head attention (single head H=1).

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