How with Grad-CAM in my own model
yyssmm opened this issue · comments
yyssmm commented
Hi,
Thank you for sharing your work! I meet a problem when use Grad-CAM with my own model that have no FC classifier layer and no softmax layer. Would you please help me how to deal with it? Thank you very much!
Kazuto Nakashima commented
- Define the score for which you want to investigate the causality. In the original Grad-CAM, the score is arbitrary class logit before softmax is applied.
- Extract the intermediate feature maps in the forward propagation.
- Compute gradients of the score with respect to the feature maps.
- Weight the feature maps by the gradient magnitudes.