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

Integrated Gradients and Embedding layer #37

Open
gladomat opened this issue Sep 23, 2020 · 1 comment
Open

Integrated Gradients and Embedding layer #37

gladomat opened this issue Sep 23, 2020 · 1 comment

Comments

@gladomat
Copy link

I would like to calculate feature importances using integrated gradients, as I am hoping this calculation will be faster than the SHAP KernelExplainer. Unfortunately, the embeddding layer is non-differentiable, since it's a simple matrix multiplication. This causes a failure in the gradient calculation.

I also tried embedding the categorical variables separately and then feeding the full data into the model. Theoretically, this procedure avoids calculating the gradients for the embedding layer because there is none present. However, when every variable is numeric the preprocesser discards all variables which are 0 from top to bottom. This is not what I want, as I want to train in batches.

I have two questions:

  1. Is there a way to calculate integrated gradients with embedding layers?
  2. How can I stop the deeptables pre-processor to discard variables which have non-unique (all zeros) values?

Thanks!

jackguagua added a commit that referenced this issue Sep 24, 2020
@jackguagua
Copy link
Member

  • Is there a way to calculate integrated gradients with embedding layers?
    Very promising idea, looking forward to your progress.
  • How can I stop the deeptables pre-processor to discard variables which have non-unique (all zeros) values?
    Now you can try to set auto_discard_unique=False in ModelConfig which should solve the problem.

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

2 participants