{'fraction_non_alphanumeric': 0.03911342894393742, 'fraction_numerical': 0.013831415452638739, 'mean_word_length': 4.305864661654136, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Storage capacity of phase-coded patterns in sparse neural networks

We study the storage of multiple phase-coded patterns as stable dynamical attractors in recurrent neural networks with sparse connectivity. To determine the synaptic strength of existent connections and store the phase-coded patterns, we introduce a learning rule inspired to the spike-timing dependent plasticity (STDP). We find that, after learning, the spontaneous dynamics of the network replay one of the stored dynamical patterns, depending on the network initialization. We study the network capacity as a function of topology, and find that a small- world-like topology may be optimal, as a compromise between the high wiring cost of long range connections and the capacity increase.

The capacity to memorize and recall multiple items of information is fundamental to normal cognition. Recent researches suggest that brain operates as a complex nonlinear dynamic system, and synchronous and phase-locked oscillations may play a crucial role in information processing, perception, memory, and sensory computation [1][2][3][4][5]. There is increasing experimental evidence that information encoding may depend on the temporal dynamics between neurons, namely, the specific phase alignment of spikes relative to rhythmic activity across the neuronal population (as reflected in the local field potential) [5][6][7][8][9][10][11][12]. Indeed phase-coding, that exploits the precise temporal relations between the spikes of neurons, may be an effective general strategy to encode information in the cortex [13][14][15][16][17][18][19][20].
The importance of precise timing of the neuron activity is also suggested by the rule that controls the potentiation or depression of synaptic strengths, namely the spiketiming dependent plasticity (STDP) [21,22], based on the precise order and time interval between the pre-and postsynaptic spikes, on a window of tens of milliseconds. This kind of plasticity, with acute sensitivity to temporal order, has been demonstrated in various neural circuits over a wide spectrum of species, from insects to xenopus laevis frog, rodents and humans [23,24].
The STDP is strongly asymmetric in the order of arrival of pre-and post-synaptic spikes, usually determining a potentiation in the case of causal order (pre-before-post), and depression in the reverse order. This temporal asymmetry results in asymmetric connections between neurons, that is a crucial ingredient to give rise to dynamical patterns, as opposed to static patterns characteristic of symmetric connections as in the Hopfield model.
Another crucial feature of the network is its connectivity and topology. Whereas all-to-all, or random, wiring is usually assumed in many models, this is possible in a tissue culture involving dozens of neurons, but it becomes less and less feasible when millions of neurons are involved, owing to space and energy supply limitations. The topology of the brain connectivity has been designed by evolutionary goals as a compromise between the ability to achieve complex dynamical functions and physical constraints and costs minimizations [25,26].
In the last decade, there has been a growing interest in the study of the topological structure of the brain network. There is increasing evidence that the connections of neurons in many areas of the nervous system have complex topology, such as a small world topology [27], highly p-1 connected hubs and modularity [28]. Up to now, the only nervous system to have been comprehensively mapped at a cellular level is the one of Caenorhabditis elegans, and it has been found that is has indeed a small world structure [27,29]. The same property was found for functional and anatomical connectivity, in different animals and areas of the brain [28,30,31].
In this paper, we focus on the functioning of the network as a dynamical associative memory, that is on the ability of the network to memorize and recall multiple dynamical patterns, where each pattern is characterized not by a set of binary states of the neurons, as in the Hopfield model, but rather by a different set of time shifts (phases) between the periodic activities of the neurons. We study how the capacity of the network depends on the number of neurons, on the number of connections, and on the topology of the network, that is on the distribution of the connections between neighboring or distant neurons.
We consider a network composed by N neurons, with N (N −1) possible (directed) connections J ij . The activity of the neuron is represented by a time-dependent variable σ i (t), with σ i (t) = −1 (silent neuron) or σ i (t) = 1 (firing neuron). Note that, in a coarse grained view, the variable σ i (t) may as well represent a group of neighboring neurons with a highly correlated activity.
Not all the connections are present in the network. We put neurons randomly in a three-dimensional box with periodic boundary conditions, with density equal to one. For each neuron, we consider the sphere centered on it, with a radius R such that the sphere contains the z nearest neurons. Then we connect each neuron to (1−γ)z neurons chosen randomly within the sphere of the neighbors, and γz neurons chosen randomly in the whole system. In this way, we realize a network with a given mean connectivity z, and a given fraction γ of long range vs. short range connections.
During the learning phase, we force the network to reproduce a number P of spatio-temporal periodic patterns, given by a specified function where µ = 1 . . . P is the index of the pattern, ω µ the angular velocity, φ µ i the phases of the neurons, that encode the relative times at which neurons start to fire in the pattern µ, and the function f (φ) is periodic of period 2π. We consider the function with equal times of silent and firing state. The connection J ij represents the strength of the synapse going from neuron j to neuron i, or in the coarse grained view the sum of strengths of synapses going from the group of neurons j to the group of neurons i. While in the Hopfield model the pattern to be stored σ µ i is static, and the learning rule is the outer product J ij ∝ σ µ i σ µ j , here the pattern to  [32], be stored σ µ i (t) is time dependent, and we formulate the change in the connections J ij in analogy with the STDP, as where A(τ ) is the learning function, and [0, t max ] is the learning time interval in which the network is forced to reproduce the pattern µ. We use for the function A(τ ) the one introduced and motivated by [32], with the parameters that fit the experimental data of [22] (see Fig. 1). In terms of Fourier components, this is written as 2π 0 dφ f (φ)e inφ , andÃ(ω) = dt A(t)e iωt . Due to the temporal asymmetry of A(τ ), the Fourier componentÃ(nω µ ) has an imaginary part, and therefore δJ µ ij = δJ µ ji . When we store multiple patterns µ = 1, 2, . . . , P , the learned weights are the sum of the contributions from individual patterns. For the sake of simplicity, we consider the same learning time t max and input frequency ω µ for all the encoded patterns. Moreover, for each pattern µ, we extract the phases φ µ i randomly and uniformly from the interval [0, 2π).
After the learning phase, we initialize the network with a given initial condition σ i (0), and perform a zero temperature spontaneous dynamics, with τ the unit step of time. Due to the shape of the response function sign(x), if all the connections J ij are multiplied by the same positive constant, the dynamics is unchanged. Therefore, the learning time t max and the amplitude of the learning function A(τ ) are immaterial.
p-2 a) b) Fig. 2: a) Plot of the self-sustained dynamics of the fully connected network with N = 500 and P = 5. The dynamics of the network, after a transient, is periodic of period T = 8τ . Different colors represent the value of ⌊4ti/T ⌋ mod 4, where ti is time at which the neuron i start to fire (black if neuron is firing at t = 0). In this case the times ti are highly correlated with the phases φ 1 i , which means that the pattern µ = 1 is well retrieved, and the overlap m1(t) is large. b) The same network with P = 50. In this case the pattern is not retrieved, and the overlap is of order 1/N .
In order to measure the similarity between the network activity during retrieval mode, and the stored phase-coded pattern µ, we define the overlap When the retrieval is perfect, σ i (t) = f (ωt − φ µ i ), with an output angular velocityω that is in general different from the input ω µ . In this case m µ (t) =f 1 e iωt , where |f 1 | ≃ 0.64 for the function (2). When the retrieval is not perfect, the modulus |m µ (t)| after a transient goes to a constant value lower than the maximal one. Finally, if the network is not able to reproduce the pattern, the overlap becomes after a transient of order 1/ √ N . The modulus of m µ (t) is therefore an order parameter which measure how much the network dynamics match the stored phase-coded pattern µ. Note that the output frequencyω/2π depends on the input frequency ω µ /2π, and on the degree of asymmetry of the learning function A(τ ). Ifω is different from ω µ , and |m µ (t)| is high, it means that the phase-coded stored pattern µ is replayed at a frequency different from the one used to store it, i.e. at a different time scale, but with the same phase relationship. In Fig. 2a we show the dynamics of a network of N = 500 neurons, with all the N (N − 1) connections activated, and with P = 5 patterns encoded at input frequency ω µ /2π = 10 Hz. The network is initialized with a high overlap with the pattern µ = 1, setting Each segment represent a time interval in which the neuron i is firing, that is σ i (t) = 1, with the neurons ordered a) b) on the vertical axis by the value of the phase of the first pattern φ 1 i . In this case the pattern µ = 1 has been retrieved, and the overlap m 1 (t) has modulus |m 1 (t)| ≃ 0.63 at long times. In Fig. 2b we show the same network with P = 50 patterns encoded. In this case the pattern is not retrieved, and the overlap has modulus |m 1 (t)| ≃ 0.07.
We define the capacity P max of the network as the maximum number of patterns encodable in the network, and retrievable with an overlap greater than 0.2. We have first studied the capacity of the network as a function of the number of connections, in the case of a fraction γ = 1 of long range connections. As the probability to create a long range connections is independent on the distance of the neurons, in this case the network is completely random. We therefore consider a network of N neurons, and create a connection from each neuron to a number z of randomly chosen neurons, with 0 < z < N . We then look if the network is able to encode P (random) pattern, and retrieve one of them subsequently. We initialize the network with an high overlap with one of the patterns, as in Eq. (7), and simulate the dynamics in Eq. (5) up to a time t = 2 × 10 5 in Monte Carlo steps, looking if the overlap with the chosen pattern remains higher than 0.2. The experiment is repeated with three different sets of P patterns. In Fig. 3a the result is shown for N = 40000. Solid (empty) circles represent points where the network was (was not) able to retrieve a pattern at least two times out of three. In practice, for all points considered, the network either was always able to retrieve the pattern (three times out of three), or never (zero times out of three). Furthermore, retrieved patterns had always an overlap greater than 0. not retrieved ones had an overlap lower than 0.08. Results for N = 4000 were practically the same, with a small number of points near the separation between encodable and not encodable region showing some fluctuations (retrieving the pattern one or two times out of three). Note that, in the range of values of z/N considered in Fig. 3a, the maximum capacity P max is well described by a linear function of the connectivity, P max = 0.24 z.
In Fig. 3b, we show the results for the entire range of z/N , from zero to one. When z/N is of the order of unity, the number of connections is of order N 2 , so the simulation is too expensive for N = 40000. We therefore study sistematically only the network with N = 4000, but compare it with the case N = 40000 for two values of z/N , finding a good agreement. For clarity we do not show the points simulated, but only a spline separating the encodable and the not-encodable region. The dashed line shows the limit of the capacity for low connectivity z/N , P max = 0.24 z. It can be seen that, when the connectivity grows, there is a saturation effect, so that for z ≃ N one finds P max /N ≃ 0.032, and therefore P max ≃ 0.032 z.
To study the effects of short and long range connectivity, we have then analyzed the capacity of the network in the case of a fraction γ of long range connections, and (1 − γ) of short range connections. The result is shown in Fig. 4a (dashed line), for N = 40000 and z = 180 (z/N = 0.0045). Note that in this case the sphere containing the short range neurons has a radius R ≃ 3.5, while the side of the cubic box is L ≃ 34. The storage capacity, that is the maximum encodable number of pattern such that the retrieval gives an overlap greater than 0.2, goes from P max ≃ 0.11 z for γ = 0 (only local connections) to P max ≃ 0.24 z for γ = 1 (random network). This shows that the number of connections is not the only parameter that determines the capacity of the network. Long range (random) connections are more effective than short range ones in encoding patterns.
The topology of the biological networks has been shaped by the evolution, as a compromise between the effectiveness in realizing complex tasks, and cost minimizations. While long range connections are more effective than short range ones, they are of course more costly. The trade-off between these two requirements will produce a network with a finite fraction of long range connections. We therefore introduce a parameter f , that represents the cost of a long range connections with respect to a short range one, and we consider a network with (1 − γ)z local connections, with neurons chosen randomly within those at distance lower than R, and γz/f long range connections, with neurons chosen randomly in the whole system. Varying γ, in this case it is not the connectivity that is constant, but the total cost of the connections. The storage capacity as a function of γ is shown in Fig. 4a (solid line), for the case f = 3. The maximum capacity of the network is realized with γ ≃ 0.5, that corresponds to about 25% of long range connections over the total of the connections. To characterize the network, we have also calculated for the different values of γ the clustering coefficient C, defined as the probability that two neurons, that are connected to a third neuron, are themselves connected, and the mean path length λ, defined as the minimum number of connections needed to go from a node to another node, averaged over all pairs of nodes. In Fig.4b, we show the relative clustering coefficient (C − C 1 )/(C 0 − C 1 ), and path length (λ − λ 1 )/(λ 0 − λ 1 ), where the quantities with subscripts 0 and 1 refer to the cases γ = 0 and γ = 1 respectively. Note that the clustering coefficient decreases much more slowly than the path length, giving rise to a large region where the clustering coefficient is not much lower than that for local connections only, while the path length is almost as low as in the random network. The network therefore, in the region of intermediate γ that corresponds to optimal capacity, is of a small-world type [27].
In this paper we studied the storage and recall of patterns in which information is encoded in the phase-based timing of firing relative to the cycle. We proposed a STDP-based learning rule, and we analyzed the its ability to memorize multiple phase-coded patterns, such that the spontaneous dynamics of the network selectively gives sustained activity which matches one of the stored phasecoded patterns, depending on the initialization of the network. Our work generalizes the Hopfield model, to dynamical periodic states, characterized by the relative phases of the neurons.
We have studied the storage capacity for different degrees of sparseness and topologies of the connections. Changing the proportion γ between short-range and longrange connections, we go from a three-dimensional network with only nearest-neighbors connections (γ = 0) to a random network (γ = 1). Small but finite values of γ give a "small world" topology, similar to that found in many areas of nervous system. We find that in the case of only short range connections the capacity is lowest, while in the case of only long range connections, that corresponds to a completely random net-work, the capacity is highest. Moreover, a small but finite fraction of long range connection is enough to enhance the capacity highly, with respect to the short range case. Therefore if the cost of the connections is taken in account, with long range connections more costly than short range ones, than the optimal capacity will be given by a small fraction of long range connections, that corresponds to a small-world topology. This is in agreement with the observation that smallworld attributes, with high clustering coefficient and short path length, was found across multiple spatial scales of cortical organization [31,33]. This property, first found in C. elegans, is highly conserved over different type of measurement, and across different species, including cat, monkey and humans, for both functional and anatomical networks [28].