← Open Source
eladhoffer

seq2seq.pytorch

Sequence-to-Sequence learning using PyTorch.

Model DevelopmentDeep Learning FrameworksPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
517
Stars
78
Forks
+-1
This week
2
Contributors
Created 2017-06-01 · Updated 2026-10-09 · #17925 today
Top developers

eladhoffer/seq2seq.pytorch is ranked 17,925 with 517 stars.

Same-category comparison

eladhoffer/seq2seq.pytorch is ranked 17,925 among these 8 peers; lucidrains/e2-tts-pytorch is ranked 17,927.

Same-category comparison
NameRankMetrics
prlz77/ResNeXt.pytorch17,902
Language:
Python
Stars:
518
Forks:
117
Description:
Reproduces ResNet-V3 with pytorch.
scallop-lang/scallop17,904
Language:
Rust
Stars:
518
Forks:
37
Description:
Framework and Language for Neurosymbolic Programming.
xingyizhou/UniDet17,911
Language:
Python
Stars:
518
Forks:
56
Description:
Object detection on multiple datasets with an automatically learned unified label space.
MycroftAI/mimic-recording-studio17,919
Language:
JavaScript
Stars:
517
Forks:
124
Description:
Mimic Recording Studio is a Docker-based application you can install to record voice samples, which can then be trained into a TTS voice with Mimic2.
lucidrains/e2-tts-pytorch17,927
Language:
Python
Stars:
517
Forks:
52
Description:
Implementation of E2-TTS, "Embarrassingly Easy Fully Non-Autoregressive Zero-Shot TTS", in Pytorch.
wherobots/GeoTorchAI17,934
Language:
Jupyter Notebook
Stars:
517
Forks:
36
Description:
GeoTorchAI: A Framework for Training and Using Spatiotemporal Deep Learning Models at Scale.
dongjing3309/minisam17,949
Language:
C++
Stars:
516
Forks:
101
Description:
A general and flexible factor graph non-linear least square optimization framework.
phamquiluan/ResidualMaskingNetwork17,955
Language:
Python
Stars:
516
Forks:
101
Description:
ICPR 2020: Facial Expression Recognition using Residual Masking Network.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModel Development
SubcategoryDeep Learning Frameworks
KeywordsTranslation
Stars517
Forks78
Contributors2
Created date2017-06-01
Updated date2026-10-09
Stars in 1 day0
Stars in 7 days-1
Rank17,925
Previous rank17,702
Rank change-223
7-day stars rank18,044
Previous 7-day stars rank17,986
7-day stars rank change-58
Total stars rank18,870
Previous total stars rank18,849
Total stars rank change-21
CountryIsrael
README summary

Seq2Seq in PyTorch This is a complete suite for training sequence-to-sequence models in PyTorch. It consists of several models and code to both train and infer using them. Using this code you can train: Neural-machine-translation (NMT) models Language models Image to caption generation Skip-thought sentence representations And more. Installation Models Models currently available: Simple Seq2Seq recurrent model Recurrent Seq2Seq with attentional decoder Google neural machine translation (GNMT) recurrent model Transformer - attention-only model from "Attention

Is All You Need" Datasets Datasets currently available: WMT16 WMT17 OpenSubtitles 2016 COCO image captions Conceptual captions All datasets can be tokenized using 3 available segmentation methods: Character based segmentation Word based segmentation Byte-pair-encoding (BPE) as suggested by bpe with selectable number of tokens. After choosing a tokenization method, a vocabulary will be generated and saved for future inference. Training methods The models can be trained using several methods: Basic Seq2Seq - given encoded sequence, generate (decode) output sequence

. Multi Seq2Seq - where several tasks (such as multiple languages) are trained simultaneously by using the data sequences as both input to the encoder and output for decoder. Image2Seq - used to train image to caption generators. Usage Example training scripts are available in scripts folder. Inference examples are available in examples folder. example for training a transformer on WMT16 according to original paper regime: example for training attentional LSTM based model with 3 layers in both encoder and decoder:

Frequently asked questions

How many stars and forks are recorded?

eladhoffer/seq2seq.pytorch has 517 stars and 78 forks.

What is the repository rank?

eladhoffer/seq2seq.pytorch is ranked 17,925.

