Skip to content

Instantly share code, notes, and snippets.

@XavKearney
Last active February 23, 2018 20:36
Show Gist options
  • Save XavKearney/9bdc92b7dff5cb302a654d4617b8aa7e to your computer and use it in GitHub Desktop.
Save XavKearney/9bdc92b7dff5cb302a654d4617b8aa7e to your computer and use it in GitHub Desktop.
def build_model(batch_size, text_len, vocab_size):
model = Sequential()
model.add(Embedding(vocab_size, 512, batch_input_shape=(batch_size, text_len)))
for i in range(3):
model.add(LSTM(512, return_sequences=True, stateful=True))
model.add(Dropout(0.2))
model.add(TimeDistributed(Dense(vocab_size)))
model.add(Activation('softmax'))
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment