First, offer the users the possibility to choose what fits best for them.
Second, doing some research on a problem I'm working on my private studies, GradCAM without guided grads shows better results than with the original guided grads.
To exemplify how GradCAM performs better without guided grads, see this Colab
where the dataset Beans is used for image classification.
With Guided GradCAM the heatmap is messy (third heatmap)
However with GradCAM without guided gradients the heatmap looks better
The current GradCAM implementation uses guided grads to generate the heatmaps.
The purpose of this PR is to offer the option to apply the GradCAM according to the equation (11) from the paper Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization, thus using the raw gradients instead of the guided grads. This would be done by the parameter
use_guided_grads
Why such feature?
First, offer the users the possibility to choose what fits best for them.
Second, doing some research on a problem I'm working on my private studies, GradCAM without guided grads shows better results than with the original guided grads.
To exemplify how GradCAM performs better without guided grads, see this Colab where the dataset Beans is used for image classification.
With Guided GradCAM the heatmap is messy (third heatmap)
However with GradCAM without guided gradients the heatmap looks better