Created
July 31, 2020 05:07
-
-
Save wezleysherman/58d3f8f748883f51f97c0a6d4d31b089 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
D = 512 | |
#Simple RNN | |
T = train_X.shape[1] | |
i = Input(shape=(T,)) | |
x = Embedding(V, D)(i) | |
x = Dropout(0.2)(x) | |
x = SimpleRNN(150)(x) | |
x = Dense(V, activation="softmax")(x) | |
rnn_model = Model(i, x) | |
rnn_model.summary() | |
adam = tf.keras.optimizers.Adam(learning_rate=0.001) | |
rnn_model.compile(optimizer=adam, metrics=["accuracy"], loss="categorical_crossentropy") | |
rnn_r = rnn_model.fit(train_X, train_y, epochs=50) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment