Skip to content

Instantly share code, notes, and snippets.

@mgrzeszczak
mgrzeszczak / seq2seq.py
Created March 28, 2018 06:44 — forked from higepon/seq2seq.py
Minimum Seq2Seq implementation using Tensorflow 1.4/1.5 API
import numpy as np
import tensorflow as tf
from tensorflow.python.layers import core as layers_core
hparams = tf.contrib.training.HParams(
batch_size=3,
encoder_length=4,
decoder_length=5,
num_units=6,
src_vocab_size=7,
@mgrzeszczak
mgrzeszczak / seq2seq.py
Created March 26, 2018 20:04 — forked from ilblackdragon/seq2seq.py
Example of Seq2Seq with Attention using all the latest APIs
import logging
import numpy as np
import tensorflow as tf
from tensorflow.contrib import layers
GO_TOKEN = 0
END_TOKEN = 1
UNK_TOKEN = 2