-
Notifications
You must be signed in to change notification settings - Fork 512
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
Add split_channels parameter to LayerGradCam.attribute #1086
Conversation
Hi @dzenanz! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
I signed CLA. Is some manual recheck invocation required? |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
This PR is rather small and simple. Any chance someone will review, and maybe merge it? |
@vivekmig ping! |
I would still like to have this merged. |
@split_channels, do you mind adding a test case for |
captum/attr/_core/layer/grad_cam.py
Outdated
torch.sum(summed_grad * layer_eval, dim=1, keepdim=True) | ||
for summed_grad, layer_eval in zip(summed_grads, layer_evals) | ||
) | ||
if split_channels: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it is useful when relu_attributions == True
because otherwise we can also sum returned value of the attributions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split_channels
is independent of relu_attributions
. They can be applied independently.
I will add a test case, probably tomorrow. |
The first force-push does a plain rebase. |
I added a test, and it passes on my computer. Please re-review. |
The second force-push fixes linting errors. |
@NarineK has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
I can't see the details of failure for "Facebook Internal - Builds & Tests". |
This allows examination of each channel's contribution. That is useful if channels are something other than standard RGB, for example multi-spectral input, potentially with many spectral channels.
The last force push is a plain rebase on master. |
@NarineK has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This allows examination of each channel's contribution. That is useful if channels are something other than standard RGB, for example multi-spectral input, potentially with many spectral channels.