• No results found

4.1 Sequence Replay With Binary Neurons

4.1.6 Cellular Simulations

The vector of thresholds now holds two subvectors for the two populations,λ≡(θ,η)

and the cellular update rule is, with the new definitions,

u(t+ 1) = Θ (Eu(t)−λ). (4.15) Assumptions about the connectivity of inhibitory neurons The connectivity matrix

from inhibitory to excitatory neuronsEIEis assumed throughout to have all elements

equal to one (recent imaging research in cortex makes this hypothesis plausible, see Fino and Yuste, 2011). The random effective connectivity matrixEEIfrom excitatory

to inhibitory neurons is of dimensionK×N. Its entries are set to one with probability

cEI<1, which provides a source of variability in spite of the fixed inhibitory-to-excita- tory connectivity. We assume no recurrent inhibitory connectivity for now, i.e.EI=0.

4.1.6 Cellular Simulations

In this Section we describe the algorithm for the simulation of the replay network pre- sented above and an efficient computer implementation inC++. The adjectivecellular

refers to the fact that the state of cells, or units, is computed at each time step in order to assess the replay functionality of the network, and stands in opposition tomean- fieldsimulations where only a minimum of replay-related variables is evolved in time for the same purpose. The code for these cellular simulations was written by Axel Kammerer; all simulation results in this work have been kindly provided by him.

The algorithm has two stages: creation of the synaptic matrix from randomized patterns (imprinting) and testing of the recall performance (replay). We describe them in turn.

4.1.6.1 Imprinting

The imprinting procedure needs a function to generate a collection of P random

patterns and a function to produce the effective connectivity matrixE from the mor- phological connectivity and the potentiation induced by the Willshaw rule.

Generation of patterns Givenc, cm,andf, the number of patternsPto be generated

and loaded is calculated using Equation 4.12. After imprinting of exactlyP patterns

as described below, the number of activated synapses is calculated in order to confirm that the desired effective connectivitychas been reached.

For each pattern ξ∈ {ξ1, ,ξP}we use the following randomization procedure.

An integer jis randomly drawn from the set{0, , N1}. Ifξjis zero (that neuron

has not been chosen for the pattern so far), then we activate it, ξj= 1. The count of

active neurons in pattern ξ increases by one. To first order, the expected number of

collisions is f2 M. Hence the total amount of random numbers that we need to

generate is of the orderM+f2M, i.e. well below theN random numbers required by

a naive implementation. The process stops when we haveP ξ

i=M, i.e. the desired M active neurons per pattern.

pattern generation pseudocode

active_neurons =∅

while count(active_neurons) < M:

j = choose integer in range(N): if not j in active_neurons:

add jto the set active_neurons

Patterns are stored as a binary vector of lengthN to facilitate comparison with the

binary activity vectors generated by the network during the replay phase, rather than using a memory-efficient sparse representation.

Morphological and functional connectivity (imprinting) For each synapsei j, the morphological connectivitywijis decided by drawing a random number y∈[0,1)

and settingwij= Θ(cmy). The synapse is potentiated from its initial statesij= 0if it

is found to link patterns activated in sequence upon scanning over the pairs of patterns (associations) generated as described above (i.e. there existst [1, , P]such that

ξit= 1 =ξjt+1) . The product of the two,eij=wijsij, is stored as the row-sparse effective

connectivity matrix.

Unstructured inhibitory connectivities In networks with inhibition, the creation

of inhibitory synapses benefits from the simplified connectivity scheme described in Section 4.1.5 (Assumptions about the connectivity of inhibitory neurons). Indeed, sim- ulations assume that each inhibitory unit projects to all of the excitatory excitatory ones, i.e. cIE = 1. The random, nonsaturated connectivity matrix EEI from excita- tory to inhibitory neurons is generated row-wise as follows. Given the probability of finding an activated synapse, cEI, the distances d between activated synapses in a row (entries with value one) are drawn from the distribution p(d) =cEI(1−cEI)d.

4.1.6.2 Replay

Replay is triggered by activating a set of neurons and applying the update rule Eq. (4.7) with the connectivity matrixE from the imprinting process above.

Initialization A copy of the first stored pattern ξ1is used to decide which neurons

are active at step 1,x(t= 1) =ξ1.

Step forward and multithreading The update step x(t + 1) = Θ(EE x(t) θ)

involvesN scalar products of the rowsei of the effective connectivity matrix (stored

as lists of indexes of active units) with the activity vectorx(t)from the previous time step, of length N. Clearly, state update is independent across units, which suggests

broadcasting the computation to different computational units (processor cores). Thus, the update step is parallelized in several threads (usually about eight), each handling

N/numthreads dot products. The state of the network after each such multiplication

must be synchronized across the threads.

Assessment of the quality of replay The numbers of hitsmand false alarmsnare

extracted from Eqs. 4.10 by calculating the dot products between activity vectorx(t)

and thet-th patternξt or its complement(1ξt), respectively. The activity vector is

discarded as soon as the next iteration has been computed, and only the values ofm, nare committed to disk.

Parameter studies At each pattern sizeMseveral thresholdsθ are tried, guided by

the insights from the mean-field model (Section 4.2 below). For every M , θ pair, a few (<10) simulation runs are performed. In this way, the stochasticity induced by

the realizations of the random morphological connectivity can be assessed. In each simulation a total ofQ=100 iterations is computed. The final state of the network is considered to be representative of the fixed point atQ→ ∞.

Inhibitory state In networks with inhibition it is necessary to update at each time

step also the state of the inhibitory neurons. We follow here the notation introduced above in Section 4.1.5. The assumptions on the connectivity (non-recurrency) allow to write the inhibitory stater(t)in terms only of the state of the excitatory neurons

x(t), following the rule

r(t+ 1) = Θ (EIEx(t)η).

The update uses the same multithreaded code for sparse dot products as described above for the excitatory population. By virtue of the all-to-all inhibitory to excitatory connectivity, the update rule for the excitatory populations is simplified with respect to Eq. 4.15—it only depends on a global inhibition biasPk=1

K rk(t) x(t+ 1) = Θ EE x(t)P k=1 K rk(t) −θ . 4.1.6.3 Computational Cost

The simulations described above need handling of very large connectivity matrices whose size grows quadratically in the total number of neuronsN. A simulation run of the algorithm described above implemented inC++takes 2-4 hours on a 2011 amd64

system with 24 6-core processors and 128 Gb of RAM. But precisely in the large numbers of neurons present in the mammalian hippocampus lies the hope for a simple model. Much as thermodynamics disregards positions and speeds of individual gas molecules and describes instead the state of a gas in terms of macroscopic variables such as pressure, volume and temperature, the theory we describe in Section 4.2 takes advantage of the large network and pattern sizes to directly estimate the evolution of the figures of merit for the replay process: hits and false alarms.

Memory requirements A total ofPpatterns are stored as lengthN arrays ofchar,

thus spending one byte4.4per neuron. The excitatory connectivity matrixEis stored as

N sparse rows, each of which is represented, in average, byN cintegers of size 4 bytes (C++inttype). TheLmatrix is similarly encoded, with an average number ofN K cEI integers indicating the position of active excitatory-to-inhibitory synapses in each of theKrows. The connectivity from inhibitory to excitatory neurons is total,cIE=1, and thus demands no additional storage. In addition to these major memory requirements, the algorithm keeps copies of the current state of inhibitory and excitatory neurons, and a few other scalar variables, which we neglect in comparison to the main data structures. While these memory demands, summarized in Table 4.1 are exceeded by the specifications of standard personal computers at the time of writing, they induce heavy loads on the memory-processor bus (Alted, 2010) that considerably slow down the computation to dozens of hours.

data structure size (bytes) example size loaded patterns P Nsizeof(char) 2.64 Gb

EEmatrix c N2sizeof

(int) 1.90 Gb EEImatrix cEIK Nsizeof(int) 0.08 Gb

Total N log(1−c/cm)

log(1−M2/N2)+ 4c N+ 4cEIK

4.63 Gb

Table 4.1. Resources Required by Cellular Simulations. Main memory requirements of

the example for the costliest simulation considered while preparing this work, withN=105,

M=500, K= 2104, c= 5%, c

m=10%, cEI=0.01.