Skip to content

Reproduction of Figure 2 from paper Understanding Black-box Predictions via Influence Functions

Notifications You must be signed in to change notification settings

Huining-Wang/influence-function-reproduction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

influence-function-reproduction

This repository contains a PyTorch implementation reproducing Figure 2 (Linear Approximation vs. Actual Loss Change) from the paper Understanding Black-box Predictions via Influence Functions (Koh & Liang, 2017).

Implementation Details

  • Method: Primitive PyTorch implementation (Calculated gradients and Hessian-Vector Products using autograd).
  • Optimizer: L-BFGS .
  • Hessian Inverse: LiSSA .
  • Dataset: Binary MNIST.

Files

  • figure2_linear_approx.py: Main script to run the experiment and generate the plot.
  • influence_functions.py: Core implementation of gradient and HVP calculations.

Results

The reproduction demonstrates a near-perfect linear correlation between the predicted influence and the actual loss change.

How to Run

  1. Install dependencies:
    pip install torch torchvision numpy matplotlib tqdm
  2. Run the reproduction script:
    python figure2_linear_approx.py

About

Reproduction of Figure 2 from paper Understanding Black-box Predictions via Influence Functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages