Last active
January 12, 2020 05:27
-
-
Save kumar-abhishek/e730e407bf469d4b8215c3b3d5d91280 to your computer and use it in GitHub Desktop.
SimpleRNN
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
from keras.layers import Dense, SimpleRNN | |
model_rnn = Sequential() | |
model_rnn.add(TimeDistributed(Dense(128), input_shape=(None, n_features))) | |
model_rnn.add(SimpleRNN(100, input_shape=[None, n_features], return_sequences=True )) | |
model_rnn.add(SimpleRNN(100)) | |
model_rnn.add(Dense(n_features, activation='softmax')) | |
model_rnn.compile(optimizer='adam', loss='categorical_crossentropy') | |
model_rnn.fit_generator(generator, epochs=500, validation_data=validation_generator) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment