All Projects → AuCson → Pytorch Batch Attention Seq2seq

AuCson / Pytorch Batch Attention Seq2seq

PyTorch implementation of batched bi-RNN encoder and attention-decoder.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pytorch Batch Attention Seq2seq

Sockeye
Sequence-to-sequence framework with a focus on Neural Machine Translation based on Apache MXNet
Stars: ✭ 990 (+304.08%)
Mutual labels:  seq2seq, attention-model
Text summarization with tensorflow
Implementation of a seq2seq model for summarization of textual data. Demonstrated on amazon reviews, github issues and news articles.
Stars: ✭ 226 (-7.76%)
Mutual labels:  seq2seq
Snli Entailment
attention model for entailment on SNLI corpus implemented in Tensorflow and Keras
Stars: ✭ 181 (-26.12%)
Mutual labels:  attention-model
Screenshot To Code
A neural network that transforms a design mock-up into a static website.
Stars: ✭ 13,561 (+5435.1%)
Mutual labels:  seq2seq
Kospeech
Open-Source Toolkit for End-to-End Korean Automatic Speech Recognition.
Stars: ✭ 190 (-22.45%)
Mutual labels:  seq2seq
Headliner
🏖 Easy training and deployment of seq2seq models.
Stars: ✭ 221 (-9.8%)
Mutual labels:  seq2seq
Tensorflow Tutorials
텐서플로우를 기초부터 응용까지 단계별로 연습할 수 있는 소스 코드를 제공합니다
Stars: ✭ 2,096 (+755.51%)
Mutual labels:  seq2seq
Mead Baseline
Deep-Learning Model Exploration and Development for NLP
Stars: ✭ 238 (-2.86%)
Mutual labels:  seq2seq
Nlp Tools
😋本项目旨在通过Tensorflow基于BiLSTM+CRF实现中文分词、词性标注、命名实体识别(NER)。
Stars: ✭ 225 (-8.16%)
Mutual labels:  seq2seq
Keras Attention Mechanism
Attention mechanism Implementation for Keras.
Stars: ✭ 2,504 (+922.04%)
Mutual labels:  attention-model
Pytorch Beam Search Decoding
PyTorch implementation of beam search decoding for seq2seq models
Stars: ✭ 204 (-16.73%)
Mutual labels:  seq2seq
Lingvo
Lingvo
Stars: ✭ 2,361 (+863.67%)
Mutual labels:  seq2seq
Natural Language Processing With Tensorflow
Natural Language Processing with TensorFlow, published by Packt
Stars: ✭ 222 (-9.39%)
Mutual labels:  seq2seq
Deep Time Series Prediction
Seq2Seq, Bert, Transformer, WaveNet for time series prediction.
Stars: ✭ 183 (-25.31%)
Mutual labels:  seq2seq
Nlp made easy
Explains nlp building blocks in a simple manner.
Stars: ✭ 232 (-5.31%)
Mutual labels:  seq2seq
Tgen
Statistical NLG for spoken dialogue systems
Stars: ✭ 179 (-26.94%)
Mutual labels:  seq2seq
Speech emotion recognition blstm
Bidirectional LSTM network for speech emotion recognition.
Stars: ✭ 203 (-17.14%)
Mutual labels:  attention-model
Generative inpainting
DeepFill v1/v2 with Contextual Attention and Gated Convolution, CVPR 2018, and ICCV 2019 Oral
Stars: ✭ 2,659 (+985.31%)
Mutual labels:  attention-model
Tensorflow Shakespeare
Neural machine translation between the writings of Shakespeare and modern English using TensorFlow
Stars: ✭ 244 (-0.41%)
Mutual labels:  seq2seq
Debug seq2seq
[unmaintained] Make seq2seq for keras work
Stars: ✭ 233 (-4.9%)
Mutual labels:  seq2seq

A fast, batched Bi-RNN(GRU) encoder & attention decoder implementation in PyTorch

This code is written in PyTorch 0.2. By the time the PyTorch has released their 1.0 version, there are plenty of outstanding seq2seq learning packages built on PyTorch, such as OpenNMT, AllenNLP and etc. You can learn from their source code.

Usage: Please refer to offical pytorch tutorial on attention-RNN machine translation, except that this implementation handles batched inputs, and that it implements a slightly different attention mechanism.
To find out the formula-level difference of implementation, illustrations below will help a lot.

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
Bahdanau attention illustration, see here:
http://images2015.cnblogs.com/blog/670089/201610/670089-20161012111504671-910168246.png

PyTorch version attention decoder fed "word_embedding" to compute attention weights, while in the origin paper it is supposed to be "encoder_outputs". In this repository, we implemented the origin attention decoder according to the paper

Update: dynamic encoder added and does not require inputs to be sorted by length in a batch.


Speed up with batched tensor manipulation

PyTorch supports element-wise fetching and assigning tensor values during procedure, but actually it is slow especially when running on GPU. In a tutorial(https://github.com/spro/practical-pytorch), attention values are assigned element-wise; it's absolutely correct(and intuitive from formulas in paper), but slow on our GPU. Thus, we re-implemented a real batched tensor manipulating version, and it achieves more than 10X speed improvement.

This code works well on personal projects.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].