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

Can not train reservoir network using multiple trials #686

Open
YNCris opened this issue Sep 17, 2024 · 1 comment
Open

Can not train reservoir network using multiple trials #686

YNCris opened this issue Sep 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@YNCris
Copy link

YNCris commented Sep 17, 2024

Hello!

I have multiple trials and the shape is [1950,48](time, feature). I read the comments of function 'fit' and organize my data into a tensor [442,1950,48]. The XTrain and YTrain are the same shape. And I define the reservoir network using:

model = RCN(
    num_in=48,
    leaky_rate=0.1,
    in_connectivity=0.1,
    num_hidden=900, 
    rec_connectivity=0.1,
    num_out=48)

And I use the offline trainer:

dt = 0.1
trainer = bp.OfflineTrainer(model, \
                            fit_method=bp.algorithms.RidgeRegression(1e-7), \
                                dt=dt)

_ = trainer.fit([bm.asarray(XTrain),
                  bm.asarray(YTrain)])

It shows the error:
Scanned function carry input and carry output must have equal types (e.g. shapes and dtypes of arrays), but they differ:

  • the input carry component i[1899226277072] has type float64[1,900] but the corresponding output carry component has type float64[442,900], so the shapes do not match

Revise the scanned function so that all output types (e.g. shapes and dtypes) match the corresponding input types.

But when I only use 1 data [1,1950,48] to train the model, it works. How can I train the network using multiple trials?

@YNCris YNCris added the bug Something isn't working label Sep 17, 2024
@Routhleck
Copy link
Collaborator

@ztqakita

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants