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

Hi,question about sliced-up version self-attention #28

Open
Faith-Uchiha opened this issue May 23, 2022 · 1 comment
Open

Hi,question about sliced-up version self-attention #28

Faith-Uchiha opened this issue May 23, 2022 · 1 comment

Comments

@Faith-Uchiha
Copy link

in the blog you says there is a more efficient way of implementation? see lecture at the top. Do you mean the youtube vide at the top?

but there is no code explaination in the video , do i have to watch the video and implement myself or any blogs about the more efficient way of self attention?

thanks a lot!

@pbloem
Copy link
Owner

pbloem commented May 23, 2022

This refers to slide 25-26 in this lectures: https://dlvu.github.io/slides/dlvu.lecture12.pdf Slide 25 shows the basic idea of multi-head self attention, and 26 shows how to implement it efficiently.

This is implemented in the default self-attention here:

class SelfAttention(nn.Module):

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