What language and category are recorded?

eladhoffer/seq2seq.pytorch has 517 stars, uses Python and belongs to Model Development.

Which repository is closest in rank?

eladhoffer/seq2seq.pytorch is compared with lucidrains/e2-tts-pytorch, ranked 17,927 with 517 stars.

README

Seq2Seq in PyTorch

This is a complete suite for training sequence-to-sequence models in PyTorch. It consists of several models and code to both train and infer using them.

Using this code you can train:

  • Neural-machine-translation (NMT) models
  • Language models
  • Image to caption generation
  • Skip-thought sentence representations
  • And more...

Installation

git clone --recursive https://github.com/eladhoffer/seq2seq.pytorch
cd seq2seq.pytorch; python setup.py develop

Models

Models currently available:

Datasets

Datasets currently available:

All datasets can be tokenized using 3 available segmentation methods:

  • Character based segmentation
  • Word based segmentation
  • Byte-pair-encoding (BPE) as suggested by bpe with selectable number of tokens.

After choosing a tokenization method, a vocabulary will be generated and saved for future inference.

Training methods

The models can be trained using several methods:

  • Basic Seq2Seq - given encoded sequence, generate (decode) output sequence. Training is done with teacher-forcing.
  • Multi Seq2Seq - where several tasks (such as multiple languages) are trained simultaneously by using the data sequences as both input to the encoder and output for decoder.
  • Image2Seq - used to train image to caption generators.

Usage

Example training scripts are available in scripts folder. Inference examples are available in examples folder.

  • example for training a transformer on WMT16 according to original paper regime:
DATASET=${1:-"WMT16_de_en"}
DATASET_DIR=${2:-"./data/wmt16_de_en"}
OUTPUT_DIR=${3:-"./results"}

WARMUP="4000"
LR0="512**(-0.5)"

python main.py \
  --save transformer \
  --dataset ${DATASET} \
  --dataset-dir ${DATASET_DIR} \
  --results-dir ${OUTPUT_DIR} \
  --model Transformer \
  --model-config "{'num_layers': 6, 'hidden_size': 512, 'num_heads': 8, 'inner_linear': 2048}" \
  --data-config "{'moses_pretok': True, 'tokenization':'bpe', 'num_symbols':32000, 'shared_vocab':True}" \
  --b 128 \
  --max-length 100 \
  --device-ids 0 \
  --label-smoothing 0.1 \
  --trainer Seq2SeqTrainer \
  --optimization-config "[{'step_lambda':
                          \"lambda t: { \
                              'optimizer': 'Adam', \
                              'lr': ${LR0} * min(t ** -0.5, t * ${WARMUP} ** -1.5), \
                              'betas': (0.9, 0.98), 'eps':1e-9}\"
                          }]"
  • example for training attentional LSTM based model with 3 layers in both encoder and decoder:
python main.py \
  --save de_en_wmt17 \
  --dataset ${DATASET} \
  --dataset-dir ${DATASET_DIR} \
  --results-dir ${OUTPUT_DIR} \
  --model RecurrentAttentionSeq2Seq \
  --model-config "{'hidden_size': 512, 'dropout': 0.2, \
                   'tie_embedding': True, 'transfer_hidden': False, \
                   'encoder': {'num_layers': 3, 'bidirectional': True, 'num_bidirectional': 1, 'context_transform': 512}, \
                   'decoder': {'num_layers': 3, 'concat_attention': True,\
                               'attention': {'mode': 'dot_prod', 'dropout': 0, 'output_transform': True, 'output_nonlinearity': 'relu'}}}" \
  --data-config "{'moses_pretok': True, 'tokenization':'bpe', 'num_symbols':32000, 'shared_vocab':True}" \
  --b 128 \
  --max-length 80 \
  --device-ids 0 \
  --trainer Seq2SeqTrainer \
  --optimization-config "[{'epoch': 0, 'optimizer': 'Adam', 'lr': 1e-3},
                          {'epoch': 6, 'lr': 5e-4},
                          {'epoch': 8, 'lr':1e-4},
                          {'epoch': 10, 'lr': 5e-5},
                          {'epoch': 12, 'lr': 1e-5}]" \
Nearby in the ranking
Similar items