GeNN
3.3.0
GPU enhanced Neuronal Networks (GeNN)
|
Synaptic matrix types are made up of two components: SynapseMatrixConnectivity and SynapseMatrixWeight. SynapseMatrixConnectivity defines what data structure is used to store the synaptic matrix:
unsigned int connN
: number of connections in the population. This value is needed for allocation of arrays. The indices that correspond to these values are defined in a pre-to-post basis by the subsequent arrays.unsigned int ind
(of size connN): Indices of corresponding postsynaptic neurons concatenated for each presynaptic neuron.unsigned int *indInG
with one more entry than there are presynaptic neurons. This array defines from which index in the synapse variable array the indices in ind would correspond to the presynaptic neuron that corresponds to the index of the indInG array, with the number of connections being the size of ind. More specifically, indIng
[i+1]-indIng[i] would give the number of postsynaptic connections for neuron i. 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 to 0th and 2nd neurons. The struct SparseProjection should have these members, with indexing from 0: g
will be kept in an array such as: g=
[g_Pre0-Post1 g_pre0-post2 g_pre1-post0 X]SynapseMatrixConnectivity::SPARSE
format, but saves memory when postsynaptic learning is required and is better suited to parallel construction. Ragged matrices are stored in a struct named RaggedProjection which contains the following members:unsigned int maxRowLength
: maximum number of connections in any given row (this is the width the structure is padded to). This value is set when the model is built using SynapseGroup::setMaxConnections
.unsigned int *rowLength
(sized to number of presynaptic neurons): actual length of the row of connections associated with each presynaptic neuronunsigned 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): g
will be kept in an array such as: g=
[g_Pre0-Post1 g_pre0-post2 g_pre1-post0 X]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
pushXXXXXStateToDevice
function, where XXXX is the name of the synapse population.pushXXXXXStateToDevice
function, where XXXX is the name of the synapse population.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 NNmodel::addSynapsePopulation: