• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Using / reproducing ACD from the paper "Hierarchical interpretations for neural network predictions" 🧠 (ICLR 2019)

Hierarchical neural-net interpretations (ACD) 🧠

Produces hierarchical interpretations for a single prediction made by a pytorch neural network. Official code for Hierarchical interpretations for neural network predictions (ICLR 2019 pdf).

Documentation β€’ Demo notebooks

Note: this repo is actively maintained. For any questions please file an issue.

examples/documentation

  • installation: pip install acd (or clone and run python setup.py install)
  • examples: the reproduce_figs folder has notebooks with many demos
  • src: the acd folder contains the source for the method implementation
  • allows for different types of interpretations by changing hyperparameters (explained in examples)
  • all required data/models/code for reproducing are included in the dsets folder
Inspecting NLP sentiment models Detecting adversarial examples Analyzing imagenet models

notes on using ACD on your own data

  • the current CD implementation often works out-of-the box, especially for networks built on common layers, such as alexnet/vgg/resnet. However, if you have custom layers or layers not accessible in net.modules(), you may need to write a custom function to iterate through some layers of your network (for examples see cd.py).
  • to use baselines such build-up and occlusion, replace the pred_ims function by a function, which gets predictions from your model given a batch of examples.

related work

  • CDEP (ICML 2020 pdf, github) - penalizes CD / ACD scores during training to make models generalize better
  • TRIM (ICLR 2020 workshop pdf, github) - using simple reparameterizations, allows for calculating disentangled importances to transformations of the input (e.g. assigning importances to different frequencies)
  • PDR framework (PNAS 2019 pdf) - an overarching framewwork for guiding and framing interpretable machine learning
  • DAC (arXiv 2019 pdf, github) - finds disentangled interpretations for random forests
  • Baseline interpretability methods - the file scores/score_funcs.py also contains simple pytorch implementations of integrated gradients and the simple interpration technique gradient * input

reference

  • feel free to use/share this code openly
  • if you find this code useful for your research, please cite the following:
