Created
June 27, 2018 19:36
-
-
Save ravishchawla/f5f9664fcaba64a590af6fe4b5c7e554 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
model = Sequential(); | |
model.add(Embedding(len(word_dict), max_cap, input_length=max_cap)); | |
model.add(LSTM(60, return_sequences=True, recurrent_dropout=0.5)); | |
model.add(Dropout(0.5)) | |
model.add(LSTM(60, recurrent_dropout=0.5)); | |
model.add(Dense(60, activation='relu')); | |
model.add(Dense(2, activation='softmax')); | |
print(model.summary()); | |
optimizer = Adam(lr=0.01, decay=0.001); | |
model.compile(loss='binary_crossentropy', optimizer=optimizer, metrics=['accuracy']) | |
# fit model | |
model.fit(X_train, Y_train, batch_size=64, epochs=10, validation_data=(X_dev, Y_dev)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment