This repository contains neural language model implementations trained and tested on Penn Treebank.
- Multi-layer LSTM with Dropout: The link to the notebook is here. It receives perplexity around 80.6 on test set on default parameters.
- Gated Convolutional Networks with Residual Connections: The link to the notebook is here. It receives perplexity around 70.9 on test set on default parameters.
GCNN trains a lot faster than LSTM, due to stacked convolutions performaing parallely. However, this implementation is currently done for fixed word lengths. I am still unclear how to approach for variable lengths.
You will need Pytorch 0.4 and Python 3.5 to run this.
- For LSTM code simply run like
python3 rnn.py
- For GCNN code simply run like
python3 gcnn.py