totti0223 / gradcamplusplus

keras implementation of gradcam_plus_plus
40 stars 16 forks source link

third = K.exp(y_c)*grads*grads #1

Closed Max-ChenFei closed 3 years ago

Max-ChenFei commented 5 years ago

I learned a lot from your project. Thanks a lot. I have a question about the formula line 47 in gradcamutils.py Is it should be : *third = K.exp(y_c)gradsgradsgrads**

totti0223 commented 5 years ago

whoops! great! you found a typo in my program. will modify them. thx for your feed back.

p.s. the current program with the "third" same as the second still generates a meaningful map. curios how much does it affect against the output.

to be modified as third = K.exp(y_c)gradsgrads*grads

Max-ChenFei commented 5 years ago

By the way, I will set K.learning_phase = 0 (for test) if the models contain dropout and batchNorm layers. because during the inference, we should ensure that the Dropout becomes the Identity layer rather than random layer. we still see Dropout but should behave like an Identity function.

totti0223 commented 5 years ago

thx for pointing it out. i just used it for VGG16 from keras.application that do have any dropout or batchnorms. your suggestion makes it more general for other models. would be great if you can do a pull request for the two above.

Max-ChenFei commented 5 years ago

Thanks a lot.