-
-
Save sid321axn/6576b7f2e7ca04c7bb894ef67f207f87 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
print('Building model...') | |
# create an LSTM network with a single LSTM | |
input_ = Input(shape=(MAX_SEQUENCE_LENGTH,)) | |
x = embedding_layer(input_) | |
# x = LSTM(15, return_sequences=True)(x) | |
x = Bidirectional(LSTM(15, return_sequences=True))(x) | |
x = GlobalMaxPool1D()(x) | |
output = Dense(1, activation="sigmoid")(x) | |
model = Model(input_, output) | |
model.compile( | |
loss='binary_crossentropy', | |
optimizer=Adam(lr=0.01), | |
metrics=['accuracy'] | |
) | |
model.summary() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment