Last active
November 2, 2017 19:17
-
-
Save rasmusbergpalm/a56f14cd6a48374a69cdb90b38d25429 to your computer and use it in GitHub Desktop.
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
# Encoder | |
source = Input(shape=(None,), dtype='int32', name='source') | |
embedded = Embedding(output_dim=128, input_dim=train.source_vocab_size(), mask_zero=True)(source) | |
last_hid = LSTM(output_dim=128)(embedded) | |
# Decoder | |
repeated = RepeatVector(train.target.padded.shape[1])(last_hid) | |
decoder = LSTM(output_dim=128, return_sequences=True)(repeated) | |
output = TimeDistributed(Dense(output_dim=train.target_vocab_size(), activation='softmax'))(decoder) | |
model = Model([source], output=[output]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment