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
AI Image Editor
AI Image Editor is a free online tool to edit, transform, and enhance photos with a text prompt, achieving fast, consistent, high-quality results.
View DetailsSora2 AI Video Generator
Sora2 AI Video Generator is an advanced tool powered by OpenAI's Sora2 technology, creating cinema-quality 1080p videos from text and images with realistic physics and perfect character consistency.
View DetailsAnimate Image AI
Animate Image AI is a platform that allows you to create captivating animations from your photos. It uses advanced AI technology to bring your photos to life.
View DetailsImage To Image
Image To Image is a cutting-edge AI photo generator transforming images with high quality and precise prompt control, offering instant creative evolution.
View DetailsAI Make Song
AI Make Song is your ultimate AI song generator and music maker, designed to help anyone create professional-quality AI music free in minutes.
View DetailsCrePal
CrePal is the world's first AI Video Creation Agent, transforming ideas into stunning videos with cutting-edge AI models for planning, imaging, and video generation.
View DetailsYolly AI
Yolly AI is an all-in-one AI video & photo generator that lets you turn a single text prompt into cinema-grade 4K videos or high-resolution images.
View DetailsSeedance 1.5
Seedance 1.5 is a next-generation AI video creation tool transforming ideas into stunning 1080p videos with multi-shot narratives, physics-accurate motion, and cinematic quality.
View DetailsUnblur Image Online Free
Unblur Image Online Free instantly restores sharpness to blurry photos using AI. Upload JPG, PNG, or WEBP files for clear images in seconds, completely free and no sign-up needed.
View Detailsadly.news
adly.news is a free platform that simplifies newsletter advertising, connecting businesses with engaged audiences through ad slots, offering bidding, negotiation, and messaging.
View DetailsMiss Pepper AI
Miss Pepper AI is an AI-powered platform for smarter marketing, offering SEO, marketing automation, and identity resolution to drive measurable results and uncover customer insights.
View Details