Home

Awesome

NeuroX Toolkit

<p align="center"> <img src="https://github.com/fdalvi/NeuroX/raw/master/docs/intro/logo.png" /> </p>

Tests Runner API Reference

NeuroX provide all the necessary tooling to perform Interpretation and Analysis of (Deep) Neural Networks centered around Probing. Specifically, the toolkit provides:

A demo using a lot of functionality provided by this toolkit is available.

demo picture

Getting Started

This toolkit requires and is tested on Python versions 3.6 and above. It may work with older Python versions with some fiddling, but is currently not tested nor supported. The easiest way to get started is to use the published pip package:

pip install neurox

Manual Installation

If you wish to install this package manually (e.g. to modify or contribute to the code base), you can clone this repository into a directory of your choice:

git clone https://github.com/fdalvi/NeuroX.git

Create and activate a new virtual environment for the toolkit (This step can be skipped if you manage your environment in other ways like Conda or System-level installations):

python -m venv .neurox-env
source .neurox-env/bin/activate

Install the dependencies required to run the toolkit:

pip install -e .

Sample Code

A Jupyter notebook with a complete example of extracting activations from BERT, training a toy task, extracting neurons and visualizing them is available in the examples directory for a quick introduction to the main functionality provided by this toolkit.

Documentation

API Reference contains an API reference for all of the functions exposed by this toolkit. Primarily, the toolkit's functionality is separated into several high-level components:

Citation

Please cite our paper published at AAAI'19 if you use this toolkit.

@article{dalvi2019neurox,
  title={NeuroX: A Toolkit for Analyzing Individual Neurons in Neural Networks},
  author={Dalvi, Fahim
    and Nortonsmith, Avery
    and Bau, D Anthony
    and Belinkov, Yonatan
    and Sajjad, Hassan
    and Durrani, Nadir
    and Glass, James},
  journal={Proceedings of the AAAI Conference on Artificial Intelligence (AAAI)},
  year={2019}
}

Planned features

Publications