ai-agent

pytorch_influence_functions: Reveal Why Models Predict

A Python library for founders building AI products who need to trace predictions back to training data, using the ICML‑2017 influence‑function method.

From the repo · “This is a PyTorch reimplementation of Influence Functions from the ICML2017 best paper: Understanding Black-box Predictions via Influence Functions by Pang Wei Koh and Percy Liang.”

348 stars74 forksPythonGuide quality 9/10 · reviewed Oct 10Updated 10/29/2023100% free · open source
What it does

Pytorch_influence_functions helps startup founders understand and analyze the predictions made by their deep learning models by identifying the most influential training data points

When to use it
  • •When you need to debug and understand why your model is making certain predictions
  • •When you want to identify biases in your training data and their impact on model predictions
  • •When you need to explain model decisions to stakeholders or customers
Ready-to-paste prompt
python examples/influence_functions_example.py --dataset cifar10 --model resnet18 --num_samples 100
Heads up: Make sure you have PyTorch installed and the version is compatible with the pytorch_influence_functions library, as it requires PyTorch 1.9 or later
Saves to your device
Use with Claude
New

Skip the builder — one click puts this in Claude, Cursor, Antigravity and more.

✅ Light setup

Installs with a command or two; your AI agent can do it for you.

Try it instantly — no install
Claude Code
mkdir -p ~/.claude/skills/pytorch-influence-functions && curl -fsSL https://workflowstacks.com/api/skills/pytorch-influence-functions/claude-skill -o ~/.claude/skills/pytorch-influence-functions/SKILL.md
Open in another AI app

Opens the app with this repo with the prompt ready to go — no copy-paste needed.

Connect the whole catalog (MCP)
claude mcp add --transport http workflowstacks https://workflowstacks.com/api/mcp

Adds a WorkflowStacks connector to Claude Code: search and load any skill here by chatting.

How pytorch_influence_functions: Reveal Why Models Predict works
Codeflow
Free to inspect

Pytorch_influence_functions: Reveal Why Models Predict is a small Python project (~1k lines across 7 code files). Setup is light: installs like a normal app. Reading the code is optional. Last commit 36 months ago, Other license, has a test suite.

Size
Small codebase
~1k lines · 7 code files · 8 min skim
Setup
One-command install
Installs like a normal app. Reading the code is optional.
Runs on
Python
No API keys detected
Python 100%
Where to start reading
  1. 1
    README.md
    Start here — what it does and how to install it
  2. 2
    pytorch_influence_functions/__init__.py
    Inside pytorch_influence_functions/ — the main logic begins here
  3. 3
    examples/test_influence_functions.py
    A worked example — copy this to get going
What's in each folder
pytorch_influence_functions/Core code — the actual logic4 files
examples/Examples you can copy2 files
figs/Folder3 files
READMEHas testsThin docsNo CIExamples includedOther licenseLast update 36 mo ago
Quick Actions
Details
Creator
nimarb
Language
Python
Category
ai-agent
Published
11/30/2019

Are you the creator of this tool? and earn 85% of every sale.

Show it off in your README:

Featured on WorkflowStacks
[![Featured on WorkflowStacks](https://workflowstacks.com/api/badge/pytorch-influence-functions.svg)](https://workflowstacks.com/skills/pytorch-influence-functions?utm_source=github&utm_medium=badge)
🔥 Hot this week, in your inbox
Skills like this, every Monday.

The five fastest-growing open-source AI skills, ranked by GitHub star growth. One email a week, unsubscribe anytime.