Synfire Growth README Created: 5/31/08 Author: Aaron J. Miller 1. Installation ...is exceedingly easy. Just unpack the file to any directory you choose. The package includes only 4 files and a directory, 'Examples': i) synfireGrowth.cpp contains all the c++ code for the simulation. The details of the simulation are detailed in the publication: Jun JK, Jin DZ (2007) "Development of Neural Circuitry for Precise Temporal Sequences through Spontaneous Activity, Axon Remodeling, and Synaptic Plasticity." PLoS ONE 2(8): e723.doi:10.1371/journal.pone.0000723. The code is separated into 4 sections: a)The top portion of the file defines global variables, which are set to the defaults detailed in Jun, Jin (2007). Any of the global variables can be reset from the command line using the command line flags listed in Part 2. b)The following section is the declaration of the "neuron" class. Integrate-and-fire neurons are what we use in this simulation, and the "neuron" class includes all variables and subroutines relevant to implementing integrate-and-fire neurons. See Jun, Jin (2007) for details. c)The next section declares the "synapses" class. The "synapses" class tracks the strengths of all synapses during the simulation and is responsible for their time evolution. d)The final section is the main routine. It reads all runtime option flags from the command line, creates the neccessary "synapses" and "neuron" objects, loops through the trials and the timesteps, and writes data files to the appropriate data directories. ii) syn_analysis.m is a MATLAB file that creates plots from the data that synfire_Growth.cpp produces. See Part 3. iii) make_header.cpp is a short code that writes a header file used by synfireGrowth.cpp that specifies the size of the network being simulated. It is not necessary for the user to compile and run this code, but it is neccessary to leave this file in the directory from which the user creates new simulations. iv) create_run is a shell script that sets up a new run so that the user doesn't need to make the data subdirectories or complile and run make_header.cpp manually. The script prompts the user for the name of a new directory for the new simulation, then prompts the user for the size of the network that will be simulated. It creates the new directory, copies synfireGrowth.cpp and syn_analysis.m to the new directory, creates the header file synfireGrowth.h, and makes all the neccessary data directories. Lastly, it compiles synfireGrowth.cpp, creating an executable with the same name as the simulation directory entered by the user, so all the user needs to do is execute with the runtime options. v) Examples contains a set of results obtained from the simulation. -------------------------------------------------------------------------------- 2. Starting a simulation i. Creating a new directory for the run It is recommended that every simulation begin with executing the script create_run. The script automatically sets up all data subdirectories needed by the program synfireGrowth.cpp, and it creates the appropriate header file for the simulation, after prompting the user for the name of the new simulation directory and the size of the network. The script compiles all the code for the simulation. **Some compilers will give a single warning during compiling due to a double that is converted to an int. This is not a problem; the code is functioning properly.** Further details are documented above in section 1.iv. ii. Execute synfireGrowth with runtime options (code includes additional options describe in the comments) After running create_run, the code is properly compiled and the simulation is ready to begin running. The name of the executable that create_run makes is the same as the name of the simulation directory. Unless the user has chosen to simulate a network of exactly 1000 neurons, the network size to which the default simulation parameters are tuned, it is recommended that the user use the following runtime options to adjust the parameters. In particular, the appropriate spontaneous excitatory activity frequency and amplitude is very intimately related to the size of the network, and must be adjusted for each new size. As a rule of thumb for setting the values, synfire chains grow optimally in this model when the network spikes around 200 times per trial and the average membrane potential in the network is near -75mV. Other parameters may also be adjusted yielding new and widely varying results. ****Parameter flags (refer to Jun, Jin (2007) for further details) '-q ' sets the active synapse threshold (default is .2). Synapses with strength larger than this threshold have a physiological effect on their postsynaptic targets. '-r ' sets the super synapse threshold (default is .4). The number of synapses with strength above this threshold is limited by axon remodeling (see also '-D') '-s ' sets the synapse maximum (default is .6). Synapses are capped at this value. '-f ' sets the fraction of synapses initially active (default is .1). In particular, we implement a step distribution initally for simplicity, which is a feature of the simulation that should be improved, as the distribution is not stable. The maximal allowed inital synapse is set (see the "synapses" constructor) as half the difference of the super-synapse and active-synapse thresholds. '-a' '-b' '-c ' sets the decay rate of the synapses (default is .999996). Synapses are reduced by this factor after every trial in order to offset the synaptic potentiation that occurs as the network is spontaneously excited. It is how we implement a slow "memory leak" in the network. '-x ' sets spike rate of training excitation (default is 1500 Hz). Generated from a Poisson distribution '-y ' sets amplitude of training excitation (default is .7). All spikes are of this strength. '-z ' sets the training excitation duration (default is 8 ms). Always at the beginning of each trial. '-m ' sets the excitatory spontaneous frequency (default is 40Hz). Generated from a Poisson distribution. '-n ' sets the inhibitory spontaneous frequency (default is 200Hz). Generated from a Poisson distribution. '-o ' sets the max amplitude of the spontaneous excitation (default is 1.3). Generated from a uniform distribution. '-p ' sets the max amplitude of the spontaneous inhibition (default is .1). Generated from a uniform distribution. '-i ' sets the amplitude of the global inhibition (default is .3). After each network spike, all neurons are inhibited, to reduce computational complexity. '-A ' sets the numbers of trials before termination of the run (default is 200000). '-B ' sets the number of training neurons (default is 10). Always chosen with neuron labels 0,1,2,3... '-C ' sets the number of ms per trial (default is 2000). '-D ' sets the max number of supersynapses a neuron may have (default is 10). '-L' static synapses ****Log File At the beginning of each run, synfireGrowth.cpp generates a log file in the simulation directory: log.txt. The program documents in this file the values of all adjustable simulation parameters. It also contains a copy of the commands issues to it, in case the run fails and must be called again. ****Data Output/Input Flags '-# ' sets the ID number for the run (default is 1). It is very ####!!important!!#### that if you are loading a synaptic configuration from a previous run that you change the runid or the simulation will overwrite all previous data! '-l ' loads synapse data from path . The data file must contain a SIZExSIZE array. Presumably, the will be a file from the "syn" subdirectory, unless the user generated the array artifically. '-d' turns on the output of various statistics for diagnostic purposes to the screen after each trial. This is particularly helpful when trying to determine if spontaneous activity levels are appropriate for the selected network size. ***Format: <# active connections> '-t ' saves synapse data every trials (default is 100). The simulation saves to "syn/synr.dat" the entire synaptic strength matrix as a SIZExSIZE array. These files can be read with syn_analysis.m to make plots of synaptic strengths vs. trial, so the default save interval is set small to obtain maximal resolution. Similarly these are the files syn_analysis.m reads to make graphs of the distribution of weights. '-u ' saves the spike data of the network every trials (default is 1000). The simulation saves to "roster/rosterr.dat" all spikes during the trial. This file can be read with syn_analysis.m to make roster plots of the network spikes. ***Format: