Last active
August 7, 2019 02:51
-
-
Save mohdsanadzakirizvi/e26fddbe34b12371ea9adeeeb118a884 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
# define model | |
model = Sequential() | |
model.add(Embedding(vocab, 50, input_length=30, trainable=True)) | |
model.add(GRU(150, recurrent_dropout=0.1, dropout=0.1)) | |
model.add(Dense(vocab, activation='softmax')) | |
print(model.summary()) | |
# compile the model | |
model.compile(loss='categorical_crossentropy', metrics=['acc'], optimizer='adam') | |
# fit the model | |
model.fit(X_tr, y_tr, epochs=100, verbose=2, validation_data=(X_val, y_val)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment