← Back

AI & ML · 2023

Seq2Seq Translator

GRU encoder-decoder translation model with teacher forcing, compared across Adam, AdamW, RMSprop, and SGD.

Source code ↗

Outcome
A GRU encoder-decoder trained with teacher forcing and compared across four optimizers, translating 50% of held-out sentences correctly.
Stack
PyTorch
Status
Research
Architecture
GRU encoder-decoder
Training
Teacher forcing, L2 regularization
Data
7,000 train / 1,000 test pairs

Overview

A sequence-to-sequence translation model in PyTorch with a GRU encoder and a unidirectional GRU decoder trained with teacher forcing. The dataset is 8,000 eight-word sentence pairs (7,000 for training, 1,000 for testing) in which each word is a single token, so the vocabulary can be swapped for any language pair. Training compared Adam, AdamW, RMSprop, and SGD with L2 regularization, and the model translates 50% of test sentences correctly.