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

energy_new in CAM #9

Closed
eugenelawrence opened this issue Sep 18, 2018 · 5 comments
Closed

energy_new in CAM #9

eugenelawrence opened this issue Sep 18, 2018 · 5 comments

Comments

@eugenelawrence
Copy link

Hi @junfu1115 ,
why do you use the energy_new in attention.py?
Correct me if I miss something.

@junfu1115
Copy link
Owner

Prevent loss divergence during training

@weix-liu
Copy link

To prevent overflow or underflow, it should be x - max(x), rather than max(x) - x

@HanzhiC
Copy link

HanzhiC commented Mar 21, 2021

Yes. I am also wondering why using max(x) - x, seems that your correlation will favor the most different channel information instead the most similar one

@kamiLight
Copy link

Yes. I am also wondering why using max(x) - x, seems that your correlation will favor the most different channel information instead the most similar one

i have the same opinion with you, using max(x) - x will give bigger weights to the feature with less similarity after performing softmax

@carolo44
Copy link

carolo44 commented Sep 3, 2021

Yes. I am also wondering why using max(x) - x, seems that your correlation will favor the most different channel information instead the most similar one

I think it should be x - max(x) and actually this operation is also redundant, pytorch itself has done it already.

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

6 participants