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

Initialize GradCAM mask summation with zeros. #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nalinimsingh
Copy link

From my read of the GradCAM paper, this matrix should be initialized with zeroes, so that cam contains only the weighted sum of the entries in outputs. Feel free to correct me here if I'm misinterpreting anything!

[This doesn't affect the qualitative trend you see across the image in any of the generated GradCAM masks, since this is a constant shift at each pixel, but it does slightly perturb some of the numeric values.]

From my read of the GradCAM paper, this matrix should be initialized with zeroes, so that cam contains only the weighted sum of the entries in outputs. Feel free to correct me here if I'm misinterpreting anything!

[This doesn't affect the qualitative trend you see across the image in any of the generated GradCAM masks, since this is a constant shift at each pixel, but it does slightly perturb some of the numeric values.]
@potocpav
Copy link

For VGG it doesn't matter, but for my network, this change was necessary to get meaningful results. It is indeed the correct approach.

@nalinimsingh
Copy link
Author

@jacobgil Friendly ping -- are you able to review this?

@habibrostami
Copy link

I have a model with excellent accuracy an Roc but heat map generated by using grad cam is not reasonable? I used a architecture contains dome conv and batch normalizatio.
Thank you

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

Successfully merging this pull request may close these issues.

None yet

3 participants