Skip to content

Instantly share code, notes, and snippets.

@adamoudad
Last active March 21, 2021 13:10
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 adamoudad/cd7d45311badd96f99d6486a184a5f54 to your computer and use it in GitHub Desktop.
Save adamoudad/cd7d45311badd96f99d6486a184a5f54 to your computer and use it in GitHub Desktop.
from tensorflow.keras.layers import Bidirectional, LSTM, Dense, Embedding
from tensorflow.keras.models import Sequential
model = Sequential([
Embedding(input_dim, embedding_dim),
Bidirectional(LSTM(hidden_dim, return_sequences=True)),
Bidirectional(LSTM(hidden_dim)),
Dense(1, activation="sigmoid")
])
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=["accuracy"])
model.summary()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment