LSTMCell icon indicating copy to clipboard operation
LSTMCell copied to clipboard

Implement modern LSTM cell by tensorflow and test them by language modeling task for PTB. Highway State Gating, Hypernets, Recurrent Highway, Attention, Layer norm, Recurrent dropout, Variational drop...

Modern LSTM (RNN) Cell

dep1 license

Tensorflow implementations of recently proposed LSTM (RNN) cells. As testing cells, language modeling over Penn Tree Bank, which was downloaded via PTB dataset from Tomas Mikolov's webpage, is conducted.

Available cells:

Each cell utilizes following regularization:

The usage is the same as usual LSTM cell of tensorflow.

TODO

  • [ ] Neural architecture search
  • [ ] minimal RNN
  • [ ] char language model
  • [ ] Layer normalization dose not improve performance. Fix it.

How to use

git clone https://github.com/asahi417/LSTMCell
cd LSTMCell
pip install -r requirements.txt
wget http://www.fit.vutbr.cz/~imikolov/rnnlm/simple-examples.tgz
tar xvzf simple-examples.tgz

train language model

One can train language model by an arbitrary cell:

python train.py -m [lstm type]

    [lstm type]: lstm, rhn, hypernets, kvp, hsg

The large sized model of Zaremba, Wojciech, Ilya Sutskever, and Oriol Vinyals. "Recurrent neural network regularization." arXiv preprint arXiv:1409.2329 (2014) is employed as baseline model.

Other

  • This code is supported by python 3 and tensorflow 1.3.0.