jcwleo / PyTorch-Batch-Seq2seq

PyTorch implementation of batched GRU encoder and decoder.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyTorch-Batch-Seq2seq

This is a for batched sequence-to-sequence (seq2seq) models implemented in PyTorch modified from offical pytorch tutorial. It uses batched GRU encoder and GRU decoder(no attention). This code presents task on string reverse and initialize embedding layer with one-hot encoding. It works well and achieves about 70% accuracy after 200 epochs.

Usage:

  • python seq2seq_translation_tutorial.py

Please refer to offical pytorch tutorial on "Translation with a Sequence to Sequence Network and Attention"
PyTorch version mechanism illustration, see here:
http://pytorch.org/tutorials/_images/decoder-network.png
PyTorch offical Seq2seq machine translation tutorial:
http://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html

About

PyTorch implementation of batched GRU encoder and decoder.


Languages

Language:Python 100.0%