GeNN  2.2.3
GPU enhanced Neuronal Networks (GeNN)
Defining a network model

A network model is defined by the user by providing the function

void modelDefinition(NNmodel &model)

in a separate file, such as MyModel.cc. In this function, the following tasks must be completed:

  1. The name of the model must be defined:
    model.setName("MyModel");
  2. Neuron populations (at least one) must be added (see Defining neuron populations). The user may add as many neuron populations as they wish. If resources run out, there will not be a warning but GeNN will fail. However, before this breaking point is reached, GeNN will make all necessary efforts in terms of block size optimisation to accommodate the defined models. All populations must have a unique name.
  3. Synapse populations (zero or more) can be added (see Defining synapse populations). Again, the number of synaptic connection populations is unlimited other than by resources.

Defining neuron populations

Neuron populations are added using the function

model.addNeuronPopulation(name, num, type, para, ini);

where the arguments are:

  • const string name: Unique name of the neuron population
  • unsigned int num: number of neurons in the population
  • unsigned int type: Type of the neurons, refers to either a standard type (see Neuron models) or user-defined type; this is an integer that indicates the position in the list of all neuron models where the model in question is stored.
  • vector<double> para: Parameters of this neuron type
  • vector<double> ini: Initial values for variables of this neuron type

The user may add as many neuron populations as the model necessitates. They must all have unique names. The possible values for the arguments, predefined models and their parameters and initial values are detailed Neuron models below.

Defining synapse populations

Synapse populations are added with the function

model.addSynapsePopulation(name, sType, sConn, gType, delay, postSyn, preName, postName, sIni, sParam, postSynIni, postSynParam);

where the arguments are

  • const string name: The name of the synapse population
  • unsigned int sType: The type of synapse to be added. See Built-in Models below for the available predefined synapse types.
  • unsigned int sConn: The type of synaptic connectivity. the options currently are "ALLTOALL", "DENSE", "SPARSE" (see Connectivity types).
  • unsigned int gType: The way how the synaptic conductivity g will be defined. Options are "INDIVIDUALG", "GLOBALG", "INDIVIDUALID" (see LEARN1SYNAPSE (Learning Synapse with a Primitive Piece-wise Linear Rule)).
  • unsigned int delay: Synaptic delay (in multiples of the simulation time step DT).
  • unsigned int postSyn: Postsynaptic integration method. See Postsynaptic integration methods for predefined types.
  • const string preName: Name of the (existing!) pre-synaptic neuron population.
  • const string postName: Name of the (existing!) post-synaptic neuron population.
  • vector<double> sIni: A vector of doubles containing initial values for the (pre-) synaptic variables.
  • vector<double> sParam: A vector of double precision that contains parameter values (common to all synapses of the population) which will be used for the defined synapses. The array must contain the right number of parameters in the right order for the chosen synapse type. If too few, segmentation faults will occur, if too many, excess will be ignored. For pre-defined synapse types the required parameters and their meaning are listed in NSYNAPSE (No Learning) below.
  • vector<double> psIni: A vector of double precision numbers containing initial values for the post-synaptic model variables.
  • vector<double> psPara: A vector of double precision numbers containing parameters fo the post-snaptic model.
Note
If the synapse conductance definition type is "GLOBALG" then the global value of the synapse conductances is taken from the initial value provided in sINI. (The function setSynapseG() from earlier versions of GeNN has been deprecated).

Synaptic updates can occur per "true" spike (i.e at one point per spike, e.g. after a threshold was crossed) or for all "spike type events" (e.g. all points above a given threshold). This is defined within each given synapse type.


Previous | Top | Next