Skip to content
forked from elbayadm/attn2d

Pervasive Attention: 2D Convolutional Networks for Sequence-to-Sequence Prediction

License

Notifications You must be signed in to change notification settings

achichenin/attn2d

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pervasive Attention: 2D Convolutional Networks for Sequence-to-Sequence Prediction

This is an open source PyTorch implementation of the pervasive attention model described in:

Maha Elbayad, Laurent Besacier, and Jakob Verbeek. 2018. Pervasive Attention: 2D Convolutional Networks for Sequence-to-Sequence Prediction. In Proceedings of the 22nd Conference on Computational Natural Language Learning (CoNLL 2018)

Requirements

pytorch (tested with v0.4.1)
subword-nmt
h5py (2.7.0)
tensorboardX 

Usage:

IWSLT'14 pre-processing:

cd scripts
./prepare-iwslt14.sh
cd ..
python preprocess.py -d iwslt

Training:

mkdir -p save events
python train.py -c config/iwslt_l24.yaml

Note: in this setup the model takes up to 15G gpu memory. If you want to train the model on a smaller GPU try with the memeory-efficient implementation of the DenseNet or with a Log-DenseNet:

python train.py -c config/iwslt_l24_efficient.yaml
python train.py -c config/iwslt_l24_log.yaml

Generation & evaluation

python generate.py -c config/iwslt_l24.yaml

About

Pervasive Attention: 2D Convolutional Networks for Sequence-to-Sequence Prediction

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.3%
  • Shell 4.7%