Skip to content

Instantly share code, notes, and snippets.

@lukovkin
Last active August 16, 2016 21:12
Show Gist options
  • Save lukovkin/0563d42224a6529fea38 to your computer and use it in GitHub Desktop.
Save lukovkin/0563d42224a6529fea38 to your computer and use it in GitHub Desktop.
steps_ahead = 5 # how much steps ahead to predict
dim = 1 # dimension of the input series
X_multi = X # copy input sequence to the separate variable in order not to add garbage to the original sequence
for i in range(0, steps_ahead):
predicted = model_train_dict['model'].predict(X_multi, batch_size=batch_size)
X_multi = np.append(X_multi, np.reshape(predicted[-1:], (1, 1, dim)), axis=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment