GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
Toeplitz connectivity initialisation

Toeplitz matrices are ones where the values along all diagonals are constant. Doubly-blocked Toeplitz matrices are matrices made out of Toeplitz sub-matrices in a structure that is, itself Toeplitz so the sub-matrices are repeated along diagonals. Doubly-blocked Toeplitz matrices can be used to represent common machine learning operations including convolutions and, in GeNN, Toeplitz connectivity initialisation snippets can be used to generate such connectivity on the fly with SynapseMatrixType::TOEPLITZ_KERNELG (see Synaptic matrix types).

There are a number of predefined Toeplitz connectivity initialisation snippets:

For example, to initialise convolutional synaptic connectivity with a 3x3 kernel between two populations of 1024 neurons, each representing a 32x32 layer with a single channel: Here, conv_kh denotes the kernel height, conv_kw the kernel width, conv_ih the input layer height, conv_iw, the input layer width, conv_ic the number of input channels, conv_oh the output layer height, conv_ow the output layer width, and conv_oc the number of output channels/filters.

Defining a new Toeplitz connectivity snippet

Similarly to sparse connectivity initialisation snippets, Toeplitz connectivity initialisation snippets can be created by simply defining a class in the model description.

For example, the following Toeplitz connectivity initialisation snippet could be used to convolve a kern_dim x kern_dim square kernel with the output of populations of pop_dim x pop_dim neurons.

Each diagonal of Toeplitz connectivity is initialised independently by running the snippet of code specified using the within a loop. The $(id_diag) variable can be used to access the index of the diagonal being generated and the $(id_pre) variable can be used to access the index of the presynaptic neuron currently being processed. The can be used to initialise state variables outside of the loop - in this case $(id_diag) is split into kernRow and kernCol which are subsequently used to access the kernel element repeated along each diagonal. Similarly to sparse connectivity initialisation snippets when a kernel is used, synapses are added to using the $(addSynapse, target, kernRow, kernCol) function where the size of the kernel is specified using the .


Previous | Top | Next