PyTorch library for model interpretability across modalities.
What is Captum?
Captum is a PyTorch library designed for enhancing the interpretability of models. It provides tools and techniques that enable users to understand and attribute the predictions made by PyTorch models, covering various types of data—including visual and textual information. Captum is compatible with most PyTorch models and makes it easy to implement and benchmark new algorithms aimed at improving model interpretability.
How to use Captum?
Install Captum usingconda or pip. Import the necessary libraries, such as numpy, torch, and IntegratedGradients from captum.attr. Define and prepare your PyTorch model. Instantiate an explainable algorithm (such as IntegratedGradients). Apply the algorithm to your input data and baseline to obtain attribution results and convergence increments.
The core functions of Captum
Support for multimodal explainability
Based on PyTorch
Scalable and open-source