keisen / tf-keras-vis

Neural network visualization toolkit for tf.keras
https://keisen.github.io/tf-keras-vis-docs/
MIT License
311 stars 45 forks source link

GradCAM can't return non-interpolated cam values #8

Closed keisen closed 4 years ago

keisen commented 4 years ago

It could be useful in some very specific cases to return the grad-CAM vectors before they undergo the interpolation step (Line 68 of gradcam.py).

Originally posted by @pir127 in https://github.com/keisen/tf-keras-vis/issues/4#issuecomment-624139157

keisen commented 4 years ago

We add expand_cam argument to Gradcam#call(). When the variable is False, GradCAM return non-interpolated cam values.

gradcam = Gradcam(model)
non_interpolated_cam = gradcam(loss, seed_input, expand_cam=False)

The change above will implement by PR #16 .