THIS REPO IS NO LONGER MAINTAINED. FOR A MORE STRUCTURED CODEBASE, VISIT simple-nmt, IMPLEMENTED IN PYTORCH, which is very similar to Chainer.
The toy task is learning to reverse a string (i.e. given input "abcde", output "edcba"). Implemented models are:
- Vanilla multi-layer LSTM RNN model.
- Vanilla encoder-decoder model.
- Global-attentional encoder-decoder model (Vinyals et al.)
To run the code, please install Chainer and CuDNN first. Then evoke
$ python main.py
To run with different modes, modify
main.py. Some notable variables are:
- DEVICE: the code is set to run on CPU (DEVICE = -1), set DEVICE = 0 to run on single GPU.
- LARGE: size of the data set.
- ATTEND: whether to use attention or not.
If there are any problems, email me at email@example.com