question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Class correctness in gradcam.py

See original GitHub issue

There is a line in gradcam.py which says that if target_class = None then the target_class takes the argmax of the ouptut. Is it possible that the actual class might be different from the expected class?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
utkuozbulakcommented, Aug 26, 2020

Please read the code. If the target_class is not provided, it is taken from the prediction. When the target_class is provided, what comes out of the prediction is not used. So, there is no case when the user provides a class (e.g., 5) and the target_class magically changes to 44.

0reactions
AND2797commented, Aug 26, 2020

Thanks for the clarification.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Grad-CAM: Visualize class activation maps with Keras, ...
Learn how to visualize class activation maps for debugging deep neural networks using Grad-CAM. We'll then implement Grad-CAM using Keras ...
Read more >
Understand your Algorithm with Grad-CAM | by Daniel Reiff
We'll show you how to improve accuracy and precision over the existing literature ... Gradient-weighted Class Activation Mapping (Grad-CAM), ...
Read more >
Visualisation of CNN using Grad-Cam on PyTorch
class GradCam ():. """ Produces class activation map. """ def __init__(self, model, target_layer):. self.model = model. self.model.eval(). # Define extractor.
Read more >
A Review of Different Interpretation Methods (Part 1: Saliency ...
In order to get the Grad-CAM of a given image and a class of interest, we can take a quite similar approach to...
Read more >
Explaining Keras image classifier predictions with Grad-CAM
If we have a model that takes in an image as its input, and outputs class ... This has been tested with Python...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found