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

Shape error of a tensor #5

Closed Kajiyu closed 3 years ago

Kajiyu commented 5 years ago

Traceback (most recent call last): File "switch_attractor_esn.py", line 81, in esn(inputs, targets) File "/Users/YumaKajihara/.pyenv/versions/anaconda3-2.5.0/lib/python3.5/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(*input, *kwargs) File "/Users/YumaKajihara/research/ikeg/code/EchoTorch/examples/switch_attractor/echotorch/nn/ESN.py", line 164, in forward hidden_states = self.esn_cell(u, y) File "/Users/YumaKajihara/.pyenv/versions/anaconda3-2.5.0/lib/python3.5/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(input, **kwargs) File "/Users/YumaKajihara/research/ikeg/code/EchoTorch/examples/switch_attractor/echotorch/nn/LiESNCell.py", line 102, in forward y_wfdb = self.w_fdb.mv(yt) RuntimeError: mv: Expected 1-D argument vec, but got 0-D

Kajiyu commented 5 years ago

This is one solution: y_wfdb = self.w_fdb.mv(yt.view(-1))