All Projects → ArrasL → Lrp_for_lstm

ArrasL / Lrp_for_lstm

Licence: other
Layer-wise Relevance Propagation (LRP) for LSTMs

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Lrp for lstm

mmn
Moore Machine Networks (MMN): Learning Finite-State Representations of Recurrent Policy Networks
Stars: ✭ 39 (-74.34%)
Mutual labels:  recurrent-neural-networks, interpretability
Arc Pytorch
The first public PyTorch implementation of Attentive Recurrent Comparators
Stars: ✭ 147 (-3.29%)
Mutual labels:  recurrent-neural-networks
Brainforge
A Neural Networking library based on NumPy only
Stars: ✭ 114 (-25%)
Mutual labels:  recurrent-neural-networks
Deep Learning With Pytorch Tutorials
深度学习与PyTorch入门实战视频教程 配套源代码和PPT
Stars: ✭ 1,986 (+1206.58%)
Mutual labels:  recurrent-neural-networks
Rnn From Scratch
Use tensorflow's tf.scan to build vanilla, GRU and LSTM RNNs
Stars: ✭ 123 (-19.08%)
Mutual labels:  recurrent-neural-networks
Document Classifier Lstm
A bidirectional LSTM with attention for multiclass/multilabel text classification.
Stars: ✭ 136 (-10.53%)
Mutual labels:  recurrent-neural-networks
Rnn Text Classification Tf
Tensorflow Implementation of Recurrent Neural Network (Vanilla, LSTM, GRU) for Text Classification
Stars: ✭ 114 (-25%)
Mutual labels:  recurrent-neural-networks
Stellargraph
StellarGraph - Machine Learning on Graphs
Stars: ✭ 2,235 (+1370.39%)
Mutual labels:  interpretability
Awesome Fairness In Ai
A curated list of awesome Fairness in AI resources
Stars: ✭ 144 (-5.26%)
Mutual labels:  interpretability
Image Caption Generator
A neural network to generate captions for an image using CNN and RNN with BEAM Search.
Stars: ✭ 126 (-17.11%)
Mutual labels:  recurrent-neural-networks
Deep Lyrics
Lyrics Generator aka Character-level Language Modeling with Multi-layer LSTM Recurrent Neural Network
Stars: ✭ 127 (-16.45%)
Mutual labels:  recurrent-neural-networks
Deepecg
ECG classification programs based on ML/DL methods
Stars: ✭ 124 (-18.42%)
Mutual labels:  recurrent-neural-networks
Crypto Rnn
Learning the Enigma with Recurrent Neural Networks
Stars: ✭ 139 (-8.55%)
Mutual labels:  recurrent-neural-networks
Linear Attention Recurrent Neural Network
A recurrent attention module consisting of an LSTM cell which can query its own past cell states by the means of windowed multi-head attention. The formulas are derived from the BN-LSTM and the Transformer Network. The LARNN cell with attention can be easily used inside a loop on the cell state, just like any other RNN. (LARNN)
Stars: ✭ 119 (-21.71%)
Mutual labels:  recurrent-neural-networks
Speech Recognition Neural Network
This is the end-to-end Speech Recognition neural network, deployed in Keras. This was my final project for Artificial Intelligence Nanodegree @Udacity.
Stars: ✭ 148 (-2.63%)
Mutual labels:  recurrent-neural-networks
Skiprnn 2017 Telecombcn
Skip RNN: Learning to Skip State Updates in Recurrent Neural Networks (ICLR 2018)
Stars: ✭ 114 (-25%)
Mutual labels:  recurrent-neural-networks
Rcnn Text Classification
Tensorflow Implementation of "Recurrent Convolutional Neural Network for Text Classification" (AAAI 2015)
Stars: ✭ 127 (-16.45%)
Mutual labels:  recurrent-neural-networks
Stockprediction
Plain Stock Close-Price Prediction via Graves LSTM RNNs
Stars: ✭ 134 (-11.84%)
Mutual labels:  recurrent-neural-networks
Tfvos
Semi-Supervised Video Object Segmentation (VOS) with Tensorflow. Includes implementation of *MaskRNN: Instance Level Video Object Segmentation (NIPS 2017)* as part of the NIPS Paper Implementation Challenge.
Stars: ✭ 151 (-0.66%)
Mutual labels:  recurrent-neural-networks
Stock Price Predictor
This project seeks to utilize Deep Learning models, Long-Short Term Memory (LSTM) Neural Network algorithm, to predict stock prices.
Stars: ✭ 146 (-3.95%)
Mutual labels:  recurrent-neural-networks

Description

This repository provides a reference implementation of Layer-wise Relevance Propagation (LRP) for LSTMs, as initially proposed in the paper Explaining Recurrent Neural Network Predictions in Sentiment Analysis, L. Arras, G. Montavon, K.-R. Müller and W. Samek [email protected]'2017 [arXiv:1706.07206].

Additionally it includes an implementation of Sensitivity Analysis (SA) and Gradient x Input (GI), i.e. of gradient-based relevances.

Note that our implementation is generic and can be easily extended to unidirectional LSTMs, or to other application domains than Natural Language Processing.

A few hints on how to apply and extend the code to your needs can be found here.

Dependencies

Python>=3.5 + Numpy + Matplotlib, or alternatively, simply install Anaconda.

Using conda, you can e.g. create a Python 3.6 environment: conda create -n py36 python=3.6 anaconda

Then activate it with: source activate py36

Before being able to use the code, you might need to run in the terminal: export PYTHONPATH=$PYTHONPATH:$pwd

Usage

The folder model/ contains a word-based bidirectional LSTM model, that was trained for five-class sentiment prediction of phrases and sentences on the Stanford Sentiment Treebank (SST) dataset, as released by the authors in Visualizing and Understanding Neural Models in NLP, J. Li, X. Chen, E. Hovy and D. Jurafsky, 2016

The folder data/ contains the test set sentences of the Stanford Sentiment Treebank (SST), preprocessed by lowercasing, as was done in Visualizing and Understanding Neural Models in NLP, J. Li, X. Chen, E. Hovy and D. Jurafsky, 2016

The notebook run_example.ipynb provides a usage example of the code, its performs LRP, SA and GI on a test sentence.
(To correctly render the notebook on GitHub you can copy the notebook's URL to nbviewer)

Follow-up works

Publications

Here are some follow-up works using LRP on various recurrent neural network models and tasks (non-exhaustive list):

[1] Evaluating Neural Network Explanation Methods using Hybrid Documents and Morphosyntactic Agreement, N. Poerner, H. Schütze and B. Roth, ACL 2018 [arXiv:1801.06422] [code]

[2] Explaining Therapy Predictions with Layer-Wise Relevance Propagation in Neural Networks, Y. Yang, V. Tresp, M. Wunderle and P.A. Fasching, IEEE ICHI 2018 [preprint] [code]

[3] Analyzing Neuroimaging Data Through Recurrent Deep Learning Models, A.W. Thomas, H.R. Heekeren, K.-R. Müller and W. Samek, Frontiers in Neuroscience 2019 [blog]

[4] Evaluating Recurrent Neural Network Explanations, L. Arras, A. Osman, K.-R. Müller and W. Samek, [email protected] 2019 [arXiv:1904.11829] [oral presentation slides]

[5] Explaining and Interpreting LSTMs, L. Arras, J. Arjona-Medina, M. Widrich, G. Montavon, M. Gillhofer, K.-R. Müller, S. Hochreiter and W. Samek, Explainable AI: Interpreting, Explaining and Visualizing Deep Learning, Springer LNCS vol 11700 2019 [arXiv:1909.12114]

[6] Evaluating Explanation Methods for Deep Learning in Security, A. Warnecke, D. Arp, C. Wressnegger and K. Rieck, IEEE European Symposium on Security and Privacy 2020 [arXiv:1906.02108] [code_main] [code_lrp]

Software

LRP for LSTMs self-contained implementation in Tensorflow 2.1 (allowing efficient batch and GPU processing) by Alexander Warnecke: github repository

Acknowledgments

Visualizing and Understanding Neural Models in NLP, J. Li, X. Chen, E. Hovy and D. Jurafsky, code

Visualizing and Understanding Neural Models in NLP, J. Li, X. Chen, E. Hovy and D. Jurafsky, NAACL 2016

Long Short Term Memory Units, repo by W. Zaremba

Stanford Sentiment Treebank (SST), dataset by R. Socher et al., 2013

Citation

If you find this project useful, please cite our original paper (or one of our follow-up publications see above [4,5]):

@INPROCEEDINGS{arras2017,
    title     = {{Explaining Recurrent Neural Network Predictions in Sentiment Analysis}},
    author    = {Leila Arras and Gr{\'e}goire Montavon and Klaus-Robert M{\"u}ller and Wojciech Samek},
    booktitle = {Proceedings of the EMNLP 2017 Workshop on Computational Approaches to Subjectivity, Sentiment and Social Media Analysis},
    year      = {2017},
    pages     = {159-168},
    publisher = {Association for Computational Linguistics},
    doi       = {10.18653/v1/W17-5221},
    url       = {https://www.aclweb.org/anthology/W17-5221}
}

More information

For other research and projects involving LRP, you can visit the website heatmapping.org

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].