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

About the code before softmax in CAM_Module #12

Closed
kaneyxx opened this issue Apr 24, 2020 · 2 comments
Closed

About the code before softmax in CAM_Module #12

kaneyxx opened this issue Apr 24, 2020 · 2 comments

Comments

@kaneyxx
Copy link

kaneyxx commented Apr 24, 2020

Hi, thanks for sharing this awesome project :)

Here's a question while reading your source code. In CAM_Module, there is one line code before softmax function. It doesn't exist in PAM_Module. According to my understanding, it means you use the maximum value (which calculated by query dot key) each channel vector to minus every value respectively. But...it will be the larger number equals the more irrelevant channel, right?
Sorry... I cannot understand this, could you kindly explain it for me? Thanks a lot!

CAM_Module

@josedolz
Copy link
Collaborator

josedolz commented May 1, 2020

Hi @kaneyxx

This is added to prevent loss divergence during training. The CAM module is borrowed from DANet. Our understanding from that line is that it will enforce to pay more attention to more dissimilar channels.

Best

@kaneyxx
Copy link
Author

kaneyxx commented May 3, 2020

It makes sense for me, and I will go for DANet paper after this. Thank you!

@kaneyxx kaneyxx closed this as completed May 3, 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