DeepTables icon indicating copy to clipboard operation
DeepTables copied to clipboard

Integrated Gradients and Embedding layer

Open gladomat opened this issue 3 years ago • 1 comments

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!

gladomat avatar Sep 23 '20 10:09 gladomat

  • 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.

jackguagua avatar Sep 24 '20 02:09 jackguagua