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

issue on unashable csr matrix nb "Introduction_to_RC" #36

Closed
AlArths opened this issue Dec 1, 2021 · 2 comments
Closed

issue on unashable csr matrix nb "Introduction_to_RC" #36

AlArths opened this issue Dec 1, 2021 · 2 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@AlArths
Copy link
Contributor

AlArths commented Dec 1, 2021

Hi,
we are using the "Introduction_to_RC". However we encounter this issue :
"TypeError Traceback (most recent call last)
in
6 proba=density, seed=seed)
7
----> 8 reservoir = ESN(leak_rate, W, Win, ridge=regularization)

~\anaconda3\lib\site-packages\reservoirpy\nodes\esn.py in init(self, reservoir_method, learning_method, reservoir, readout, feedback, Win_bias, Wout_bias, workers, backend, name, **kwargs)
107
108 if readout is None:
--> 109 if learning_method not in _LEARNING_METHODS:
110 raise ValueError(msg.format(learning_method, "readout",
111 list(_LEARNING_METHODS.keys())))

TypeError: unhashable type: 'csr_matrix' "

For the cell :
"Win = mat_gen.generate_input_weights(units, 1, input_scaling=input_scaling,
proba=input_connectivity, input_bias=True,
seed=seed)

W = mat_gen.generate_internal_weights(units, sr=spectral_radius,
proba=density, seed=seed)

reservoir = ESN(leak_rate, W, Win, ridge=regularization)"

We are using Python 3.8.8.

HELP

Regards

@nTrouvain
Copy link
Collaborator

Hello, thank you very much for your report ! Does the error still happens if you use keywords arguments ?
Also, what version of ReservoirPy are you using ?

reservoir = ESN(lr=leak_rate, W=W, Win=Win, ridge=regularization)

@nTrouvain nTrouvain self-assigned this Dec 2, 2021
@nTrouvain nTrouvain added the bug Something isn't working label Dec 2, 2021
@nTrouvain nTrouvain added this to Issues in v0.3 via automation Dec 2, 2021
@c006
Copy link

c006 commented Jan 18, 2022

That worked for me.

Windows 10
JupyterLab : Version 3.2.1
ReservoirPy : version 0.3.0

File
reservoirpy/examples/Introduction to Reservoir Computing/Introduction_to_RC.ipynb

def reset_esn():
    Win = mat_gen.generate_input_weights(
        units,
        1,
        input_scaling=input_scaling,
        proba=input_connectivity,
        input_bias=True,
        seed=seed,
    )

    W = mat_gen.generate_internal_weights(
        units, sr=spectral_radius, proba=density, seed=seed
    )

    reservoir = ESN(lr=leak_rate, W=W, Win=Win, ridge=regularization)
    # reservoir = ESN(leak_rate, W, Win, ridge=regularization)

    return reservoir

@nTrouvain nTrouvain moved this from Issues to In progress in v0.3 Jan 20, 2022
@nTrouvain nTrouvain moved this from In progress to Done in v0.3 Feb 3, 2022
@nTrouvain nTrouvain moved this from Done to Done (previous release) in v0.3 Mar 25, 2022
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
v0.3
Done (previous release)
Development

No branches or pull requests

3 participants