From e7652959af0af2a184190f943040bef3dfd76f79 Mon Sep 17 00:00:00 2001 From: Newnius Date: Sat, 2 May 2020 10:27:40 +0800 Subject: [PATCH] update --- .idea/workspace.xml | 2 +- train.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b724b92..1025693 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -225,7 +225,7 @@ - + diff --git a/train.py b/train.py index a05c6e4..7696112 100644 --- a/train.py +++ b/train.py @@ -100,12 +100,10 @@ def experiment(repeats, series, seed): for r in range(repeats): # fit the model batch_size = 4 - t = train.shape[0] % batch_size - train = train[train.shape[0] - t * batch_size:] - t = test.shape[0] % batch_size - test = test[test.shape[0] - t * batch_size:] + t1 = train.shape[0] % batch_size + t2 = test.shape[0] % batch_size - train_trimmed = train_scaled[2:, :] + train_trimmed = train_scaled[train_scaled.shape[0] - t1 * batch_size:, :] lstm_model = fit_lstm(train_trimmed, batch_size, 30, 4) # forecast the entire training dataset to build up state for forecasting if seed: