Skip to content

Instantly share code, notes, and snippets.

@prateekjoshi565
Created February 6, 2019 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prateekjoshi565/c9b71f12bbf1849ecc7f5e76d61f24a8 to your computer and use it in GitHub Desktop.
Save prateekjoshi565/c9b71f12bbf1849ecc7f5e76d61f24a8 to your computer and use it in GitHub Desktop.
Model Architecture
# build NMT model
def build_model(in_vocab,out_vocab, in_timesteps,out_timesteps,n):
model = Sequential()
model.add(Embedding(in_vocab, n, input_length=in_timesteps,
mask_zero=True))
model.add(LSTM(n))
model.add(RepeatVector(out_timesteps))
model.add(LSTM(n, return_sequences=True))
model.add(Dense(out_vocab, activation='softmax'))
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment