Coder Social home page Coder Social logo

netneurolab / conn2res Goto Github PK

View Code? Open in Web Editor NEW
75.0 5.0 19.0 10.73 MB

A reservoir computing toolbox for neuroscientists

Home Page: https://github.com/netneurolab/conn2res

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
computing neuroai python reservoir

conn2res's Introduction

Development Status: 3 - Alpha. Some features still need to be added and tested.

images/conn2res_logo.png

In a nutshell, conn2res is a reservoir computing toolbox designed for neuroscientists to train connectome-informed reservoirs to perform cognitive tasks. The main advantages of the toolbox are its flexibility in terms of the connectivity matrix used for the reservoir, the local dynamics of the nodes and the possibility to select the input and output nodes, as well as a comprehensive corpus of supervised neuroscience tasks provided by NeuroGym.

The accompanying manuscript has been uploaded to bioRxiv.

Brief primer on Reservoir Computing

Reservoir computing is a computational paradigm that essentially exploits the rich dynamics of complex dynamical systems, such as artificial recurrent neural networks (RNNs), to compute with time-varying input data (Lukoševičius, M. and Jaeger, H, 2009). The conventional reservoir computing architecture consists of an input layer, followed by the reservoir and a readout module. Typically, the reservoir is a randomly connected RNN and the readout module a linear model. In contrast to traditional RNNs, the connections of the reservoir are fixed; only the weights that connect the reservoir to the readout module are trained, which correspond to the parameters of the linear model. These weights are trained in a supervised manner to learn the representations of the external stimuli constructed by the reservoir, and can be adapted to a wide range of tasks, including speech recognition, motor learning, natural language processing, working memory and spatial navigation. Because arbitrary network architecture and dynamics can be superimposed on the reservoir, implementing biologically plausible network architectures allows to investigate how brain network organization and dynamics jointly support learning.

images/rc.png

conn2res: an overview

The conn2res toolbox provides a general use-case driven workflow that takes as input (1) either the type of task to be performed (see NeuroGym), or a supervised dataset of input- label pairs can also be provided; (2) a binary or weighted connectome, which serves as the reservoir’s architecture; (3) the input nodes (i.e., nodes that receive the external signal); (4) the readout nodes (i.e., nodes from which information will be read and used to train the linear model); and (5) the type of dynamics governing the activation of the reservoir’s units (continuous or discrete time nonlinear dynamics can be implemented, including spiking neurons or artificial neurons with different activation functions such as ReLU, leaky ReLU, sigmoid or hyperbolic tangent). Depending on the type of dynamics, the output is either a performance score, or a performance curve as a function of the parameter that controls for the qualitative behavior of the reservoir’s dynamics (i.e., stable, critical or chaotic).

images/conn2res.png

The toolbox has been extended to simulate physical connectome-informed memristive reservoirs, a newly type of neuromorphic hardware that, thanks to its high computational and energy efficiency, has the potential to replace conventional computer chips and revolutionize artificial intelligence algorithms (Tanaka, G., et al., 2019).

Installation requirements

Currently, conn2res works with Python 3.8+ and requires a few dependencies:

  • numpy (>=1.22)
  • scipy (>=1.7)
  • pandas (>=1.4)
  • scikit-learn (>=1.1)
  • matplotlib (>=3.5)
  • seaborn (>=0.11)
  • bctpy (>=0.5)
  • reservoirpy (>=0.3)
  • gym (==0.21.0)
  • neurogym (==0.0.1)

You can get started by installing conn2res from the source repository with:

git clone https://github.com/netneurolab/conn2res.git
cd conn2res
pip install .
cd ..
git clone -b v0.0.1 https://github.com/neurogym/neurogym.git
cd neurogym
pip install -e .

You are ready to go!

Citation

If you use the conn2res toolbox, please cite our paper.

License information

This work is licensed under a BSD 3-Clause "New" or "Revised" License. The full license can be found in the LICENSE file in the conn2res distribution.

conn2res's People

Contributors

anaston avatar bachnguyente avatar estefanysuarez avatar fmilisav avatar kenjimarshall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

conn2res's Issues

Abnormal phenomenon of reservoir state and 'balanced_accuracy_score' in tutorial.py

Hi,

When I ran the tutorial.py with 'PerceptualDecisionMaking', the output reservoir state is quite starnge that it seems the value of each node doesn't change.

Meanwhile, the performance of 'balanced_accuracy_score' also had a difference with paper, which had a drop of nearly more than 10%.

I just changed the 'adjusted' in 'balanced_accuracy_score' to 'True' and changed the file path of 'connectivity.npy', 'cortical.npy' and 'rsn_mapping.npy' to 'examples\data\human', which were downloaded with the guidance of closed issues 'Where can I get the three files connectivity.npy, cortical.npy, rsn_mapping.npy?'

Insufficient Requirements in Documentation to Install (Specifically Gym 0.21.0)

Hello!

I have started exploring this package and ran into a few installation requirement errors. I ended up resolving them, but thought it might be useful to share some of the things.

In your requirements.txt file, it notes that gym==0.21.0 is required. However, there is currently a known bug in installing that version (Gym Issue 3176). I ran into this same issue when trying to install conn2res using a new virtual environment (using venv and python 3.10.9).

This was resolved by ensuring setuptools==66 (pip install --upgrade setuptools==66) (Gym Issue 3200) and wheel==0.38.4 (pip install wheel==0.38.4)(Gym Issue 3202 and Gym Issue 3221) before installing the required packages as noted in the conn2res installation instructions (pip install . -r requirements.txt).

Guidance on Using Custom Dataset and Connectivity Matrix with conn2res

Hello,

I am currently working with the conn2res tool and I have some questions regarding its usage.

Firstly, I noticed that the tasks used in the dataset are cognitive tasks extracted from another tool called NeuroGym. I am interested in using my own dataset instead. Could you provide some guidance on the nature of the dataset that conn2res expects? Specifically, what format should my dataset be in, and what changes would I need to make in the code to ensure it works with my custom dataset?

Secondly, I understand that conn2res uses a connectivity matrix from an existing database. However, I would like to use my own connectivity matrix. Could you provide some instructions or guidelines on how to incorporate my own connectivity matrix into the conn2res workflow?

Lastly, I am having some difficulty understanding the structure of the codebase. Could you clarify which is the main code file? Is it the one labeled as 'tutorial' or is it one of the files in the 'examples' directory?

Any help or guidance would be greatly appreciated. Thank you in advance for your time and assistance.

Problems with bct library

from bct import get_components, distance_bin, reference

Hi everyone, thankyou so much for this available tool, I have a problem with the bct library to import get_components, distance_bin, reference, how can I fix it, because apparently bct is not found as a file in the repository, so I looked for it in pypi and I understand that it is the brain connectivity toolboox for python and it appears as bctpy because bct is a version for matlab, then I want to know if the errors to import everything are because they are called disitnto in this case and then get_components, distance_bin, reference would change. I hope you can help me and thank you in advance.

The parcellation of the human connectome

Hi, where can we find image file and its index file of the Desikan Killiany atlas which was used to parcellated human connectome and included 1015 brain regions according the statement in the tutorial.py?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.