Recurrent networks: from kernel to pattern

A difference-of-Gaussians kernel, its spectrum, and a ring network that turns noise into stripes.

How local excitation and lateral inhibition pick out a spatial frequency, and what a network built from such a kernel does with random input. Everything on this page runs in your browser; nothing to install. Change a slider while a simulation is running and it reacts immediately.

Difference of Gaussians and its spectrum

A local-excitation, lateral-inhibition kernel is the difference of two Gaussians. Its Fourier transform tells you which spatial frequency a recurrent network with this kernel will amplify most; the next explorable shows that network in action.

What you see. Left: the excitatory Gaussian in orange, the inhibitory one in blue (drawn negative), and their difference in black, as functions of distance. \(\sigma_e\) and \(\sigma_i\) are the widths; the strength sliders scale the two curves. Right: the magnitude of the kernel’s Fourier transform in grey; the orange dashed line marks the spatial frequency with the largest value, the one a recurrent network with this kernel amplifies most.

Pattern formation in a recurrent network

A ring of neurons, each exciting its close neighbours and inhibiting those a bit further away. Such a kernel amplifies one spatial frequency more than any other, so even random input turns into a regular pattern.

\[\tau \frac{dr}{dt} = -r + \left[\,W r + h\,\right]_+\]

  • \(r\): the firing rates of the 256 neurons on the ring.
  • \(W\): the connection matrix. Neuron \(i\) receives from neuron \(j\) a weight that depends only on their distance: a narrow positive Gaussian (excitation) minus a wider negative one (inhibition). The two width sliders set those Gaussians.
  • \(h\): a fixed random external input, one value per neuron, plus optional noise that is redrawn at every time step (the noise slider).
  • \([\cdot]_+\): rectification, negative values are set to zero.
  • \(\tau\): the time constant; the clock in the figure counts in units of \(\tau\).
  • Gain: \(W\) is scaled so that its largest eigenvalue equals the gain slider. Above 1 the corresponding pattern grows; below 1 it decays.

What you see. Top: the activity \(r\) of each neuron as a blue bar, by position on the ring. Bottom: the eigenvalues of \(W\) for each spatial frequency, counted in waves around the ring, as grey dots. The orange dot is the largest eigenvalue, the frequency the network amplifies most. The red dashed line marks eigenvalue 1, the boundary between decay and growth.

Try: with the gain below 1 the pattern fades and only the random input remains. Above 1, the frequency marked in orange takes over. Make the inhibition wider and the stripes get broader. From the pattern-formation exercise in Theoretical Neuroscience.