Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exact gradient values #222

Open
jhtu opened this issue Apr 30, 2020 · 0 comments
Open

Exact gradient values #222

jhtu opened this issue Apr 30, 2020 · 0 comments

Comments

@jhtu
Copy link

jhtu commented Apr 30, 2020

When computing saliency maps (and likely also GradCAMs), the returned gradients are always normalized to the range (0, 1). Since this is an affine transformation, there is no way to reproduce the exact values of the gradients, since the information about zero values is lost. For instance, we may wish to compare the true gradient values to know which pixels in an image increase a class score versus decrease it, and the relative magnitude of those things. Right now, we can get the negative values and the positive values separately, but I don't think we can actually infer the relative magnitudes.

I think this would likely be an easy fix. Perhaps you could add a boolean keyword argument for normalizing the data or not prior to output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant