keras-nlp icon indicating copy to clipboard operation
keras-nlp copied to clipboard

Integrated gradients for nlp models. (Explainable AI)

Open innat opened this issue 3 years ago • 4 comments

Describe feature The Integrated Gradients (IG) can be a great tool to understand the neural network.

How API will change? It would enhance as follows:


from keras_nlp.utils.visualization import IntegratedGradients as IG 

ig  = IG (model, layer=layer, ...)

Candidate Solution

  • ALIBI-Explain: It's a toolbox that provides many solutions, including IG in TensorFlow 2 (Keras).

Demo o/p:

ig.explain(sample)

image

innat avatar Apr 07 '22 12:04 innat

Definitely, it would be great to start adding explainability tools here! I was actually just wishing we had precisely this while working on a guide for keras-nlp.

Would you be interested in contributing?

Also, trying to understand the design proposed more...

  • IG is it's own non-layer class?
  • What assumptions are being made about the model parameter passed in? If any.

mattdangerw avatar Apr 07 '22 16:04 mattdangerw

Hey, @innat! Are you still working on this? If not, I'd like to work on this. Thanks! :)

abheesht17 avatar Jun 29 '22 02:06 abheesht17

@abheesht17 I'm not working on it. Please, take action if you want.

innat avatar Jun 29 '22 07:06 innat

Thanks, @innat! @mattdangerw, I can take this up (if we want this layer) :)

abheesht17 avatar Jun 29 '22 13:06 abheesht17