Captum

Click to visit website
About
Captum is a PyTorch library for model interpretability. It provides algorithms and tools to understand and attribute the predictions of PyTorch models. It supports various modalities including vision and text, and is built to be extensible for interpretability research. Key features include support for multi-modal models, PyTorch integration, and an open-source, generic library design.
Platform
Task
Features
• built on pytorch
• multi-modal support
• extensible
FAQs
How do I set the target parameter to an attribution method?
The purpose of target is to select a single (scalar) value for each example in the output of your model to compute attributions based on the given target parameter.
I am facing Out-Of-Memory (OOM) errors when using Captum. How do I resolve this?
To address this issue, you can either reduce n_steps, which may lead to lower-quality approximations, or use the internal_batch_size argument, which allows dividing the expanded input into batches.
I am using a perturbation based method, and attributions are taking too long to compute. How can I speed it up?
To enable this, simply set the perturbations_per_eval argument to the desired value. If you have multiple GPUs machines available, you can also wrap your model with DataParallel.
Are SmoothGrad or VarGrad supported in Captum?
Yes! SmoothGrad and VarGrad are available through NoiseTunnel in Captum, which can be used with any attribution algorithm in Captum. More details on Noise Tunnel can be found in the documentation.
How do I use Captum with BERT models?
We have a tutorial demonstrating usage of Integrated Gradients on BERT. For NLP models that take token indices as inputs, we cannot take gradients with respect to indices.
My model inputs or outputs token indices, and when using Captum I see errors relating to gradients, how do I resolve this?
To apply gradient-based attribution methods, it is necessary to replace the embedding layer with an InterpretableEmbedding layer or use LayerIntegratedGradients to compute attribution with respect to the embedding output.
Can my model use functional non-linearities (E.g. nn.functional.ReLU) or can reused modules be used with Captum?
Most methods will work fine with functional non-linearities and arbitrary operations. Some methods, which require placing hooks during back-propagation, will not work appropriately.
Do JIT models, DataParallel models, or DistributedDataParallel models work with Captum?
Yes, we have support for all these model types. Note that JIT models do not yet support hooks, so any methods using hooks including layer and neuron attribution methods are not supported.
I am working on a new interpretability or attribution method and would like to add it to Captum. How do I proceed?
New attribution algorithms that fit the structure of Captum can be considered for contribution to the contrib package of algorithms in Captum.
How can I resolve cudnn RNN backward error for RNN or LSTM network?
To resolve the issue you can set`torch.backends.cudnn.enabled` flag to False.
Job Opportunities
There are currently no job postings for this AI tool.
Ratings & Reviews
No ratings available yet. Be the first to rate this tool!
Featured Tools
Songmeaning
AI tool uncovering stories and meaning behind song lyrics. Offers lyric translation and AI music generation.
View DetailsGitGab
Connect your Github repos to ChatGPT & Claude for code assistance, bug finding, and documentation. Free trial available.
View Details
Fully Booked AI
Fully Booked AI is an all-in-one solution designed specifically for salons and med spas, offering AI-powered marketing automation, lead generation, and streamlined communication.
View DetailsMake-A-Craft
Make-A-Craft helps you discover craft ideas tailored to your child's age and interests, using materials you already have at home.
View Details
GIF Face Swap
Free online tool to swap faces in GIFs. Upload your GIF and a target face to create fun, shareable images. No registration or limits.
View DetailsUnAI My Text
UnAI My Text transforms AI content into natural, human-like text, bypassing AI detection. It's easy to use, fast, and free, offering unlimited usage and multi-language support to make AI-generated text sound more human.
View Details
All Voice Lab
All Voice Lab provides AI-powered audio solutions, including text-to-speech, voice cloning, and voice changing. It helps creators and businesses reach global audiences with realistic and expressive voices.
View Details
AI Eraser
AI-powered tool to erase elements from portrait photos with custom and HD results. Upload, select a plan, and erase.
View Details
Smart Cookie Trivia
A trivia website with questions in multiple categories. Play now and expand your knowledge!
View DetailsVerisquad
Verisquad is an AI-powered multi-agent system for comprehensive claim verification, leveraging coordinated AI agents and evidence-based fact-checking to provide accurate veracity ratings.
View Details