Created
October 20, 2021 08:44
-
-
Save mvivarelli/11ead87de00ae1b8b9269b6694f6e3c1 to your computer and use it in GitHub Desktop.
Turbofan Engine stateful LSTM model
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
#model | |
model = Sequential() | |
#input | |
model.add(LSTM(units=50, return_sequences=True, activation='tanh', batch_size=batch_size, stateful=True, input_shape = (x_train_final.shape[1], x_train_final.shape[2]))) | |
model.add(Dropout(0.2)) | |
#hidden layer 1 | |
model.add(LSTM(units=60, return_sequences=True, activation='tanh', stateful=True)) | |
model.add(Dropout(0.2)) | |
#hidden layer 2 | |
model.add(LSTM(units=60, return_sequences=True, activation='tanh', stateful=True)) | |
model.add(Dropout(0.2)) | |
#output | |
model.add(Dense(units=3,activation='softmax')) | |
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment