Auryn simulator

Simulator for spiking neural networks with synaptic plasticity

User Tools

Site Tools


examples:sim_coba_benchmark

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
examples:sim_coba_benchmark [2014/01/13 10:30] – created zenkeexamples:sim_coba_benchmark [2016/07/05 23:40] (current) – typos zenke
Line 8: Line 8:
 To run the program the network first needs priming with external Poisson noise before it can self-sustain its activity. To do that invoke the program with the following command line arguments To run the program the network first needs priming with external Poisson noise before it can self-sustain its activity. To do that invoke the program with the following command line arguments
 <code shell> <code shell>
-./sim_coba_benchmark --dir /tmp --prime --simtime 0.050 
 ./sim_coba_benchmark --dir /tmp --simtime 5 ./sim_coba_benchmark --dir /tmp --simtime 5
 </code> </code>
 The ''prime'' keyword in the first command causes the network to run with external Poisson input and save its network state at the end of the run to a set of files created under ''/tmp''. Note that you can give any other directory name where you want the files to be created. The second call to the progrem without the ''--prime'' argument causes the program to read the current network state from these saved files and runs the network for the specified period in ''simtime''. All spiking output and the memory trace ([[mem]] file) of a single neuron are written to the directory specified with ''--dir'' and are prefixed with ''coba.*''. The ''prime'' keyword in the first command causes the network to run with external Poisson input and save its network state at the end of the run to a set of files created under ''/tmp''. Note that you can give any other directory name where you want the files to be created. The second call to the progrem without the ''--prime'' argument causes the program to read the current network state from these saved files and runs the network for the specified period in ''simtime''. All spiking output and the memory trace ([[mem]] file) of a single neuron are written to the directory specified with ''--dir'' and are prefixed with ''coba.*''.
 +
 +If you are interested in running the code in parallel please see the [[manual:parallel execution]] howto.
  
 ==== Output example ==== ==== Output example ====
Line 27: Line 28:
  
 {{ :examples:coba_ras.png?300 |}} {{ :examples:coba_ras.png?300 |}}
-This figure shows the rasterplot of the spiking activity of the excitatory population written to ''/tmp/coba.0.e.ras''.+This figure shows the raster plot of the spiking activity of the excitatory population written to ''/tmp/coba.0.e.ras''.
  
  
Line 33: Line 34:
 The figure shows the evolution of the membrane potential of one excitatory cell during the simulation. The figure shows the evolution of the membrane potential of one excitatory cell during the simulation.
  
 +
 +===== The important bits =====
 +<code c++>
 +TIFGroup * neurons_e = new TIFGroup( ne);
 +TIFGroup * neurons_i = new TIFGroup( ni);
 +
 +neurons_e->random_mem(-70e-3,10e-3);
 +neurons_i->random_mem(-70e-3,10e-3);
 +</code>
 +This part instantiates two groups of neurons of type [[TIFGroup]] which corresponds to the conductance based model with exponentially decaying PSCs and an absolute refractoriness of 5ms. The ''random_mem'' methods randomize the initial membrane potentials with a Gaussian (mean=-70mV and standard deviation 10mV).
 +
 +
 +The sparse random connectivity is initialized as follows:
 +<code c++>
 +SparseConnection * con_ee 
 +   = new SparseConnection( neurons_e,neurons_e, w, sparseness, GLUT);
 +
 +SparseConnection * con_ei 
 +   = new SparseConection( neurons_e,neurons_i, w,sparseness,GLUT);
 +
 +SparseConnection * con_ie 
 +   = new SparseConnection( neurons_i,neurons_e,wi,sparseness,GABA);
 +
 +SparseConnection * con_ii 
 +   = new SparseConnection( neurons_i,neurons_i,wi,sparseness,GABA);
 +</code>
 +here ''w'' contains the synaptic weight of excitatory synapses and ''wi'' the one of their inhibitory counter part. The network has a global ''sparseness'' of 2%.
 +
 +
 +
 +
 +The following code snipped is responsible for running the simulation for ''simtime'' seconds. The second parameter ''true'' indicates that we wan the simulation to be interrupted if the [[RateChecker]] detects too high firing rates, which usually suggests that something is going wrong.
 +<code c++>
 +if (!sys->run(simtime,true)) 
 +    errcode = 1;
 +
 +if ( prime ) { 
 +    oss.str("");
 +    oss << dir << "/save";
 +    sys->save_network_state(oss.str());
 +}
 +</code>
 +The second part of the above code saves the network state if ''prime==true'' and is therefore used to create the initial conditions of the self-sustained activity.
  
  
examples/sim_coba_benchmark.1389609018.txt.gz · Last modified: 2014/01/13 10:30 by zenke