Synaptic matrix types

Synaptic matrix types are made up of two components: SynapseMatrixConnectivity and SynapseMatrixWeight. SynapseMatrixConnectivity defines what data structure is used to store the synaptic matrix:

  • SynapseMatrixConnectivity::DENSE stores synaptic matrices as a dense matrix. Large dense matrices require a large amount of memory and if they contain a lot of zeros it may be inefficient.

  • SynapseMatrixConnectivity::SPARSE stores synaptic matrices in a(padded) ‘ragged array’ format. In general, this is less efficient to traverse using a GPU than the dense matrix format but does result in significant memory savings for large matrices. Ragged matrix connectivity is stored using several variables whose names, like state variables, have the name of the synapse population appended to them:

    1. const unsigned int maxRowLength : a constant set via the SynapseGroup::setMaxConnections method which specifies the maximum number of connections in any given row (this is the width the structure is padded to).

    2. unsigned int *rowLength (sized to number of presynaptic neurons): actual length of the row of connections associated with each presynaptic neuron

    3. unsigned int *ind (sized to maxRowLength * number of presynaptic neurons): Indices of corresponding postsynaptic neurons concatenated for each presynaptic neuron. For example, consider a network of two presynaptic neurons connected to three postsynaptic neurons: 0th presynaptic neuron connected to 1st and 2nd postsynaptic neurons, the 1st presynaptic neuron connected only to the 0th neuron. The struct RaggedProjection should have these members, with indexing from 0 (where X represents a padding value):

      maxRowLength = 2
      ind = [1 2 0 X]
      rowLength = [2 1]
      

      Weight update model variables associated with the sparsely connected synaptic population will be kept in an array using the same indexing as ind. For example, a variable caled g will be kept in an array such as: g= [g_Pre0-Post1 g_pre0-post2 g_pre1-post0 X]

  • SynapseMatrixConnectivity::BITMASK is an alternative sparse matrix implementation where which synapses within the matrix are present is specified as a binary array (see Insect olfaction model). This structure is somewhat less efficient than the SynapseMatrixConnectivity::SPARSE and SynapseMatrixConnectivity::RAGGED formats and doesn’t allow individual weights per synapse. However it does require the smallest amount of GPU memory for large networks.

Furthermore the SynapseMatrixWeight defines how

  • SynapseMatrixWeight::INDIVIDUAL allows each individual synapse to have unique weight update model variables. Their values must be initialised at runtime and, if running on the GPU, copied across from the user side code, using the pushXXXXXStateToDevice function, where XXXX is the name of the synapse population.
  • SynapseMatrixWeight::INDIVIDUAL_PSM allows each postsynapic neuron to have unique post synaptic model variables. Their values must be initialised at runtime and, if running on the GPU, copied across from the user side code, using the pushXXXXXStateToDevice function, where XXXX is the name of the synapse population.
  • SynapseMatrixWeight::GLOBAL saves memory by only maintaining one copy of the weight update model variables. This is automatically initialized to the initial value passed to ModelSpec::addSynapsePopulation.

Only certain combinations of SynapseMatrixConnectivity and SynapseMatrixWeight are sensible therefore, to reduce confusion, the SynapseMatrixType enumeration defines the following options which can be passed to ModelSpec::addSynapsePopulation :

  • SynapseMatrixType::SPARSE_GLOBALG
  • SynapseMatrixType::SPARSE_GLOBALG_INDIVIDUAL_PSM
  • SynapseMatrixType::SPARSE_INDIVIDUALG
  • SynapseMatrixType::DENSE_GLOBALG
  • SynapseMatrixType::DENSE_GLOBALG_INDIVIDUAL_PSM
  • SynapseMatrixType::DENSE_INDIVIDUALG
  • SynapseMatrixType::BITMASK_GLOBALG
  • SynapseMatrixType::BITMASK_GLOBALG_INDIVIDUAL_PSM

Previous | Top | Next