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

Training an ESN for times series with multiple value for each time frame? #28

Closed
ZiangXue opened this issue Nov 11, 2021 · 7 comments
Closed
Assignees
Labels
question Further information is requested

Comments

@ZiangXue
Copy link

Hi, we are trying to build and ESN with reservoirpy to perform time series prediction. Unlike most task, each time frame contains 4 values (representing coordinates), so our training data will be in shape (n, t, 4) where n is the number of unique time series, t the number of time frames.

How should I make reservoirpy.ESN learn this data?

@nTrouvain nTrouvain self-assigned this Nov 15, 2021
@nTrouvain nTrouvain added the question Further information is requested label Nov 15, 2021
@nTrouvain
Copy link
Collaborator

Hello,
If I understand well your task, you have n multivariate timeseries composed of 4 variables, am I right ?
You can use reservoirpy in this case. Just make sure that you create a Win matrix with an input dimension of 4, using the generate_input_weights function. Some of the tutorials provided in this repository, like the notebook "Introduction to Reservoir Computing", give examples of this use case, making prediction on the Lorenz timeseries. The Lorenz timeseries is of shape (1, t, 3).

@nTrouvain
Copy link
Collaborator

nTrouvain commented Nov 18, 2021

Closing this issue as the problem seems to be solved.

@ZiangXue
Copy link
Author

Thank you! About the training function, I have multiple training sequences of different length, so putting them in a list using the train method would raise an error. If I use a for loop to train it for num_sequences iteration, will it overwrite the previous states? or is it ok to do so?

@nTrouvain
Copy link
Collaborator

Well, it should not raise an error, what version of reserviorpy are you using ? And what is the error you encounter ? Would it be possible for you to provide a code example with the error ?

@nTrouvain nTrouvain reopened this Nov 19, 2021
@ZiangXue
Copy link
Author

Sorry I replied late. I've identified the error and it was not what I thought it was, so all solved on that.

However, we have observed that the more data we trained the ESN upon, the worse the generation outcomes are. Also, the ESN seem to output something far off the target.

Our dataset contains only Cartesian coordinates normalized to the range [-1, 1], but the ESN output spans [-15, 20], which is clearly off. Any possible idea of why that is?

Our projects rely heavily on reservoirpy, so I'd like to thank you for all the help you offer.

@nTrouvain
Copy link
Collaborator

Hello,
The question you ask is deeply related to your task and your data. Some hyperparameter tuning is probably necessary, especially to find an optimal value for the spectral radius, the leak rate and the ridge parameter. This way you will probably solve the problem of output outliers, and maybe the generation performance problem. You can see the related notebook in the examples folder of the v0.2.4 version of reservoirpy to find a tutorial on optimization of hyperparameters using hyperopt.

@nTrouvain
Copy link
Collaborator

Closing this issue again as the problem seems to be solved.

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

No branches or pull requests

2 participants