@inproceedings{
   singh2019hierarchical,
   title={Hierarchical interpretations for neural network predictions},
   author={Chandan Singh and W. James Murdoch and Bin Yu},
   booktitle={International Conference on Learning Representations},
   year={2019},
   url={https://openreview.net/forum?id=SkEqro0ctQ},
}

More Repositories

1

imodels

Interpretable ML package πŸ” for concise, transparent, and accurate predictive modeling (sklearn-compatible).
Jupyter Notebook
1,369
star
2

csinva.github.io

Slides, paper notes, class notes, blog posts, and research on ML πŸ“‰, statistics πŸ“Š, and AI πŸ€–.
HTML
507
star
3

imodelsX

Scikit-learn friendly library to interpret, and prompt-engineer text datasets using large language models.
Python
158
star
4

gan-vae-pretrained-pytorch

Pretrained GANs + VAEs + classifiers for MNIST/CIFAR in pytorch.
Jupyter Notebook
155
star
5

gpt-paper-title-generator

Generating paper titles (and more!) with GPT trained on data scraped from arXiv.
Jupyter Notebook
143
star
6

iprompt

Finding semantically meaningful and accurate prompts.
Jupyter Notebook
46
star
7

tree-prompt

Tree prompting: easy-to-use scikit-learn interface for improved prompting.
Jupyter Notebook
27
star
8

disentangled-attribution-curves

Using / reproducing DAC from the paper "Disentangled Attribution Curves for Interpreting Random Forests and Boosted Trees"
Python
25
star
9

matching-with-gans

Matching in GAN latent space for better bias benchmarking and semantic image editing. πŸ‘ΆπŸ»πŸ§’πŸΎπŸ‘©πŸΌβ€πŸ¦°πŸ‘±πŸ½β€β™‚οΈπŸ‘΄πŸΎ
Jupyter Notebook
20
star
10

data-viz-utils

Functions for easily making publication-quality figures with matplotlib.
Jupyter Notebook
18
star
11

mdl-complexity

MDL Complexity computations and experiments from the paper "Revisiting complexity and the bias-variance tradeoff".
Jupyter Notebook
17
star
12

interpretable-embeddings

Interpretable text embeddings by asking LLMs yes/no questions
Python
16
star
13

transformation-importance

Using / reproducing TRIM from the paper "Transformation Importance with Applications to Cosmology" 🌌 (ICLR Workshop 2020)
Jupyter Notebook
8
star
14

iai-clinical-decision-rule

Interpretable clinical decision rules for predicting intra-abdominal injury.
Jupyter Notebook
8
star
15

cookiecutter-ml-research

A logical, reasonably standardized, but flexible project structure for conducting ml research.
Jupyter Notebook
8
star
16

glaucoma-diagnosis

Code for diagnosing glaucoma from Lumos lens
Python
7
star
17

clinical-rule-analysis

Analyzing clinical decision instruments through the lens of data and large language models.
Jupyter Notebook
6
star
18

tree-prompt-experiments

Create a tree of prompts during training that improves efficiency and accuracy.
Jupyter Notebook
4
star
19

dnn-ensemble

Testing the properties of ensembled neural networks.
Jupyter Notebook
4
star
20

news-balancer

News Balancer takes a story and provides articles on that story with credibility and varying political bias. The homepage will randomly generate a story from its archives, but a user can type in a query to get stories relating to their query along with their credibility / political bias.
Python
4
star
21

tpr-fmri

Python
3
star
22

abide-multitask-learning

Multi-task learning of functional connectivity on the ABIDE dataset.
Jupyter Notebook
3
star
23

local-vae

Making locally disentangled vaes.
Jupyter Notebook
3
star
24

neural-spike-sorting

Experimental code for performing spike sorting using a neural network.
Jupyter Notebook
3
star
25

trees-to-networks

Bridging random forests and deep neural networks. Partial implementation of "Neural Random Forests" https://arxiv.org/abs/1604.07143
Jupyter Notebook
3
star
26

acronym-generator

Generator acronyms given a sequence of words (useful for making paper titles).
HTML
3
star
27

imodels-playground

Demos for visualizing how rule-based models work.
TypeScript
2
star
28

max-activation-interpretation-pytorch

Code for creating maximal activation images (like Deep Dream) in pytorch with various regularizations / losses.
Jupyter Notebook
2
star
29

hummingbird-tracking

Code for tracking various things in hummingbird video
Python
2
star
30

neuronforest-analysis-scripts

Python scripts to replace Matlab for evaluation of error in connectome images and affinity graphs.
Python
2
star
31

pyfim-clone

Clone of pyfim making it installable as a dependency. Copied from http://www.borgelt.net/pyfim.html
C
2
star
32

scattering-transform-experiments

Repository for experiments with scattering transforms
Jupyter Notebook
2
star
33

imodels-data

Preprocessed data for various popular tabular datasets to go along with imodels.
Jupyter Notebook
2
star
34

mouse-brain-decoding

Decoding images from calcium recordings using data from stringer et al. 2018.
Jupyter Notebook
2
star
35

stable-interpretation

Exploring ways to extract stable interpretations from neural networks.
Jupyter Notebook
2
star
36

dnn-experiments

A set of scripts and experiments making it easier to analyze deep learning empirically.
Jupyter Notebook
2
star
37

arxiv-copier

Extension for copying the title + url of an arXiv page via right click
JavaScript
1
star
38

news-title-bias

Scraping and analyzing political bias in news titles using data from allsides.com
HTML
1
star
39

axon-ap-propagation

Code for simulations of action potential propagation
AMPL
1
star
40

younet

Learning natural language models based on personalized messages.
Python
1
star
41

mini-games

Code for simple games made in java + google sheets.
Java
1
star
42

global-sports-analysis

Analyzing how different factors influence global sports rankings
HTML
1
star
43

pybaobab-fork

Fork of pybaobabdt adding more customization.
Jupyter Notebook
1
star