Captum

Click to visit website
About
Captum is an open-source model interpretability library built on PyTorch, designed to help users understand the predictions of their AI models. It supports interpretability across various modalities, including vision and text, and integrates seamlessly with most PyTorch models with minimal modifications. Captum offers a generic and extensible framework for interpretability research, making it easy to implement and benchmark new algorithms. It provides a range of attribution methods to explain how important each input value is to a particular output scalar value, aiding in debugging and improving model understanding.
Platform
Features
• built on pytorch
• multi-modal support
• extensible for research
FAQs
How do I set the target parameter to an attribution method?
Target selects a scalar output value. For 2D output (N x classes), pass an integer (0,1,2) or tensor ([0,1,0,0]). For >2D, pass a tuple of indices (2,3,2) or a list of tuples.
I am facing Out-Of-Memory (OOM) errors when using Captum. How do I resolve this?
Reduce `n_steps` or use `internal_batch_size` for methods with this arg. For perturbation methods, reduce `perturbations_per_eval`. For others, try smaller input batch sizes.
I am using a perturbation based method, and attributions are taking too long to compute. How can I speed it up?
Increase `perturbations_per_eval` if memory allows. You can also use PyTorch's `DataParallel` or `DistributedDataParallel` if multiple GPUs are available to speed up computations.
Are SmoothGrad or VarGrad supported in Captum?
Yes, SmoothGrad and VarGrad are supported through `NoiseTunnel` in Captum. This functionality can be used with any attribution algorithm available within the Captum library.
How do I use Captum with BERT models?
Captum provides a dedicated tutorial demonstrating the usage of Integrated Gradients specifically for BERT models. Refer to the documentation's "Bert SQUAD Interpret" tutorial for details.
My model inputs or outputs token indices, and when using Captum I see errors relating to gradients, how do I resolve this?
Replace embedding layer with `InterpretableEmbedding` or use `LayerIntegratedGradients` for input token indices. For output token indices, attribute with respect to token score/probability.
Can my model use functional non-linearities (E.g. nn.functional.ReLU) or can reused modules be used with Captum?
Most methods work, but DeepLift-based/Guided Backprop/Deconvolution require `torch.nn.ReLU` modules, not functional ones, and don't reuse modules to avoid issues with multipliers.
Do JIT models, DataParallel models, or DistributedDataParallel models work with Captum?
Yes, all are supported. JIT models do not support hooks, so layer/neuron attribution, DeepLift, Guided Backprop, and Deconvolution are not supported with JIT models.
I am working on a new interpretability or attribution method and would like to add it to Captum. How do I proceed?
Captum offers an "Awesome List" for external projects and considers new algorithms for its `contrib` package. Proposals are reviewed case-by-case based on publication, evaluation, etc.
How can I resolve cudnn RNN backward error for RNN or LSTM network?
To resolve "cudnn RNN backward can only be called in training mode" in eval mode for RNN/LSTM, set `torch.backends.cudnn.enabled=False`. CuDNN doesn't support gradient computation in eval mode.
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!
Alternatives
Interpretable AI
Interpretable AI is a suite of software modules providing comprehensive tools for interpretable machine learning, including optimal trees, imputation, and feature selection.
View DetailsFeatured Tools
GirlfriendGPT
NSFW AI chat platform with customizable characters, AI image generation, and voice chat. Explore roleplay and intimate interactions with AI companions.
View DetailsPDF Translator
PDF Translator is an AI-powered tool for instant document translations. Upload PDFs, select from 100+ languages, and get format-preserving translations for free.
View DetailsDeVoice
DeVoice is an AI-powered audio and video tool that offers unlimited, accurate transcription, AI rap generation, and background noise removal capabilities.
View DetailsDeepSwapAI
DeepSwapAI is a professional AI face swap platform for developers, offering enterprise-grade face exchange technology with RESTful API, SDKs, and batch processing.
View DetailsFace Swap AI
Face Swap AI is a free AI tool for instant face swapping in photos and videos, delivering stunning HD results without signup or watermarks for creative projects.
View DetailsStoryShort
StoryShort is an AI creation tool that helps you create viral faceless videos on auto-pilot, generating engaging content in minutes.
View DetailsAIhumanize
AIhumanize is an advanced AI humanizer tool that transforms AI-written text into natural, authentic writing, helping you bypass all major AI detectors.
View DetailsLoveGen AI
LoveGen AI is an all-in-one platform integrating major image and video AI models, enabling creation from text, visual enhancement, and video generation.
View DetailsCapacity
Capacity is an AI tool that helps you turn any idea into a working web app, including fullstack applications and cloned websites, without writing code.
View DetailsNano Banana Pro
Nano Banana Pro is a reasoning-first 4K AI image editor designed for creative teams to generate lossless 4K visuals, transparent PNGs, and high-quality exports.
View DetailsImageTranslator
ImageTranslator is an AI-powered online tool that translates text in images instantly, supporting over 100 languages while preserving original layout.
View DetailsSeedance 2
Seedance 2 is a groundbreaking AI video generation technology that delivers 1080p cinematic quality with advanced motion synthesis and multi-shot storytelling.
View DetailsKissGen AI
KissGen AI is the best AI kissing video generator, transforming memories into lifelike kissing videos with realistic animations and custom styles.
View DetailsGempix2 AI
Gempix2 AI is a free online AI photo and image editor, powered by NanoBanana 2 technology, offering advanced tools for professional-quality visual transformations.
View DetailsAI Animate Image
AI Animate Image revolutionizes how you create animated content from static images. Our advanced AI image animator turns photos into animation with stunning realism.
View Details