utkuozbulak / pytorch-cnn-visualizations

Pytorch implementation of convolutional neural network visualization techniques
MIT License
7.81k stars 1.49k forks source link

Gam-Cam Accumulator #81

Closed richardtml closed 4 years ago

richardtml commented 4 years ago

Hi, thank you for the implementations.

There is a line (81) in Gram-Cam I suspect incorrectly amplifies the intensities of the cam map:

cam = np.ones(target.shape[1:], dtype=np.float32)

According to the paper there's no sum +1, so this change the appearance in the final maps. I think the accumulator should be zero:

cam = np.zeros(target.shape[1:], dtype=np.float32)

Is this correct?

Thank you!

utkuozbulak commented 4 years ago

Hey,

You can have a look at a relevant discussion here: #11.

richardtml commented 4 years ago

Interesting, thank you!