Skip to content

code associated with the article "Feedback control of random networks as a model of motor cortical dynamics across tasks"

Notifications You must be signed in to change notification settings

neurohari/simulateLQRNetworks

Repository files navigation

simulateLQRNetworks

For citing this code, the following DOI can be used: DOI

This repository contains the code associated with the cell reports article "a model of neural population dynamics for flexible sensorimotor control" to simulate LQR-RNNs

The code that can run different tasks mentioned in the article (center out reaching, force fields, inertial loads, bar target (wider target task), shooting task)

Installation

  1. Clone the repository
git clone https://github.com/neurohari/simulateLQRNetworks.git
  1. Go to the repository directory
cd simulateLQRNetworks
  1. Install the required packages: Anaconda python package and other dependencies such as: h5py, numpy, argpars, sklearn, pickle, json. If you are using VScode, you can install a HDF5 viewer plugin so that you can visualize the contents of the hdf5 files in which we work in this code.

Downloading the datasets:

  1. To run the simulations or plot the data, download the folder named "datastore" from the following button Dataset https://doi.org/10.6084/m9.figshare.29149901

  2. Replace the dummy placeholder datafolder that exists in this repository with the above download

Usage

To simulate a prepare to reach task to 8 targets

Then you can just run the python notebook file "reachingTask.ipynb" to simulate the task on a randomly connected RNN (dense RNN or an ISN network) whose weights are stored in the folder "datastore/WeightsData"

The simulation results are stored inside datastore/SimulationData/8dirreach_task/denseRNN/denseRNN_results_singlesimulation.hdf5

To run the analysis:

Run the file named "analyze_plot_results_8dirtask.ipynb". This will plot the hand paths, kinematics, neural activities and also the PCA trajectories in the movement and preparation periods of the prepare-to-reach task.

To simulate variations in reaching (dynamics and task objectives)

Run any of the respective python notebook files "forcefieldTask.ipynb", "inertialTask.ipynb", "widetargetTask.ipynb", "shootingTask.ipynb".

To analyze and plot variations in reaching (dynamics and task objectives)

Run the python notebook "analyze_plot_results_taskvariations.ipynb".

Within this notebook in Cell 3 you can select the task that you want to analyze (forcefield, inertial, widetarget, shooting) and comment the remaining. Running the notebook should plot results similar to those in the article.

Contact

For any queries please contact: hari.kalidindi at donders.ru.nl

About

code associated with the article "Feedback control of random networks as a model of motor cortical dynamics across tasks"

Resources

Stars

Watchers

Forks

Packages

No packages published