1
0
mirror of https://github.com/newnius/YAO-optimizer.git synced 2025-12-15 09:06:43 +00:00
This commit is contained in:
2020-05-02 15:00:10 +08:00
parent c55e2c0503
commit 28d2edf065
2 changed files with 22 additions and 25 deletions

View File

@@ -67,7 +67,7 @@ def fit_lstm(train, batch_size2, nb_epoch, neurons):
model = Sequential()
model.add(LSTM(neurons, batch_input_shape=(batch_size2, X.shape[1], X.shape[2]), stateful=True))
model.add(Dense(1))
model.compile(loss='mean_squared_error', optimizer='adam')
model.compile(loss='mean_squared_error', optimizer=Adam(lr=0.01))
for i in range(nb_epoch):
print("Epoch {}/{}".format(i, nb_epoch))
model.fit(X, y, epochs=1, batch_size=batch_size2, verbose=0, shuffle=False)