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

One implementation problem in transformer_v3.py #3

Closed
VincentCheng24 opened this issue Jan 14, 2020 · 1 comment
Closed

One implementation problem in transformer_v3.py #3

VincentCheng24 opened this issue Jan 14, 2020 · 1 comment

Comments

@VincentCheng24
Copy link

It seems that the function defined here needs to be modified as follows:

    def forward(self, q, k, v, mask=None):
        bs = k.shape[0]
        k = k.view(bs, -1, self.head, self.d_k)
        q = F.relu(self.q_linear(q).view(bs, self.head, self.d_k))
        ...

Please help check this.
BTW, thanks for sharing this implementation.

@ppriyank
Copy link
Owner

ppriyank commented Jul 1, 2020

Oh, yes, I have no idea how did I miss this. Very Very sorry about this. Yes, you are correct. self. needs to be added there

@ppriyank ppriyank closed this as completed Jul 1, 2020
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