Skip to content

Instantly share code, notes, and snippets.

@lylayang
Last active March 15, 2020 07:36
Show Gist options
  • Save lylayang/971b7b14e4fe6040d8c28b9caab59ffe to your computer and use it in GitHub Desktop.
Save lylayang/971b7b14e4fe6040d8c28b9caab59ffe to your computer and use it in GitHub Desktop.
from keras.models import Sequential
from keras.layers import Dense, LSTM, Dropout
from keras.callbacks import EarlyStopping
def model_lstm(look_back):
model=Sequential()
model.add(LSTM(100, input_shape=(1, look_back), activation='relu'))
model.add(Dense(1))
model.compile(loss='mean_squared_error', optimizer='adam',metrics = ['mse', 'mae'])
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment