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

External_attention in the code is strange, only do attention on channel, but no attention on pixel. #4

Closed
zanonShao opened this issue May 9, 2021 · 2 comments

Comments

@zanonShao
Copy link

Hello Menhao,
I have some question about the difference between code and paper.
In the paper, 'Equation (5) is the similarity between the i-th pixel and the j-th rows of M', external attention do the attention between pixels, however in the code I think Conv1d only can do the attention amount only one pixels’ channels, and pixels in F not do attention with pixels in M.
And in the paper 'In fact, we find that a small _S_, e.g. 64, works well in experiments.' but in the code d is setted to 64 instead of S.

@YouJiacheng
Copy link

M is a set of "pattern" feature vectors (#vector = S), not feature vectors of pixels.
Conv1d.weight can be viewed as M, #out channel = S, # in channel = d.
Therefore the result of Conv1d will be the dot product between feature vectors of pixels and M's rows(shape of M = S × d = out × in, out channels ↔ rows).
k in code = S in paper, c in code = d in paper.
等一下,为什么你要用英文提问,作者也是中国人啊。

@zanonShao
Copy link
Author

ok, I get it.
谢谢你还先用英文回答🤣

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