{'fraction_non_alphanumeric': 0.04426250479723679, 'fraction_numerical': 0.013240373544838173, 'mean_word_length': 4.101141924959217, 'pattern_counts': {'":': 0, '<': 0, '<?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}}
Realization of desired digital spike-trains by a simple evolutionary algorithm

This paper studies realization of desired digital spike-trains based on a simple evolutionary algorithm. First, the dynamics of spike-trains is visualized by a digital spike map. The map is defined on a set of points and is represented by a characteristic vector of integers. Second, in order to realize desired spike-trains, we present a simple evolutionary algorithm that aims at optimization of the characteristic vector for a cost function. We also present a simple method to super-stabilize desired spike-trains. Third, in order to implement the digital spike map, we introduce a digital spiking neuron consisting of two shift registers and a wiring between them. An elementary FPGA-based circuit is presented and a super-stable spike-train is demonstrated.


Introduction
This paper studies realization of desired spike-trains in dynamic digital circuits based on a simple evolutionary algorithm. Spike-trains have played important roles in various systems including spiking neuron models, image processing systems, and communication systems [1][2][3][4][5]. For example, in image processing systems, synchronization of artificial spiking neurons is used in segmentation [4]. In communication systems, spike-position modulation and spike-pattern-division multiplexing have been used [3,5]. Realization of desired spike-trains is important not only in fundamental study of nonlinear dynamics but also in engineering applications.
First, in order to visualize dynamics of spike-trains, we introduce a digital spike map (Dmap [6][7][8]). The Dmap is defined on a set of points and can be regarded as a digital version of analog onedimensional maps represented by the logistic map [9]. The Dmap is represented by a characteristic vector of integers. Since the domain of Dmap consists of a finite number of points, the steady state must be a periodic spike-train (PST). Depending on initial conditions and parameters, the Dmap can generate a variety of PSTs.
Second, in order to realize desired PSTs, we present a simple evolutionary algorithm (SEA). Basically, the evolutionary algorithms use individuals which are potential solutions of an optimization problem for a cost function [10][11][12][13]. The individuals refer to their past history, communicate to each other, and try to find a solution. In the SEA, each individual corresponds to a characteristic vector of a Dmap. The individual gives a Dmap that can generate a PST and a desired feature of the PST is evaluated by a cost function. An individual with the best evaluation is declared as the global best that is a candidate for preservation in the next generation. Plural candidates can exist and the number of individuals can vary flexibly. After a desired PST is obtained, the PST can be super-stabilized by a simple replacement of the characteristic vector. The super-stability means that all the initial points fall directly into the PST. It is suitable for robust and reliable operation of a PST generator.
Third, in order to implement the Dmap, we introduce a digital spiking neuron (DSN [2,3]). The DSN is constructed by two shift registers and a wiring between them. Depending on a wiring pattern, the DSN can generate various PSTs.
The DSN is applicable to spike-pattern-division multiplexing communication [3]. The dynamics of the DSN can be described by a Dmap and the wiring pattern corresponds to the characteristic vector of the Dmap. An elementary FPGA-based circuit is presented and a super-stable spike-train is demonstrated.
Our results of the Dmap and SEA will be developed into evolutionary algorithm based design of various dynamic digital circuits. As is well known, various evolutionary algorithms have been presented and have been applied to optimization problems in various systems. For example, analog/digital filters, switching power converters, and neural networks [11][12][13][14][15][16][17][18][19]. The design of dynamic digital circuit is an important/effective object in the applications. It should be noted that the Dmap is related not only to the digital dynamic circuts but also to various digital dynamical systems and their applications. That is, a Dmap is derived from cellular automata [20] which are applicable to sound data description [21] and image processing [22]. A Dmap is derived from dynamic binary neural networks which are applicable to control of switching power converters [17][18][19]. Our results provide basic information to consider such applications. Figure 1 shows a Dmap and spike-train. Let τ denoted a normalized time and let τ n denote the n-th spike-position. Let a clock signal with period 1 exist and let θ n denote the n-th spike-phase: θ n = τ n mod 1. The Dmap is defined by

Digital spike map
The Dmap is represented by the characteristic vector where d i is the numerator of f (l 1 ). For example, a Dmap in Fig. 1 is represented by d = (2,4,4,6,8,3,2,4). As an initial spike-position τ 1 ∈ [0, 1) is given, the Dmap outputs a sequence of spike-phases {θ n } corresponding to a spike-train The n-th spike-position appears in the n-th interval: τ n ∈ [n−1, n). The spike-train can be represented by the sequence of spike-phases {θ n }. This Dmap can be implemented by the DSN in Section 5. Since the domain L M of the Dmap consists of a finite number of points, the steady state must be a PST. The Dmap cannot generate a chaotic spike-train but a variety of PSTs. Here we give basic definitions. Definition 1 : A point p ∈ L M is said to be a periodic point (PEP) with period k if p = f k (p) and f (p) to f k (p) are all different where f k is the k-fold composition of f . A PEP with period 1 is referred to as a fixed point. A sequence of the PEPs {p, f (p), · · · , f k−1 (p)} is said to be a periodic orbit (PEO) with period k. Since a PEO with period k is equivalent to a PST with period k, let the term PEO mean both PEO and PST hereafter. For example, in Fig. 1, the PEO with period 3 is equivalent to the PST with period 3.
Definition 2 : A point q ∈ L M is said to be an eventually periodic point (EPP) with step k if the q is not a PEP but falls into some PEP p after k steps: f k (q) = p. An EPP with step 1 is referred to as a direct eventually periodic point (DEPP): f (q) = p. An EPP corresponds to an initial spike-position

Simple evolutionary algorithm
In order to realize a Dmap that can generate a desired PST, we present the SEA. As preparations, we give several definitions. The SEA has individuals each of which corresponds to a characteristic vector d of a Dmap. The i-th individual at generation g is denoted by is the number of individuals at generation g. Let g max be a parameter of the maximum limit of generation. The number of individuals can vary. Let K max be a parameter of the maximum limit number of individuals. Each individual gives one Dmap. For simplicity, we consider realization of a PEO with period p having a desired characteristics. The PEO is evaluated by a positive definite cost function is referred to as the global best at generation g. The SEA is defined by the following 4 steps.
Step 3 (Evaluation of candidates): All the candidates are evaluated by the cost function F c and the global best is updated: is the minimum value of the cost function F c then the algorithm is terminated. If G b (g) is not the minimum value then a candidate of the global best is declared as a new individual. If the number of the new individuals is K n then K(g) ← K n . If K n exceeds K max , then K max individuals are selected randomly from the K n individuals and K(g) ← K max .
Step 4: Let g ← g + 1, go to Step 2, and repeat until the maximum generation g max .
It should be noted that the number of individual evaluations in Step 3 is at most M (M−1)K max g max . It is much smaller 1 than the number of brute force M M .
If a Dmap with a desired PST is given then we super-stabilize the PST. The super-stabilization is realized by a simple replacement of a characteristic vector. Let D be a characteristic vector whose subset d corresponds to the desired PST with period p:

Numerical experiments
We apply the SEA to a basic optimization problem of a Dmap. First, we define a cost function for realization of a PST with low autocorrelation. A PST with period p is denoted by Autocorrelation of the PST is defined by The cost function represents the second peak of autocorrelation where d is a characteristic vector whose Dmap has the PST with period p. The minimum value is F c (d) = 1. We apply the SEA to this cost function with the following parameters M ∈ {30, 32, 34}, K max ∈ {5, 10, 20}, g max = 100 Figure 3 shows Dmaps in example 1. As generation g increases, the Dmap evolves and the global best decreases and reaches the minimum value: The best individual in each step is as the following: where green elments denote the changed elements. Applying an appropriate replacement of the characteristic vector, we obtain the following characteristic vector that gives the Dmap in Fig. 3 Figure 4 shows three examples of evolution processes. In example 1, the global best reaches the optimal value at g = 4 as mentioned above. The number of individuals varies. Especially, at g = 3, 10 individuals are selected from best individuals for next evolution. The evolution process depends on random individual initialization and the random selection of individuals in Step 3. In example 2, the global best reaches the optimal value speedily at g = 2. In example 3, the global best reaches the optimal value slowly at g = 10. For g = 3 ∼ 9, the upper limit number (10 = K max ) of individuals are selected randomly. The global best cannot change until g = 9 and can be the optimal value at g = 10. If K max is set to be larger then larger number of individuals could be selected and global best would be improved faster. However, as K max increases, the SEA approaches the brute force and the computation cost increases.
We have executed 50 trials where different random numbers are used in individual initialization in Step 1 and selection of individuals in Step 3. Basically, the algorithm performance is evaluated by two measures.     Table I. In the right column, #IND×#ITE means the average number of individuals multiplied by iterations. We have obtained the optimal value of F c in all the trials. The results suggest existence of a suitable value of parameter K max (the upper limit number of individuals). In these results, K max = 10 seems to be suitable.

Digital spiking neurons
In order to implement the Dmap, we introduce the digital spiking neuron (DSN [2]). Connecting two shift registers, the DSN is constructed as shown in Fig. 5. The left and right shift resistors are referred to as P-cells and X-cells, respectively. The P-cells consist of M elements and operate as a pacemaker. Only one element can be 1 with period M and all the other elements are 0: where τ denotes discrete time and is represented by positive integers. Actual time step depends on clock speed in real circuits. Applying replacement τ ← τ /M, the discrete time is identical with that in previous sections. The X-cells consists of N elements and construct a state variable vector corresponding to the membrane potential in analog neuron models. Only one element can be 1 and all the other elements are 0. X(τ ) = (X 1 (τ ), · · · , X M (τ )) The P-cells and X-cells are connected by a wiring represented by the wiring vector a = (a 1 , · · · , a M ), a i = j iff P i is connected to X j (11) For example, the wiring vector of the DSN in Fig. 5(a) is a = (5,6,7,6,7,11,12,13) and that in Fig. 5(b) is a = (7,6,7,6,5,11,13,12). Each wiring activates either element of the X-cells. The activated elements construct a base signal where only one element can be 1 and all the other elements are 0: In order to define the dynamics of the DSN, we initialize X-cells such that X k (1) = 1 for some k. Let τ denote positive discrete times. For τ ≥ 1, the dynamics is defined as the following: If X j (τ ) = 1 for some j ∈ {1, 2, · · · , N − 1} then X j+1 (τ + 1) = 1. If X N (τ ) = 1 then DSN output a spike Y (τ ) = 1 and X-cell is reset to the base signal: If X N (τ ) = 1 and B j (τ ) = 1 then X j (τ + 1) = 1 where j ∈ {1, 2, · · · , N − 1}.
As illustrated in Fig. 6, the DSN generates a spike-train. Let τ n denote the n-th spike-position and let θ n = τ n mod M denote the n-th spike-phase. Since the n-th spike determines the (n + 1)-th spike, a Dmap can be defined.
Applying replacement τ ← τ /M and θ ← θ/M , the spike-phase is identical with those in Eq. (1). For simplicity, we set In this case, one spike appears once per one period M and the n-th spike appears in the n-th interval τ n ∈ {(n − 1)M, · · · , nM}. The Dmap is determined by the wiring vector a as the following. Let X N (τ n ) = N and Y (τ n ) = 1 for τ n = i, i = 1 ∼ M . At time τ n + 1, the X-cell is reset to the base B j : X i (τ n + 1) = j provided a i = j and P i (τ n ) = 1. The X-cell reaches the threshold and output the next spike at time That is, if a wiring vector a is given, the characteristic vector of the Dmap given by For example, the wiring vector of DSN in Fig. 5(a) gives the characteristic vector of Dmap in Fig. 1: The Dmap generates stable PEO and the DSN generates a stable PST as shown in Fig. 6(a). The wiring vector of DSN in Fig. 5(b) gives the characteristic vector of Dmap in Fig. 2:   This Dmap generates a super-stable PEO and the DSN generates a super-stable PST as shown in Fig. 6(b). In order to observe this super-stable PST experimentally, we have designed a digital circuit as shown in Fig. 7. Figure 8 shows Verilog simulation of the super-stable PST. This circuit has been implemented in FPGA and Fig. 9 shows a laboratory measurement. In the experiment, we have used a FPGA board (DIGILENT Inc. NEXYS3 Spartan-6) and a Logic Analyzer (DIGILENT Inc. Analog Discovery2). This elementary FPGA-based circuit is a first step to implement Dmaps in Section 4 and to implement larger scale DSNs that can generate various PSTs.

Conclusions
The SEA based realization of desired PSTs has been considered in this paper. This is a basic problem in application of evolutionary computation to design of dynamic digital circuits. The dynamics of spike-trains is visualized by the Dmap and the Dmap is represented by a characteristic vector of integers. In the SEA, individuals correspond to the characteristic vector and evaluated by a cost function. The individual(s) with the best evaluation are preserved in the next generation and the number of individuals can vary flexibly. Applying the SEA to a basic problem to optimize autocorrelation of a PST, the algorithm effectiveness is conformed. After a desired PST is obtained, the PST can be super-stabilized by simple replacement of the characteristic vector elements. The Dmap can be implemented in the DSN consisting of two shift registers connected by a wiring. An elementary FPGA-based circuit is presented and a super-stable PST is demonstrated. In order to develop the results into more generalized design procedure and its applications, we should consider many problems including the following. First, setting of suitable parameter values (e.g., K max ) for a given cost-function. Table I suggests existence of suitable parameter values. Second, analysis of evolution process. If individuals are trapped into local optima, efficient escape scheme is required. Third, implementation of larger scale efficient circuit and its engineering applications. The elementary FPGA-based circuit is a first step to implement the effective circuits.