Data processing methods, electronic devices and media based on spiking neural networks
By dividing neurons in a spiking neural network and setting different update functions, the problem of insufficient accuracy of traditional spiking neural networks in time-sensitive applications is solved, and more accurate data processing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LYNXI TECH CO LTD
- Filing Date
- 2022-12-21
- Publication Date
- 2026-05-26
AI Technical Summary
In traditional spiking neural networks, each neuron updates in the same way, resulting in insufficient accuracy in time-sensitive applications.
The neurons are divided into first neurons and second neurons, and different update functions are set for them. The output information is calculated by the first solver and the second solver respectively, and then integrated to obtain the final data processing result.
By employing different update methods and integrating output results, the accuracy of data processing has been improved, especially in scenarios that rely on information from preceding and following time steps.
Smart Images

Figure CN115759208B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a data processing method, electronic device, and medium based on a spiking neural network. Background Technology
[0002] Spiking Neuron Networks (SNNs) are a new generation of artificial neural network models inspired by biology. They belong to a subset of deep learning and have strong biological foundations. In spiking neural networks, neurons are not activated in every iteration (unlike in typical multilayer perceptron networks), but are activated only when their membrane potential reaches a specific threshold. When a neuron is activated, it generates a signal that is transmitted to other neurons, raising or lowering their membrane potential.
[0003] Compared to traditional neural networks, spiking neural networks (SNNs) feature a more realistic biomimetic design, and are therefore widely used in fields such as pattern recognition, image processing, and computer vision. However, in traditional SNNs, each neuron updates in the same way, which leads to insufficient accuracy in applications that are more sensitive to time information. Summary of the Invention
[0004] In view of the above problems, this disclosure is made in order to provide a data processing method, electronic device and medium based on a spiking neural network that overcomes or at least partially solves the above problems.
[0005] According to one aspect of the present disclosure, a data processing method based on a spiking neural network is provided, wherein the spiking neural network includes: a first neuron and a second neuron; the method includes:
[0006] For the first neuron, the first output information of the first neuron corresponding to the current time step is calculated according to the first neuron update function;
[0007] For the second neuron, the second output information corresponding to the current time step is calculated according to the second neuron update function;
[0008] The first output information of the first neuron corresponding to the current time step and the second output information of the second neuron corresponding to the current time step are integrated, and the data processing result is obtained based on the integrated output result.
[0009] According to another aspect of the present disclosure, a method for constructing a bidirectional spiking neural network is provided, wherein the method includes:
[0010] The first solver solves the preset first neuron dynamics equation to obtain the first neuron update function, and the second solver solves the preset second neuron dynamics equation to obtain the second neuron update function.
[0011] The first neuron update function and the second neuron update function are integrated into the spiking neural network, and the spiking neural network is trained to obtain a bidirectional spiking neural network.
[0012] Thirdly, embodiments of this disclosure provide an electronic device, which includes:
[0013] One or more processors;
[0014] A storage device having one or more programs stored thereon, which, when executed by the one or more processors, cause the one or more processors to implement the method according to the first aspect of the present disclosure.
[0015] Fourthly, embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0016] In the data processing method, electronic device, and medium based on spiking neural networks provided in this disclosure, neurons are divided into first neurons and second neurons, and update functions for the first and second neurons are pre-set. Accordingly, for the first neuron, its first output information is calculated according to the first neuron update function; for the second neuron, its second output information is calculated according to the second neuron update function. This method integrates the first output information from the first neuron and the second output information from the second neuron, thereby obtaining the final data processing result based on the integration result. Therefore, in this embodiment, the two types of neurons use different update methods for output and integrate the output results of the two neurons, thus ensuring a more accurate final data processing result. Attached Figure Description
[0017] The accompanying drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the detailed description of exemplary embodiments with reference to the accompanying drawings, in which:
[0018] Figure 1 A flowchart illustrating a data processing method based on a spiking neural network, provided as an embodiment of this disclosure;
[0019] Figure 2 A flowchart illustrating a data processing method based on a spiking neural network, which is yet another embodiment of this disclosure;
[0020] Figure 3 A flowchart illustrating a method for constructing a bidirectional spiking neural network according to yet another embodiment of this disclosure is shown;
[0021] Figure 4 A schematic diagram of a neuron update method in a spiking neural network is shown in a specific example;
[0022] Figure 5 A block diagram of an electronic device provided in an embodiment of this disclosure;
[0023] Figure 6 This is a block diagram illustrating the composition of a computer-readable medium provided in an embodiment of the present disclosure. Detailed Implementation
[0024] To enable those skilled in the art to better understand the technical solutions of this disclosure, the methods, systems, electronic devices and computer-readable media provided in this disclosure will be described in detail below with reference to the accompanying drawings.
[0025] Exemplary embodiments will be described more fully below with reference to the accompanying drawings; however, these exemplary embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will enable those skilled in the art to fully understand the scope of this disclosure.
[0026] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.
[0027] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.
[0028] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. As used herein, the singular forms “a” and “the” are also intended to include the plural forms unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded.
[0029] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.
[0030] One embodiment of this disclosure provides a data processing method based on a spiking neural network. Figure 1 A flowchart illustrating a data processing method based on a spiking neural network according to an embodiment of this disclosure is shown, as follows: Figure 1 As shown, the method includes:
[0031] Step S110: For the first neuron, calculate the first output information of the first neuron corresponding to the current time step according to the first neuron update function.
[0032] In this embodiment, the neurons in the spiking neural network are divided into two groups: a first neuron group and a second neuron group. The first neuron group is updated according to a first neuron update function. This first neuron update function is used to update the first neuron based on its state information over the previous N time steps.
[0033] Step S120: For the second neuron, calculate the second output information of the second neuron corresponding to the current time step according to the second neuron update function.
[0034] For the second neuron, updates are performed according to its update function. This function updates the second neuron based on its state information over the next M time steps. Here, N and M are both natural numbers, and their values can be the same or different.
[0035] Step S130: Integrate the first output information of the first neuron corresponding to the current time step and the second output information of the second neuron corresponding to the current time step, and obtain the data processing result based on the integrated output result.
[0036] The integration operation is used to merge the first output information of the first neuron corresponding to the current time step and the second output information of the second neuron corresponding to the current time step, so that the final data processing result can comprehensively reflect the first output information and the second output information. The specific merging method can be flexibly selected by those skilled in the art.
[0037] Therefore, in the data processing method, electronic device, and medium based on spiking neural networks provided in this disclosure, neurons are divided into first neurons and second neurons, and update functions for the first and second neurons are pre-set. Correspondingly, for the first neuron, its first output information is calculated according to the first neuron update function; for the second neuron, its second output information is calculated according to the second neuron update function. This method integrates the first output information from the first neuron and the second output information from the second neuron, thereby obtaining the final data processing result based on the integration result. Thus, in this embodiment, the two neurons use different update methods for output and integrate the output results of the two neurons, thereby ensuring a more accurate final data processing result.
[0038] Figure 2 A flowchart illustrating a data processing method based on a spiking neural network, according to yet another embodiment of this disclosure, is shown. Figure 2 As shown, the method includes:
[0039] Step S210: For the first neuron, calculate the first output information of the first neuron corresponding to the current time step according to the first neuron update function.
[0040] Here, the first neuron refers to a neuron whose old state corresponds to the state at a previous time step; that is, the new state of the neuron is calculated based on the old state of the neuron at the previous time step. Correspondingly, the update function of the first neuron can be a function used to calculate the new state of the neuron based on the old state of the neuron at the previous time step.
[0041] In one alternative implementation, the first neuron update function can be used to: calculate the first state of the first neuron at the current time step and the first output information of the first neuron at the current time step based on the state information of the first neuron corresponding to the previous N time steps and the input information received by the first neuron at the current time step.
[0042] The input information received by the first neuron at the current time step may include: sequence information contained in the first pulse sequence, or output information from the neuron at the next higher level. The first neuron may include multiple neurons located at different levels, or multiple neurons located at the same level. In one implementation, the first neuron may include multiple first neurons located at different levels, and each level may further include multiple first neurons located at the same level. For example, suppose the first neuron includes neurons at 3 levels, and each level further includes 6 neurons, i.e., the total number of first neurons is 18. The first neurons at the first level are connected to the externally input first pulse sequence, and correspondingly, the input information received by the first neurons at the first level is the sequence information contained in the first pulse sequence. The input information received by the first neurons at the second level is the output information from the neurons at the first level (this output information is generated in response to the received sequence information). Similarly, the input information received by the first neurons at the third level is the output information from the first neurons at the second level.
[0043] In one alternative implementation, the first neuron update function can satisfy the following condition:
[0044] [y(t),states(t)] = first neuron update function(x(t),states(t-Δt));
[0045] Where x(t) represents the input information of the first neuron at time t, and states(t-Δt) represents the state of the first neuron at time t-Δt; y(t) represents the output information of the first neuron at time t, and states(t) represents the state of the first neuron at time t. Here, t-Δt represents a time before time t. For example, if t = 5 and Δt = 1, then t-Δt = 4.
[0046] Step S220: For the second neuron, calculate the second output information of the second neuron corresponding to the current time step according to the second neuron update function.
[0047] Here, the second neuron can refer to a neuron whose old state corresponds to the state at a later time step; that is, the new state of the neuron can be calculated based on the old state of the neuron at the later time step. Correspondingly, the second neuron update function can be a function used to calculate the new state of the neuron based on the old state of the neuron at the later time step.
[0048] In one alternative implementation, the second neuron update function can be used to: calculate the second state of the second neuron at the current time step and the second output information of the second neuron at the current time step, based on the state information of the second neuron corresponding to the next N time steps and the input information received by the second neuron at the current time step.
[0049] The input information received by the second neuron at the current time step may include: sequence information contained in the second pulse sequence, or output information from the neuron at the previous level. The second neuron may include multiple neurons located at different levels, or multiple neurons located at the same level. In one implementation, the second neuron includes multiple neurons located at different levels, and each level further includes multiple neurons located at the same level. For example, suppose the second neuron includes neurons at 3 levels, and each level further includes 6 neurons, meaning the total number of second neurons is 18. The second neuron at the first level is connected to the externally input second pulse sequence, and correspondingly, the input information received by the second neuron at the first level is the sequence information contained in the second pulse sequence. The input information received by the second neuron at the second level is the output information from the second neuron at the first level (this output information is generated in response to the received sequence information). Similarly, the input information received by the second neuron at the third level is the output information from the second neuron at the second level.
[0050] In one alternative implementation, the second neuron update function satisfies the following condition:
[0051] [y(t),states(t)] = the second neuron update function (x(t),states(t+Δt));
[0052] Where x(t) is the input information of the second neuron at time t, and states(t+Δt) is the state of the second neuron at time t+Δt; y(t) is the output information of the second neuron at time t, and states(t) is the state of the second neuron at time t. Here, t+Δt represents a time after time t. For example, if t = 5 and Δt = 1, then t+Δt = 6.
[0053] In one optional implementation, the first pulse sequence and / or the second pulse sequence can be obtained from the original input data. Optionally, the first pulse sequence can be obtained by pulse data encoding of the original input data arranged in forward order; the second pulse sequence can be obtained by pulse data encoding of the original input data arranged in reverse order. For example, in a data prediction processing scenario, the original input data includes: associated data corresponding to the data to be predicted; wherein, the associated data may include: data located before the data to be predicted, and / or data located after the data to be predicted. As an example, assuming it is necessary to predict the character between "I love" and "game" in the string "I love games", then the forward-arranged "I love games" is used as the original input data, and pulse data encoding is performed on the original input data to obtain the first pulse sequence. Correspondingly, pulse data encoding is performed on the reverse-arranged "games love me" to obtain the second pulse sequence. For example, in the scenario of data classification processing, the original input data may include: data to be classified. By performing forward and reverse arrangement processing on the data to be classified, a first pulse sequence and a second pulse sequence can be obtained, which makes it easier to determine the output information of the neuron from the perspectives of forward and reverse arrangement.
[0054] Step S230: Integrate the first output information of the first neuron corresponding to the current time step and the second output information of the second neuron corresponding to the current time step.
[0055] The integration operation may include: merging the first output information and the second output information, performing an OR operation or an AND operation to obtain the integrated output result. Therefore, the integration operation can be used to merge the first output information of the first neuron corresponding to the current time step and the second output information of the second neuron corresponding to the current time step, so that the final data processing result can comprehensively reflect the first and second output information. The specific merging method can be flexibly selected by those skilled in the art.
[0056] As an example, in one optional implementation, the output layer integrates the two pulse sequences according to time beats: the two output information belonging to the same time beat are integrated together to obtain the final output result. The integration method can include various methods such as concat (merging two pulse data streams), OR operation (issuing only if one stream is emitted), and AND operation (issuing only if both streams are emitted), etc. This application does not limit the specific integration method.
[0057] Step S240: Obtain the data processing result based on the integrated output.
[0058] Specifically, if the integration method is to merge two pulse data streams, the first output information generated by the first neuron and the second output information generated by the second neuron within the current time frame are merged, and the data processing result is determined based on the merged output. If the integration method is an OR operation, it is determined whether either the first or second neuron has performed a pulse firing operation. If either the first or second neuron has performed a pulse firing operation, the integrated output result is considered a pulse firing. If the integration method is an AND operation, it is determined whether both the first and second neurons have performed pulse firing operations. Only if both the first and second neurons have performed pulse firing operations is the integrated output result considered a pulse firing.
[0059] The data processing method based on a spiking neural network provided in this embodiment divides neurons into first neurons and second neurons, and pre-sets update functions for the first neuron and the second neuron. Accordingly, for the first neuron, its first output information is calculated according to the first neuron update function; for the second neuron, its second output information is calculated according to the second neuron update function. This method integrates the first output information from the first neuron and the second output information from the second neuron, thereby obtaining the final data processing result based on the integration result. Therefore, in this embodiment, the two types of neurons use different update methods for output, and the output results of the two neurons are integrated, thus ensuring a more accurate final data processing result. Figure 3 The diagram illustrates a flowchart of a method for constructing a bidirectional spiking neural network according to yet another embodiment of this disclosure. Figure 3 As shown, the method includes:
[0060] Step S310: The first solver performs a solution operation on the preset first neuron dynamics equation to obtain the first neuron update function, and the second solver performs a solution operation on the preset second neuron dynamics equation to obtain the second neuron update function.
[0061] Step S320: Integrate the update functions of the first neuron and the second neuron into the spiking neural network, and train the spiking neural network to obtain a bidirectional spiking neural network. This bidirectional spiking neural network is used to implement the data processing method mentioned above.
[0062] The following is a specific example of how this is implemented:
[0063] The update formula for each neuron H in a single time step typically has the following form:
[0064] Regarding the first neuron,
[0065] [y(t),states(t)] = neuron update function(x(t),states(t-Δt))
[0066] Regarding the second neuron,
[0067] [y(t),states(t)] = neuron update function(x(t),states(t+Δt))
[0068] Where x(t) is the input, y(t) is the output, and states represent the state variable values, including the influence of the previous time step on the current time step, and can have multiple values.
[0069] The solver mentioned above can be implemented in various ways. Describing neuronal state updates often involves using dynamic equations to describe the continuous evolution of neuronal states. These equations are typically differential equations. Neuronal models with good bio-simulation capabilities are often represented by complex differential equations. In actual brain simulations, to balance good biological properties and simulation performance, numerical solutions are usually used for the differential equations representing neuronal models. The differential equations describing neuronal models essentially describe the continuous change of neuronal states over time, so these equations are primarily related to time variables. Numerical solutions discretize the continuous time axis, i.e., divide the time step. Through iterative formulas, after the first few initial terms of a given sequence, a numerical approximate solution can be obtained at each dividing point according to the iterative formula of the sequence. The numerical solution will inevitably not be exactly the same as the exact solution of the original differential equation, and there will be errors. However, compared to the time spent solving complex exact solutions, these small errors are completely acceptable. Furthermore, many traditional partial differential equations cannot be solved explicitly and can only be solved using numerical methods.
[0070] Iterative computation of a neuron model can refer to the process where a neuron's cell body has a state, and the output is generated and the current cell body state is updated based on the inputs connected to the neuron and the current cell body state. The differential representation of the neuron model and the computation process of this differential representation will be implemented using the chip's hardware function library, employing the following scheme:
[0071] First, we analyze models such as LIF, Izhikevich, and Hodgkin-Huxley to determine the type of their differential equations. Then, we use common numerical methods to solve these equations and derive their difference expressions. The commonly used numerical solution method is the forward Euler method. The Euler method solves differential equations by using the linear theorem to estimate the function value for the next step. The formula given by the forward Euler method is y. n+1 =y n +hf(x n ,y n ), where h is the step size, (x n ,yn ) is the function f(x) n ,y n (a point above, according to y) n Use f(x) n ,y n y can be obtained n+1 .
[0072] Therefore, the construction method of a bidirectional spiking neural network specifically includes the following steps:
[0073] Step 1: Solve the neuron dynamics equations using a solver to obtain discretized update functions (specifically including the first neuron update function and the second neuron update function mentioned above).
[0074] Step 2: Integrate the discretized update function into the bidirectional spiking neural network, and train the bidirectional spiking neural network with the integrated discretized update function (for example, by backpropagation) to update the network parameters contained in the bidirectional spiking neural network, thereby obtaining the trained bidirectional spiking neural network.
[0075] Next, the trained bidirectional spiking neural network can be used to perform the data processing and inference operations mentioned above.
[0076] In summary, traditional spiking neural networks have a unidirectional time dimension, updating over time based on dynamic equations, thus failing to express the impact of future results on the present. However, for many data inputs, such as sentences composed of a string of characters, the processing of the current i-th word (e.g., word completion) can depend on several preceding words or subsequent words. Therefore, bidirectional spiking neural networks offer better accuracy for handling such problems.
[0077] In summary, the characteristics of bidirectional spiking neural networks include:
[0078] 1. The input can be pulses generated by other neurons or a sequence of input event information.
[0079] 2. It can process forward event sequences or pulse sequences fired by the first neuron, and it can also process reverse event sequences or pulse sequences fired by the second neuron.
[0080] 3. The output layer integrates the two pulse sequences according to the time beat. The integration methods include concat (merging two pulse data), OR operation (issuing as long as one is issued), and AND operation (issuing is determined only when both are issued), etc.
[0081] 4. The first neuron infers the information at time t through time t-Δt, where Δt is a discrete time such as Δt=1, or multiple discrete times such as Δt=[4,3,2,1]; the second neuron infers the information at time t through time t+Δt, where Δt is consistent with the definition of positive.
[0082] In summary, the two types of neurons in this embodiment use different update methods to output data, and the output results of the two types of neurons are integrated to ensure that the final data processing results are more accurate.
[0083] This disclosure provides a method for constructing a bidirectional spiking neural network. A first solver solves a preset first neuron dynamics equation to obtain a first neuron update function, and a second solver solves a preset second neuron dynamics equation to obtain a second neuron update function. The first and second neuron update functions are then integrated into the spiking neural network, and the network is trained to obtain a bidirectional spiking neural network. The trained bidirectional spiking neural network integrates the first output information from the first neuron and the second output information from the second neuron, thereby obtaining the final data processing result based on the integration result. Therefore, in this embodiment, the two neurons use different update methods for output and integrate the output results of the two neurons, thus ensuring a more accurate final data processing result.
[0084] Finally, for ease of understanding, Figure 4 A schematic diagram of a neuron update method in a spiking neural network is shown in a specific example, such as... Figure 4 As shown, assume that the spiking neural network contains a first neuron H1 and a second neuron H2. Figure 4 The input and output information of the first neuron H1 and the second neuron H2 at each time step are shown.
[0085] like Figure 4As shown, the input information of the first neuron H1 is x1, and the input information of the second neuron H2 is x2. x1 and x2 can be the same or different. The output information of the first neuron H1 is y1, and the output information of the second neuron H2 is y2. The integration result of y1 and y2 is used as the data processing result. Furthermore, as can be seen from the figure, at time step t1, the second neuron update function of the second neuron H2 is used to: calculate the second state of the second neuron H2 at the current time step t1 and the second output information y2 of the second neuron H2 at the current time step t1, based on the state information of the second neuron H2 corresponding to the last two time steps and the input information x2 received by the second neuron H2 at the current time step t1. The state information of the second neuron H2 corresponding to the last two time steps includes: the state information of the second neuron at time step t2 and the state information of the second neuron at time step t3. Therefore, for the second neuron, the output information of the current time step is calculated based on the state information of at least one time step after the current time step and the input information of the current time step. Figure 4 In this example, the number of at least one time step is set to 2. However, the specific number of at least one time step can be flexibly determined based on the actual business scenario. For example, in a data prediction scenario, if the content to be predicted is related to multiple contents before and after it, then the number of at least one time step should be set to be more; otherwise, the number of at least one time step should be set to be less.
[0086] At time step t3, the first neuron update function of the first neuron H1 is used to: calculate the first state of the first neuron H1 at the current time step t3 and the first output information y1 of the first neuron H1 at the current time step t3, based on the state information of the first neuron H1 corresponding to the previous two time steps and the input information x1 received by the first neuron H1 at the current time step t3. The state information of the first neuron H1 corresponding to the previous two time steps includes: the state information of the first neuron at time step t1 and the state information of the first neuron at time step t2. Therefore, for the first neuron, the output information at the current time step is calculated based on the state information of at least one time step preceding the current time step and the input information of the current time step. Figure 4 In this example, the number of at least one time step is set to 2. However, the specific number of at least one time step can be flexibly determined based on the actual business scenario. For example, in a data prediction scenario, if the content to be predicted is related to multiple contents before and after it, then the number of at least one time step should be set to be more; otherwise, the number of at least one time step should be set to be less.
[0087] Therefore, the state and output information of each first neuron at any time step are determined by the state information of the first neuron in the previous N time steps and the input information at the current time step; similarly, the state and output information of each second neuron at any time step are determined by the state information of the second neuron in the following N time steps and the input information at the current time step, where N is greater than or equal to 1. Furthermore, Figure 4 The example shown uses only five time steps; in reality, there are many more time steps. Figure 4 The image only shows one first neuron and one second neuron. In reality, there can be multiple first neurons and two second neurons.
[0088] In short, through Figure 4 The method shown enables the final output of the spiking neural network to be determined by combining the state information of the first N time steps and the last N time steps, thereby improving the accuracy of data processing.
[0089] For example, in a specific case, suppose the input sequence corresponding to the first neuron H1 is "I love ■ games".
[0090] For the first neuron H1, its input at the first time step t1 is the code corresponding to "I". Based on the received code corresponding to "I", the first neuron calculates its output information and state information at time step t1 using its update function. The output information of the first neuron at time step t1 corresponds to... Figure 4 The broken line portion in the diagram is used to generate the output y at time step t1. The state information of the first neuron at time step t1 corresponds to... Figure 4 The curved portion in the diagram is used to provide information up to time step t2 and time step t3.
[0091] At time step t2, the first neuron calculates its output and state information using its update function, based on the encoding of "love" received at time step t2 and the state information of the first neuron at time step t1. This shows that the output and state information of the first neuron at time step t2 are related not only to the input at the current time step t2 but also to the state at time step t1. The state at time step t1 is obtained based on the encoding of "I" received at time step t1. Therefore, the input information received at time step t1 not only affects the current time step but also further affects the next time step. Similarly, the output information of the first neuron at time step t2 corresponds to... Figure 4 The vertical broken line portion in the diagram is used to generate the output y at time step t2. The state information of the first neuron at time step t2 corresponds to... Figure 4The horizontal curve portion in the diagram is used to provide information up to time steps t3 and t4. At time step t3, the first neuron, based on the encoding received at time step t3, and the state information of the first neuron at time steps t1 and t2, calculates its output and state information using the first neuron update function. Therefore, the output and state information of the first neuron at time step t3 are not only related to the input at the current time step t3, but also to the state at time step t1. The state at time step t1 is obtained based on the encoding corresponding to "I" received at time step t1, and the state at time step t2 is obtained based on the encoding corresponding to "love" received at time step t2. Thus, the input information received at time steps t1 and t2 not only affects the current time step but also further affects the next time step. Similarly, the output information of the first neuron at time step t3 corresponds to... Figure 4 The broken line portion in the graph is used to generate the output y at time step t3. The state information of the first neuron at time step t3 corresponds to... Figure 4 The curved portion in the diagram is used to provide information up to time steps t4 and t5. The update method for the latter two time steps is similar and will not be described further here.
[0092] In summary, for the first neuron, the input information at each time step not only affects the current time step, but also further affects the next two time steps (the specific number can be adjusted according to business needs, for example, it can also further affect the next three or even four time steps).
[0093] Furthermore, the input to the second neuron H2 can be "games ■ love me". In this case, the second neuron can be updated directly according to the update method of the first neuron. In this example, the input sequence to the second neuron H2 is still "I love ■ games". However, the update method of the second neuron is different from that of the first neuron. At each time step, the second neuron updates according to the state information of the neuron in the next two time steps. That is, the input information of each second neuron at each time step not only affects the current time step, but also further affects the two time steps before it (the specific number can be adjusted according to business needs, for example, it can also further affect the three or even four time steps before it).
[0094] For the second neuron H2, the output information of the second neuron at time step t5 corresponds to Figure 4 The broken line portion in the graph is used to generate the output y at time step t5. The state information of the second neuron at time step t5 corresponds to... Figure 4 The curved portion in the diagram is used to provide information up to time step t3 and time step t4.
[0095] At time step t4, based on the encoding received at time step t4 and the state information of the second neuron at time step t5, the second neuron's output and state information at time step t4 are calculated using the second neuron's update function. Therefore, the output and state information of the second neuron at time step t4 are related not only to the input at the current time step t4 but also to the state at time step t5. The state at time step t5 is obtained based on the encoding received at time step t5. Thus, the input information received at time step t5 not only affects the current time step but also further affects the previous time step. Similarly, the output information of the second neuron at time step t4 corresponds to... Figure 4 The broken line portion in the graph is used to generate the output y at time step t4. The state information of the second neuron at time step t4 corresponds to... Figure 4 The horizontal curve portion in the middle is used to provide information up to time steps t2 and t3. At time step t3, the second neuron calculates its output and state information at time step t3 using its update function, based on the encoding received at time step t3 and the state information of the second neuron at time steps t4 and t5. Therefore, the output and state information of the second neuron at time step t3 are related not only to the input at the current time step t3, but also to the states at time steps t4 and t5. The state at time step t4 is obtained based on the encoding received at time step t4, and the state at time step t5 is obtained based on the encoding received at time step t5. Thus, the input information received at time steps t4 and t5 not only affects the current time step but also further affects the previous time step. Similarly, the output information of the second neuron at time step t3 corresponds to... Figure 4 The vertical broken line portion in the diagram is used to generate the output y at time step t3. The state information of the second neuron at time step t3 corresponds to... Figure 4 The horizontal curve portion in the diagram is used to provide information up to time step t2 and time step t1. The update method for the first two time steps is similar and will not be described again here.
[0096] Therefore, it can be seen that the second neuron is mainly updated based on the input received at the current time step and the state at several subsequent time steps.
[0097] Furthermore, at any given time step, the output information is determined jointly by the outputs of the first neuron and the second neuron at that time step. In summary, in a bidirectional spiking neural network, the output information at any given time step depends not only on the input and state information of the preceding time steps but also on the input and state information of the following time steps. Therefore, it can better consider the correlation features between preceding and following time steps, leading to more accurate prediction. For example, in the example above, to predict the text content of the blank space in "I love games," prediction can be made not only based on the text before the blank space but also on the text after it, thus improving prediction accuracy.
[0098] Additionally, refer to Figure 5 This disclosure provides an electronic device, which includes:
[0099] One or more processors 101;
[0100] The memory 102 stores one or more programs, which, when executed by one or more processors, enable the one or more processors to implement the task scheduling method described above.
[0101] One or more I / O interfaces 103 are connected between the processor and the memory and configured to enable information exchange between the processor and the memory.
[0102] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read / write interface) 103 is connected between the processor 101 and the memory 102, enabling information exchange between the processor 101 and the memory 102, including but not limited to a data bus (Bus).
[0103] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.
[0104] Additionally, refer to Figure 6 This disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the task scheduling method described in any of the above embodiments.
[0105] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0106] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in connection with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.
Claims
1. A data processing method based on a spiking neural network, wherein, The raw input data to be processed includes: a string to be predicted in the data prediction scenario; the spiking neural network includes: a first neuron and a second neuron; the method includes: For the first neuron, the first output information of the first neuron corresponding to the current time step is calculated according to the first neuron update function; For the second neuron, the second output information corresponding to the current time step is calculated according to the second neuron update function; The first output information of the first neuron corresponding to the current time step and the second output information of the second neuron corresponding to the current time step are integrated, and the data processing result is obtained based on the integrated output result. The first neuron update function is used to: calculate the first state of the first neuron at the current time step and the first output information of the first neuron at the current time step based on the state information of the first neuron corresponding to the previous N time steps and the input information received by the first neuron at the current time step; The second neuron update function is used to: calculate the second state of the second neuron at the current time step and the second output information of the second neuron at the current time step based on the state information of the second neuron corresponding to the next N time steps and the input information received by the second neuron at the current time step; where N is a natural number; The input information received by the first neuron at the current time step includes: sequence information contained in the first pulse sequence, or output information from the previous level neuron of the first neuron; the input information received by the second neuron at the current time step includes: sequence information contained in the second pulse sequence, or output information from the previous level neuron of the second neuron; the first pulse sequence and / or the second pulse sequence are obtained based on the original input data.
2. The method according to claim 1, wherein, The first pulse sequence is obtained by pulse data encoding of the original input data arranged in a forward order; The second pulse sequence is obtained by pulse data encoding of the original input data arranged in reverse order.
3. The method according to any one of claims 1-2, wherein, The integration operation includes: merging the first output information and the second output information, performing an OR operation or an AND operation to obtain the integrated output result.
4. The method according to claim 3, wherein, The first neuron includes multiple neurons located at different levels; the second neuron includes multiple neurons located at different levels. Alternatively, the first neuron may comprise multiple neurons located at the same level; the second neuron may comprise multiple neurons located at the same level.
5. A method for constructing a bidirectional spiking neural network, wherein, The method includes: The first solver solves the preset first neuron dynamics equation to obtain the first neuron update function, and the second solver solves the preset second neuron dynamics equation to obtain the second neuron update function. The first neuron update function and the second neuron update function are integrated into a spiking neural network, and the spiking neural network is trained to obtain a bidirectional spiking neural network; The bidirectional spiking neural network is used to implement the data processing method according to any one of claims 1-4.
6. The method according to claim 5, wherein, The first neuron update function satisfies the following condition: [y(t), states(t)] = First neuron update function(x(t), states(t-Δt)); Where x(t) is the input information of the first neuron at time t, and states(t-Δt) is the state of the first neuron at time t-Δt; y(t) is the output information of the first neuron at time t, and states(t) is the state of the first neuron at time t. The second neuron update function satisfies the following condition: [y(t), states(t)] = Second neuron update function(x(t), states(t+Δt)); Where x(t) is the input information of the second neuron at time t, and states(t+Δt) is the state of the second neuron at time t+Δt; y(t) is the output information of the second neuron at time t, and states(t) is the state of the second neuron at time t.
7. An electronic device comprising: One or more processors; A storage device having stored one or more programs thereon, which, when executed by the one or more processors, cause the one or more processors to implement the method according to any one of claims 1 to 6.
8. A computer-readable medium having a computer program stored thereon, said program, when executed by a processor, implementing at least one of the following methods: The method according to any one of claims 1 to 6.