Created
March 18, 2020 09:31
-
-
Save frenzy2106/9324e22229de7dbaa8e7ea7611fd3ba1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Building & Compiling the model | |
vocab_size = len(tokenizer.word_index) + 1 | |
max_length = 25 | |
model = keras.Sequential() | |
model.add(keras.layers.Embedding(input_dim=vocab_size,output_dim=50,input_length=max_length)) | |
model.add(keras.layers.LSTM(units=50,dropout=0.2,recurrent_dropout=0.2)) | |
model.add(keras.layers.Dense(units=1, activation='sigmoid')) | |
# compile the model | |
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['acc']) | |
# summarize the model | |
print(model.summary()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment