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

Bugfixes to Pytorch implementation #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rfriedman22
Copy link

The implementation for PyTorchDeepExplainer no longer works. I updated the code to reflect what is in the main shap repository to bring functionality up to speed since the repo was forked.

  • Fixed the order that forward and backward hooks are registered.
  • Updated calculation of the gradient with torch.autograd.grad to account for proper indexing.
  • No longer delete attributes x and y from modules that hook to maxpool or nonlinear_1d.
  • Fix calculation of gradient input size for MaxPool1d.

I also added support for the Exp function. Pytorch does not contain a Module for this function, but I use a custom implementation of this Module in my models.

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

Successfully merging this pull request may close these issues.

1 participant