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

Question about code of attention map smoothing #50

Open
cats-food opened this issue Apr 19, 2021 · 1 comment
Open

Question about code of attention map smoothing #50

cats-food opened this issue Apr 19, 2021 · 1 comment

Comments

@cats-food
Copy link

First of all, thanks for your great work!
I got a question when looking through your code in Attention.py, where line 39 is as follows:

conv_result = F.avg_pool2d(conv_result, 3, 1, padding = 1)*9

this corresponds to the equation (5) in your paper:
image

My question is, the 3*3 average pooling itself is capable of getting the averaged results, why multiplied by 9 is needed?

Hope to hear your reply : )

@cats-food
Copy link
Author

Also, I found another issue, in Attention.py , transposed conv. is used to reconstruct the feature map, as shown in this line:
feature_map = F.conv_transpose2d(attention_scores, conv_kernels, stride = 1, padding = self.patch_size//2)
where conv_kernels has been normalized in previous steps (conv_kernels = conv_kernels/norm_factor).
However, I think the conv_kernels here should be the original one (without normalization), could you please help me check this out, thanks! @jingyuanli001

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

1 participant