Last active
March 21, 2021 13:10
-
-
Save adamoudad/cd7d45311badd96f99d6486a184a5f54 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
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