Code for AAAI 2018 accepted paper: "Beyond Sparsity: Tree Regularization of Deep Models for Interpretability"
Switch branches/tags
Nothing to show
Clone or download

NumPy Autograd Implementation

This repository includes a toy signal-and-noise HMM dataset and a basic implementation of the Tree-regularized GRU model in NumPy Autograd. Please find the ArXiv copy here:

For more on NumPy Autograd, see


Create a new conda environment and activate it.

conda create -n interpret python=2
source activate interpret

Install the necessary libraries.

pip install -r requirements.txt


First, generate the toy dataset. This will create a directory ./data and populate it with Pickle files.


Then, you can train the tree-regularized GRU. This will create a directory ./trained_models and dump the trained model and a PDF of the final decision tree. You can set the regularization strength as a command line argument. apl stands for average path length.

python --strength 1000.0

We can apply the trained model on a held-out test set. This will print out AUC statistics.


Please reach out with any concerns or potential bugs.