nschaetti / EchoTorch

A Python toolkit for Reservoir Computing and Echo State Network experimentation based on pyTorch. EchoTorch is the only Python module available to easily create Deep Reservoir Computing models.
https://nschaetti.github.io/echotorch.github.io/
GNU General Public License v3.0
441 stars 117 forks source link

How to use an ESN with output feedbacks ? #3

Closed amerlot closed 6 years ago

amerlot commented 6 years ago

Hi, and first of all, thanks for the awesome work :)

The issue I have is the following : I did succeed in training an ESN and using it to make predictions without feedback weights. But, when I add the parameter feedbacks=True when creating the ESN, I get an error from the following line of ESN.py:

hidden_states = self.esn_cell(u, w_out=self.w_out)

because:

AttributeError: 'ESN' object has no attribute 'w_out'

Then, I thought I had to change this line to:

hidden_states = self.esn_cell(u, w_out=self.output.w_out)

But I get another error from ESNCell.py from the line yt = w_out.mv(self.hidden) because:

RuntimeError: size mismatch, [6 x 1], [5] at /pytorch/aten/src/TH/generic/THTensorMath.c:1928

Any idea ?

nschaetti commented 6 years ago

Hi!

Thank you for your interest in EchoTorch!

I checked in the code, the problem was that I worked a lot on the LiESN and forgot to apply some changes regarding feedbacks to the ESN. I should work now, I also added an example in the "generation" directory.

I implemented feedbacks few months ago for some quick experiments so it is very experimental. Let me now if you have any new issues.

Regards,

Nils

amerlot commented 6 years ago

Hi! Thanks for the fix, no more error on my side!

I now need to get to understand how to use it well :)