Created
September 15, 2017 06:41
-
-
Save rohit-gupta/74da302ef43de24ae21b852974229367 to your computer and use it in GitHub Desktop.
Implementing Seq2Seq in Keras with State Transfer and Teacher Forcing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.models import Model | |
from keras.layers import Input, LSTM, Dense, TimeDistributed | |
inputs = Input(batch_shape=(8,16,1024)) | |
layer = LSTM(256, return_state=True, return_sequences=True) | |
outputs = layer(inputs) | |
# TODO Add Teacher Forcing | |
output, state = outputs[0], outputs[1:] | |
output = LSTM(256)(output, initial_state=state) | |
model = Model(inputs, output) | |
model.summary() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment