Skip to content

ShenghaoWu/SpikingNetworkOptimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SNOPS (Spiking Network Optimization using Population Statistics)

Code accompanying the manuscript

“Automated customization of large-scale spiking network models to neuronal population activity” by S. Wu, C. Huang, A. C. Synder, M. A. Smith*, B. Doiron*, B. M. Yu*. Nat Comput Sci, vol. 4, 2024, pp. 690-705. [Link]

SNOPS customizes the parameters of a spiking network model to reproduce the population-wide covariability of large-scale neuronal recordings.

Getting Started

Please have the following software installed before running the code pack:

  1. Matlab R2019b or a latter version
  2. Matlab Signal Processing Toolbox
  3. Matlab Statistics and Machine Learning Toolbox

Then compile the mex code for running the spiking network model simulation:

  1. Open the Matlab commandline, move to the /src folder.
  2. Type:

mex EIF1DRFfastslowSyn.c
mex spktime2count.c

Note: we ask the user to compile the mex files because the pre-compiled files may be blocked on Mac OS due to security measures.
The total installation time should be under 3 mins once Matlab has been installed. The code has been tested using Matlab R2019b on MacOS and Linux.

Demo

We provide two demonstration scripts:

  • demo_short.m: This is a short demo that can be run for ~10 mins on a desktop CPU. In this demo, we customize a spatial balanced network to the spiking activity of a set of groundtruth spike trains generated by the same type of spiking network model. This demo customizes two free parameters and uses a much shorter simulation duration than in the manuscript for fast demonstration. Upon finishing, SNOPS will return the optimal parameter set, its associated cost, and activity statistics. The evaluated parameter sets as well as their cost and activity statistics for each customization iteration are included in log files in /results. An example result figure is also included in /results. Note that this demo will call SNOPS_short_demo.m, which is a simplified version of SNOPS to give you a quick idea of how the algorithm operates. For an example of running the full SNOPS customization, please refer to demo_full.m.

  • demo_full.m: This is a full-version demo that customize a SBN with 11 free parameters to the network-simulated groundtruth statistics. This should ideally be run on a cluster as it will require at least 10 CPU cores and require up to 168 hours to finish. Note that this demo call run_bayes.m, which is the original, full version of SNOPS that won't print results during customization. To check the results during customization, please refer to the code block for processing the logging files in the demo.

File Structure

  • /data: contains example target data for demo_short.m and demo_full.m. The target data is represented as the activity statistics which were computed from previously generated spike trains.

  • /src : contains SNOPS source scripts.

  • demo_short.m: contains a short demo where a spatial balanced spiking network (2 free parameters) is customized to a set of spike trains generated by the same type of network with a ground truth parameter set. Expect 10 mins to run this demo.

  • demo_full.m: contains a full demo where a spatial balanced spiking network (11 free parameters) is customized to a set of spike trains generated by the same type of network with 10 ground truth parameter sets. Expect 168 hours to run this demo.

  • /results : contains an example result figure from demo_short.m as well as the logging files (will appear once you execute the demo scripts).

    • file_name.mat: optimization log file. Contains the parameter sets (x_train), costs (y_train), running time (optimization_time), and feasibility (y_feasibility) of each iteration. This file will be continously updated throughout the customization process.
    • file_name_stats.mat: activity statistics log file. Contains the parameter sets (paras), activity statistics of the full simulation (full_stats), activity statistics of the feasibility simulation (surrogate_stats), and their running time (execution_time) of each parameter set evaluated. Note that the number of rows may exceed that in the optimization log file because there may be multiple evaluations of the same parameter set due to intensification. This file will be continously updated throughout the customization process.

About

Code for SNOPS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published