Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to predict multiple steps ahead #56

Open
wilbertmatthew opened this issue May 28, 2024 · 2 comments
Open

how to predict multiple steps ahead #56

wilbertmatthew opened this issue May 28, 2024 · 2 comments

Comments

@wilbertmatthew
Copy link

I am using PyRCN version PyRCN-0.0.17 and the mackeyglass example. I would like to know how to modify the example to predict multiple steps ahead instead of 1 step ahead as it currently does.

Thanks

Wilbert Jackson

@renierts
Copy link
Collaborator

renierts commented May 28, 2024

Hi Wilbert,

Thank you for this question. Currently, this is not supported natively. However, I am working on a better implementation based on PyTorch, which makes it easier to do tasks like this.

For now, the easiest way would be to predict one step, append the output to the input and then predict the next step with this modified input. This can be done in a simple loop. Does this help you for now?

@wilbertmatthew
Copy link
Author

Thanks Peter for your quick response.
Is there any code available for your new design? I tried your suggestion for multi step prediction as follows:

stepsahead = 10
for i in range(stepsahead):
y_test_pred = esn.predict(X_test)

append the last prediction value to the X_test array

X_test = np.concatenate((X_test., y_test_pred[-1:])
y_test_pred = esn.predict(X_test)

Is this the right idea? The multiple calls to the incremental_regression function makes for an very slow prediction process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants