This repository contains the implementation code of HYDRA: Hypergradient Data Relevance Analysis for Interpreting Deep Neural Networks.
HYDRA is a method of neural network interpretability that assesses the contribution of training data. You can play this demo to get a feel for its power.
Linux and Windows should work for recent versions of PyTorch.
PyTorch >= 2.1
A C++20 compiler
Here it's assumed that pip is used as the package manager.
- Install PyTorch
pip3 install torch --user
- Install a PyTorch extension for storing tensors.
git clone --recursive [email protected]:cyyever/torch_cpp_extension.git
cd torch_cpp_extension
mkdir build && cd build
cmake -DBUILD_SHARED_LIBS=on -DBUILD_TESTING=off ..
cmake --build . --config release
cd ..
env cmake_build_dir=build python3 setup.py install --user
- Install the dependent libraries.
pip3 install -r requirements.txt --user
If you find our work useful, please cite it:
@article{chen2021hydra,
title={Hydra: Hypergradient data relevance analysis for interpreting deep neural networks},
author={Chen, Yuanyuan and Li, Boyang and Yu, Han and Wu, Pengcheng and Miao, Chunyan},
journal={arXiv preprint arXiv:2102.02515},
year={2021}
}