Skip to content

Commit cd59865

Browse files
committed
"initial version"
0 parents  commit cd59865

35 files changed

+13803
-0
lines changed

README.html

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<html><pre>
2+
3+
This code was used to run the simulations for the following publication:
4+
5+
Dura-Bernal S, Neymotin SA, Kerr CC, Sivagnanam S, Majumdar A, Francis JT, Lytton WW.
6+
Evolutionary algorithm optimization of biological learning parameters in a biomimetic neuroprosthesis.
7+
<a href="http://ieeexplore.ieee.org/document/7922468/">IBM Journal of Research and Development (Special issue on Computational Neuroscience) 2017 61 (2/3)</a>
8+
9+
---------------------------------------------------------------------------------------------
10+
Description
11+
----------------------------------------------------------------------------------------------
12+
13+
Izhikevich cell-based model of primary motor cortex (M1) which can:
14+
1) be interfaced with a virtual arm and use reinforcement learning to learn to reach two targets,
15+
2) receive inputs from dorsal premotor cortex (PMd) cells (from file or in real time via Plexon) to modulate direction,
16+
3) simulate different types of external stimulation (eg. electrical or optogenetic).
17+
18+
19+
---------------------------------------------------------------------------------------------
20+
Instructions to run simple demo
21+
----------------------------------------------------------------------------------------------
22+
23+
The code requires NEURON and Python and has been tested on Linux machines (Red Hat and Ubuntu). The steps below show how to run a simple demo where the system is trained and tested to reach two targets selected via different PMd inputs. The raster plot of each simulation will be shown, as well as the arm movement in real time, and a graph with the final arm trajectory.
24+
25+
Although the optimized system parameters are used, for the demo purposes training duration is limited to 2 secs (instead of 85 secs), and the simple 2-stick dummy is used (instead of the full musculoskeletal arm). Therefore the output is just meant to illustrate how the model works, but does not correspond to the optimized performance of the system. To use the full musculoskeletal arm model see instructions at the end.
26+
27+
1. Unzip all files.
28+
2. Type "nrnivmodl" in the root directory. This should create a directory called either i686 or x86_64, depending on your computer's architecture.
29+
3a. To run model in single core type "nrniv -python main.py" or "python -i main.py"
30+
b. To run model in multiple cores type "mpiexec -np [num_cores] nrniv -mpi -python main.py" or "./runsim [num_cores]"
31+
32+
While the model runs it, after a minute or so it produces figures like:
33+
<img src="./screenshot1.png" alt="screenshot 1" width="550">
34+
<img src="./screenshot2.png" alt="screenshot 2" width="550">
35+
36+
To use the musculoskeletal arm:
37+
1. set "s.useArm = 'musculoskeletal'" in network.py (line 60).
38+
2. Download the compiled C code for the musculoskeletal arm included in the following link (the zip file is 80 MB and after unzipping 265 MB): <a href="http://senselab.med.yale.edu/modeldb/data/183014/arm2dms_modeldb.zip">http://senselab.med.yale.edu/modeldb/data/183014/arm2dms_modeldb.zip</a>
39+
Note the musculoskeletal arm model is provided as a C++ executable tested under RedHat. For other options please contact the author.
40+
41+
Further information about the musculoskeletal arm can be found in the following publication:
42+
Dura-Bernal S, Zhou X, Neymotin SA, Przekwas A, Francis JT and Lytton WW (2015) Cortical Spiking Network Interfaced with Virtual
43+
Musculoskeletal Arm and Robotic Arm. Front. Neurorobot. 9:13. doi: <a href="http://dx.doi.org/10.3389/fnbot.2015.00013">10.3389/fnbot.2015.00013</a> Available online at: <a href="http://journal.frontiersin.org/article/10.3389/fnbot.2015.00013/full">http://journal.frontiersin.org/article/10.3389/fnbot.2015.00013/full</a>
44+
45+
46+
---------------------------------------------------------------------------------------------
47+
List of main files
48+
----------------------------------------------------------------------------------------------
49+
50+
- main.py: Runs the model and reads parameters from command line. After setting the command line input parameters, it calls one of the functions in network.py (eg. runTrainTest2targets()) which runs the full sequence of functions to execute the model.
51+
52+
- network.py: Contains all the functions that run the network model, including createNetwork(), addStimulation(), addBackground(), setupSim(), runSim(), finalizeSim(), saveData(), plotData(). It also includes functions that call all these functions in sequence (eg. runTrainTest2targets()).
53+
54+
- shared.py: Contains all the model shared parameters and variables, including layer definitions and connectivity. It is imported as "s" from all other files, so that any parameter can be referenced from any file using s.paramName
55+
56+
57+
- analysis.py: functions to plot and analyse data
58+
59+
- arm.py: Class containing all the virtual arm, target and RL critic apparatus.
60+
61+
- armGraphs: Supporting functions for the virtual musculoskeletal arm
62+
63+
- arminterface.py: Pipes interface with the virtual musculoskeletal arm
64+
65+
- comet_batch.run: Example script to run batch simulation in HPC
66+
67+
- dummyArm.py: simple virtual arm that can run independently and communicate via UDP
68+
69+
- error.py: Auxiliary functions to calculate error measurements during batch optimization
70+
71+
- evol_islands.py: Functions to run island-based evolutionary algorithms (using inspyred) to optimize model parameters
72+
73+
- izhi2007.mod: NMODL definition of Izhikevich 2007 neuron model
74+
75+
- izhi.py: Python wrapper for the different Izhikevich cell types
76+
77+
- nsloc.mod: NMODL for Netstim with location and adapted so interval can be modified during execution (used for proprioceptive and PMd inputs)
78+
79+
- nsloc.py: Python wrapper for NSLOC units
80+
81+
- pmdData.mat: dorsal premotor cortex (PMd) data used as input to model
82+
83+
- server.py: Functions to interface the model with Plexon recording system in real time
84+
85+
- stdp.mod: NMODL for STDP implementation
86+
87+
- stimuli.py: functions and parameters for differnt types of neural stimulation
88+
89+
- vecevent.mod: NMODL for VecStim mechanism that allows spiking input at predefined times
90+
91+
For any questions or further assistance please contact:
92+
salvadordura at gmail.com
93+
94+
</pre></html>
95+

0 commit comments

Comments
 (0)