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

Some questions about 'Criss-Cross Attention' #112

Open
yiyi-today opened this issue Nov 15, 2021 · 2 comments
Open

Some questions about 'Criss-Cross Attention' #112

yiyi-today opened this issue Nov 15, 2021 · 2 comments

Comments

@yiyi-today
Copy link

** image
I have some questions about 'Criss-Cross Attention'. Here should be C×W×H or C×H×W in the place marked by the red circle?

image
At the same time, I have some questions about Affinity. Which variables corresponds to the codes in the place marked by the blue line,proj_query_H and proj_key_H , or proj_query_W and proj_key_W? I don’t understand the definition of Qu and Ωu very well. Is it convenient for you to answer? Looking forward to your answer, thank you very much!

@Asthestarsfalll
Copy link

  1. I think it's a typo, or maybe it doesn't matter.
  2. Q_u is a pixel vector in spatial position u with shape [b, c', 1, 1], so the x_q contains h*w Q_u
x_q = self.q(x) #b, c', h, w

3.\gamma_u is a set which contains the key pixel vectors in the same row and column with position u, so its shape is [b, c', h+w-1].Actually, in code they split the key set to H and W,and calculate the attention scores for h and w respectively.

@yiyi-today
Copy link
Author

  1. I think it's a typo, or maybe it doesn't matter.
  2. Q_u is a pixel vector in spatial position u with shape [b, c', 1, 1], so the x_q contains h*w Q_u
x_q = self.q(x) #b, c', h, w

3.\gamma_u is a set which contains the key pixel vectors in the same row and column with position u, so its shape is [b, c', h+w-1].Actually, in code they split the key set to H and W,and calculate the attention scores for h and w respectively.

Thank you very much for your answer.

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