[IntegratedGradients] Pytorch models
Our IntegratedGradients method is for TensorFlow models only, for feature parity it would be desirable to extend it to PyTorch models as well.
There are a few options and some design decisions to make. The captum library has PyTorch methods for all kinds of gradient-based attribution methods. The easiest thing would be to just wrap this but it has downsides:
- dependency on
torch- foralibiwe want this to be optional - temptation to wrap all
captummethods at the cost of abandoning feature parity withtensorflow
So it likely makes sense to implement this from scratch.
This could also be an opportunity for a much larger project, designing the public and private API for all kinds of gradient-based methods not just IG, but the priority should be on getting a PyTorch IG going.
As a side note, kserve supports TorchServe which offers explainability via captum. So this issue also affects SC (v2) feature parity with kserve at this level.