Construction method of drift spiking neural network for time series prediction and its application

By designing a drift pulse neural network and using time encoding and drift mechanisms to process high-frequency pulses, the problem of insufficient high-frequency pulse processing and memory capabilities of existing models is solved, and more accurate time series predictions are achieved.

CN114781597BInactive Publication Date: 2024-09-06HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210314082.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2024-09-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing time series prediction models such as long short-term memory neural networks lack effective mechanisms when processing high-frequency pulses, and pulse neural networks lack memory capabilities, resulting in poor prediction results.

Method used

A drift spike neural network is designed to process high-frequency spikes by encoding time series data into the firing time of spike neurons, and using non-leakage integration and excitation neurons with exponential kernel functions as well as drift neurons. and long-term memory for time series.

Benefits of technology

It improves the prediction adaptability of the neural network to time series, enhances the learning ability of long-term characteristics, and achieves more accurate and stable prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114781597B
    Figure CN114781597B
Patent Text Reader

Abstract

The present invention belongs to the technical field of time series prediction, and specifically relates to a drift pulse neural network construction method for time series prediction and its application, including: a new encoding method, which converts the original time series into the time when the neuron first emits a pulse; in addition, the network input layer is responsible for converting the encoded z-domain time series data Z(x t ), the cell state C at the previous moment t‑1 and hidden state Z(h t‑1 ), and emits pulses at the corresponding time; the hidden layer contains a forget gate, an input gate, and an output gate. The input of each gate is Z(x t ) and Z(h t‑1 ) corresponding pulse; the pulse generated by the forget gate is used to achieve selective forgetting C t‑1 The pulse generated by the input gate is used to update the cell state at the current moment; the forget gate and the input gate jointly realize the long-term memory ability of the time series; the pulse generated by the output gate corresponds to the hidden state at the current moment. The present invention can effectively solve the time delay problem between input and output neurons and has long-term memory ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of time series prediction, and more specifically, relates to a drift pulse neural network construction method for time series prediction and its application. Background Art

[0002] Time series prediction is of great significance in scientific development, technological breakthroughs, and practical applications. Taking the power system as an example, time series prediction includes power generation prediction, electricity price prediction, and load prediction. This type of time series prediction is beneficial to environmental protection and economic benefits as a whole, to power dispatching and safe operation on the grid side, and to energy use and behavior intervention on the user side, so it has important research value.

[0003] Long short-term memory neural network is the mainstream model for time series prediction. Compared with artificial neural networks, recurrent neural networks and deep neural networks, long short-term memory neural networks can better handle long-term dependencies in time series. Unfortunately, there are often high-frequency pulses in time series, but long short-term memory neural networks lack the corresponding mechanism to track these high-frequency pulses. Spiking neural networks are more similar to the biological structure of the human brain, can handle these high-frequency pulses through special coding strategies, and can predict time series data by issuing and transmitting pulses. There are two main pulse coding methods for existing spike networks. The first is frequency coding, which realizes coding by calculating pulse counts and ratios. Its disadvantage is that discrete pulse counts and pulse ratios will make network training difficult; the second is time coding, which uses the time when pulse neurons emit pulses to encode data. Its disadvantage is that when encoding time series, there is a significant delay in the time interval of pulse emission between input neurons and output neurons. In addition, due to the lack of memory capacity, especially long-term memory capacity, the prediction effect of spike neural networks on time series is only better than that of traditional artificial neural networks of the same scale. Summary of the invention

[0004] In view of the defects of the prior art and the need for improvement, the present invention provides a drift pulse neural network construction method for time series prediction and its application, which aims to improve the long-term prediction adaptability of the neural network for time series with a certain data distribution randomness.

[0005] To achieve the above object, according to one aspect of the present invention, a drift pulse neural network construction method for time series prediction is provided, comprising:

[0006] The values ​​in the time series data are encoded into the time when the spiking neuron emits a pulse and z-transformed to obtain the encoded z-domain time series data; the z-domain time series data Z(x t), iteratively train the synaptic weights of every two neurons connected between adjacent layers in the constructed drift pulse neural network framework to complete the construction of the drift pulse neural network for time series prediction;

[0007] The network framework includes: an input layer, three gates, namely a forget gate, an input gate and an output gate, which are used as hidden layers, two other hidden layers for time correction, and an output layer;

[0008] The input layer is used to calculate the z-domain time series data Z(x t ), the cell state C at the previous moment t-1 and the hidden state Z(h t-1 ), in Z(x t ) emits pulses at corresponding moments;

[0009] The input of each of the three gates is the Z(x t ) and the Z(h t-1 ) corresponding to the pulse, and the pulse generated by the forget gate neuron is consistent with the C t-1 Perform correction calculation to achieve selective forgetting; the input of one hidden layer in the other two hidden layers is the Z(x t ) and the Z(h t-1 ) corresponding to the pulse, the output is the cell state calculated based on the current input It is used to perform correction calculation with the pulse generated by the input gate neuron to advance the pulse emission time of the input gate neuron; the average of the above two correction calculation results is used as the input of another hidden layer in the other two hidden layers, and its output result is the cell state C at the current moment t , to update the cell state, the forget gate and the input gate jointly realize the long-term memory of the time series by forgetting and updating the cell state; the pulses generated by the output gate neurons are connected to C t Perform the Hadamard product to correct the pulse emission time of the output gate neuron and obtain the hidden state Z (h t );

[0010] The output layer is used to calculate the t ) and C t , calculate Z(x t )’s prediction result Z(y t ).

[0011] Furthermore, before the encoding, the method further comprises: collecting time series data L={l h , h∈H}, H={1, 2, ..., H}, H is the number of sampling points in the time series data; the original time series is standardized to obtain the standardized time series The standardization method is:

[0012]

[0013] Among them, l max is the maximum value in the time series, l min is the minimum value in the time series.

[0014] Furthermore, the encoding method is:

[0015]

[0016] Among them, T represents the interval length of the encoded pulse emission time, and its value is a preset value based on the oscillation amplitude of the required network weight update.

[0017] Furthermore, the three gates of the forget gate, the input gate and the output gate are all composed of non-leaky integration and excitation neurons with exponential kernel functions; the other two hidden layers used for time correction are composed of drift neurons, which are pulse neurons that can detect whether there is a delay in the pulse emission time of non-leaky integration and excitation neurons with exponential kernel functions, and are used to correct the neuron pulse emission time; in the z domain, the membrane potential of the drift neuron j The relationship between the input pulse is:

[0018]

[0019] The input-output relationship of drift neuron j is:

[0020]

[0021] Among them, Z ij is the time t when neuron j receives the first pulse emitted by neuron i ij The value in the z domain, w ij is the weight of the synaptic connection from neuron i to neuron j, and C is the pulse input to neuron j at t j The subset of neurons that arrived at j before time t, C∈{1,...,N}, that is, C={i:t i <t j}, t j represents the time when neuron j fires a pulse, t i represents the time when neuron i emits a pulse, t ij =t i Shift j represents the output of drift neuron j, Θ is a step function; θ is the threshold of drift neuron; t dis the drift time, whose value is related to T and the number of neurons in each layer. It is adjusted as a hyperparameter through network training and reflects the amplitude of time correction.

[0022] Furthermore, when performing the iterative training, the approximate derivative of the drift neuron j required to update the synaptic weight is:

[0023]

[0024]

[0025] Where δ is the standard deviation of the normal distribution, θ is the threshold of the neuron, represents the membrane potential of drifting neuron j, w pj represents the synaptic weight from neuron p to neuron j, Z pj represents the synaptic weight from neuron p to neuron j, C is the input pulse at t j The subset of neurons that arrived at j before time.

[0026] Furthermore, the output value Z(f t )=NLIF(W f ·[Z(x t ), Z(h t-1 )]); the output value Z(f i )=NLIF(W i ·[Z(x t ), Z(h t-1 )]); The cell state calculated based on the current input The output value Z(o t )=NLIF(W o ·[Z(x t ), Z(h t-1 )]); The cell state at the current moment The hidden state at the current moment

[0027] in, represents the Hadamard product; C t-1 and They are used to analyze Z(f t ) and Z(i t ) to correct the pulse emission time; Z(x t ) represents the time series data encoded at the current moment, Z(h t-1 ) represents the hidden state of the previous moment, W f represents the weight of the neuron in the forget gate, W i represents the weight of the input gate neuron, W crepresents the weight of the drifting neuron j that calculates the cell state according to the current input, W o represents the weight of the neuron in the output gate, C t-1 represents the cell state at the last moment, Z(i t ) represents the output value of the input gate.

[0028] Furthermore, the encoded z-domain time series data Z(x t )’s prediction result Z(y t )for:

[0029] Z(y t )=NLIF(W y ·Z(h t ))*exp(-0.6);

[0030] Among them, W y Represents the weight of the output layer neurons. exp(-0.6) is used to correct the overall delay in pulse emission time between the input layer and the output layer. The value is related to the length of the time interval T.

[0031] The present invention also provides a time series data prediction method, comprising:

[0032] Using the encoding method described in the drift pulse neural network construction method for time series prediction as described above, the current time series data is encoded to obtain encoded z-domain time series data;

[0033] Based on the encoded z-domain time series data, a drift spiking neural network constructed by the drift spiking neural network construction method for time series prediction as described above is used to obtain a prediction result.

[0034] The present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the drift pulse neural network construction method for time series prediction as described above and / or the time series data prediction method as described above.

[0035] The present invention also provides a server, comprising: a processor, a transceiver, and the computer-readable storage medium as described above, wherein:

[0036] The transceiver is used to send and receive data under the control of the processor;

[0037] When the processor executes the computer program on the computer-readable storage medium, it implements the steps of the drift pulse neural network construction method for time series prediction as described above and / or the steps of the time series data prediction method as described above.

[0038] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

[0039] (1) The present invention designs a time encoding method to convert the original time series into the time when the neuron first pulses. The larger value in the original time series is encoded as the earlier pulse emission time of the corresponding neuron, and the smaller value in the original time series is encoded as the later pulse emission time of the corresponding neuron. During the network learning process, the earlier pulses will first affect the pulse neurons of the hidden layer and the output layer, thereby enhancing the sensitivity to the peak value during the network learning process. Such an encoding method can enable the spiking neural network to better adapt to the prediction problems of different time series.

[0040] (2) The present invention adopts two types of pulse neurons and a drift pulse mechanism. The two types of pulse neurons are a non-leaky integrate and excite neuron with an exponential kernel function and a drift neuron. The former has a piecewise linear derivative characteristic, which is not only conducive to calculation, but also can fit nonlinear characteristics. The latter can detect whether there is a delay in the pulse emission time of the neuron, and realize the correction of the pulse emission time. The drift pulse mechanism enhances the network's ability to learn the long-term characteristics of time series, making the network more suitable for time series prediction. The drift pulse neural network obtained according to the present invention has a drift pulse mechanism, which makes the pulse neural network more adaptable to time series and has the ability to learn long-term characteristics. Therefore, the drift pulse neural network can obtain more accurate and stable prediction results when predicting time series.

[0041] In summary, the present invention provides a drift pulse neural network for time series prediction, which includes: a new time encoding method to encode the original time series and convert it into the time when the neuron first emits a pulse; two types of pulse neurons are used to realize the learning of time series and the correction of pulse emission delay; a drift pulse mechanism is adopted in the network structure, which can effectively solve the time delay problem between input and output neurons and has a certain long-term memory ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of a drift pulse neural network provided by an embodiment of the present invention;

[0043] Figure 2 A schematic diagram of pulse transmission between two adjacent layers of neurons provided by an embodiment of the present invention; DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0045] Embodiment 1

[0046] A drift pulse neural network construction method for time series prediction, comprising:

[0047] The values ​​in the time series data are encoded into the time when the spiking neuron emits a pulse and z-transformed to obtain the encoded z-domain time series data; the z-domain time series data Z(x t ), iteratively train the synaptic weights of every two neurons connected between adjacent layers in the constructed drift pulse neural network framework to complete the construction of the drift pulse neural network for time series prediction;

[0048] Among them, Figure 1 As shown, the above network framework includes: an input layer, three gates, namely, a forget gate, an input gate, and an output gate, which are used as hidden layers, two other hidden layers for time correction, and an output layer;

[0049] The input layer is used to calculate the z-domain time series data Z(x t ), the cell state C at the previous moment t-1 and the hidden state Z(h t-1 ), in Z(x t ) The pulse is emitted at the corresponding moment; the input of each of the three gates is Z(x t ) and Z(h t-1 ) and the pulses generated by the forget gate neurons are the same as C t-1 Perform correction calculation to achieve selective forgetting; the input of one of the other two hidden layers is Z(x t ) and Z(h t-1 ) corresponding to the pulse, the output is the cell state calculated based on the current input It is used to perform correction calculation with the pulse generated by the input gate neuron to advance the pulse emission time of the input gate neuron; the average of the above two correction calculation results is used as the input of another hidden layer in the other two hidden layers, and its output result is the cell state C at the current moment t , to update the cell state, the forget gate and the input gate jointly realize the long-term memory of the time series by forgetting and updating the cell state; the pulses generated by the output gate neurons are connected to C tPerform the Hadamard product to correct the pulse emission time of the output gate neuron and obtain the hidden state Z (h t ); the output layer is used to calculate the t ) and C t , calculate Z(x t )’s prediction result Z(y t ).

[0050] That is, this embodiment provides a drift pulse neural network for time series prediction, which includes: a new time encoding method to encode the original time series and convert it into the time when the neuron first emits a pulse; two types of pulse neurons to achieve learning of the time series and correction of the pulse emission delay; a drift pulse mechanism is adopted in the network structure. The specific learning method is the existing method, which is generally as follows:

[0051] In the training of drift spike neural network, each time a sample Z(x t ), the predicted target, i.e. the label, is Z(x t+1 ). Combined with the cell state C at the previous moment t-1 , the hidden state Z(h t-1 ), calculate the prediction result Z(y t ). Calculate Z(x t+1 ) and Z(y t ) as the prediction error, and update the network weights through the derivative of the spiking neuron. Repeat the above steps of inputting samples, calculating prediction values, and updating weights to achieve the training of the drift spiking neural network. The cell state C at the previous moment t-1 The initial value is 0 vector, and the hidden state Z(h t-1 ) is initialized to 1 vector multiplied by exp(T), where T is the length of the time interval. It is worth mentioning that since there are many network parameters, regularization terms can be added during training to prevent overfitting of parameters.

[0052] It should be noted that the meaning of "drift" in "drift pulse neural network" is: based on the traditional pulse neural network, the pulse firing time of the pulse neurons in this neural network will drift, and whether the pulse firing time needs to drift and the amount of drift are determined by a drift neuron. Compared with the traditional pulse neural network, this drift pulse mechanism can effectively solve the problem of pulse firing time delay caused by pulse transmission.

[0053] Preferably, before the encoding, first, time series data needs to be collected and recorded as L = {l h, h∈H}, where H={1, 2, ..., H}. H is the number of sampling points in the time series data. The original time series is standardized to obtain the standardized time series The normalization formula is as follows:

[0054]

[0055] Among them l max is the maximum value in the time series, l min is the minimum value in the time series. It is the standardized time series data.

[0056] Preferably, in order to adapt the drift pulse neural network to time series data, this embodiment designs a time encoding method to convert the standardized time series The value of is encoded into the time when the spiking neuron fires a pulse, and the encoding method is as follows:

[0057]

[0058] Where T represents the length of the pulse emission time interval after encoding. In order to ensure that the oscillation amplitude of the network weight update is not too large, T=2 can be selected.

[0059] Preferably, the forget gate, input gate and output gate are all composed of nonleaky integrate and fire (NLIF) neurons with exponential kernel functions. Once a neuron in the network has fired a pulse, it will not fire a pulse again until the network is reset (membrane potential reset), that is, the neuron enters an infinite refractory period. Figure 2 As shown, the membrane potential dynamics of NLIF neuron j in the hidden layer or output layer can be expressed as:

[0060]

[0061] in is the membrane potential of neuron j. The right side is the synaptic current. N is the number of neurons in the input layer. ij is the weight of the synaptic connection from neuron i to neuron j, and each weight can be positive or negative. ij is the time when neuron j receives the first pulse emitted by neuron i, where t ij =t i , t i represents the time when neuron i emits a pulse. κ is a synaptic current kernel function:

[0062]

[0063] Where Θ(x) is a step function. If x>0, Θ(x)=1; otherwise Θ(x)=0. τ syn is the membrane potential decay time constant, which can be set to 1 for time normalization.

[0064] Assume that neuron j is at t j The pulse is released at every moment. Based on the above formula, for t<t j , the membrane potential can be obtained by integration:

[0065] Assume that the input pulse is at t j The subset of neurons that reach neuron j before time is C∈{1,...,N}, that is, C={i:t i <t j}. Perform z-transformation Z x =exp(t x ), therefore, the input-output relationship of NLIF neuron j (i.e., t ij and t j The relationship between them is:

[0066]

[0067] Among them, Z ij =exp(t ij ) represents the input received by neuron j from neuron i. The input and output of NLIF neurons in drift spike neural networks are both in the z domain.

[0068] The second type is drift neurons. The other two hidden layers used for time correction are composed of drift neurons j. Drift neurons j are pulse neurons that can detect whether there is a time delay in the pulse emission time of non-leaky integration and excitation neurons with exponential kernel functions, and are used to correct the neuron pulse emission time.

[0069] In the z domain, the membrane potential of the drifting neuron j The relationship between the input pulse is:

[0070]

[0071] The input-output relationship of drift neuron j is:

[0072]

[0073] Among them, Z ij is the time t when neuron j receives the first pulse emitted by neuron i ij The value in the z domain, w ij is the weight of the synaptic connection from neuron i to neuron j, and C is the pulse input to neuron j at t jThe subset of neurons that arrived at j before time t, C∈{1,...,N}, that is, C={i:t i <t j}, t j represents the time when neuron j fires a pulse, t i represents the time when neuron i emits a pulse, t ij =t i Shift j represents the output of drift neuron j, Θ is a step function; θ is the threshold of drift neuron; t d is the drift time, whose value is related to T and the number of neurons in each layer. It is adjusted as a hyperparameter through network training and reflects the amplitude of time correction.

[0074] Preferably, NLIF neurons or drift neurons in the same layer form a gating unit. Shift represents a gating unit formed by multiple drift neurons; NLIF represents a gating unit formed by multiple NLIF neurons. The number of neurons in the gating unit is selected according to the input length and complexity of the time series prediction problem. Figure 1 As shown, the drift pulse neural network includes a drift pulse mechanism input and output and the calculation method is as follows:

[0075] Input: The encoded time series data Z(x t ), the cell state C at the previous moment t-1 , the hidden state Z(h t-1 ).

[0076] The state transmitted to the next moment: the cell state C at the current moment t , the hidden state Z(h t ).

[0077] Output: The prediction result Z(y t ).

[0078] Gating: Forget gate Z(f t ), input gate Z(i t ) and output gate Z(o t ).

[0079] There are three hidden layers consisting of non-leaky integrate and fire neurons with exponential kernel functions, namely the forget gate, input gate and output gate. The input of each gate comes from the encoded z-domain time series data Z(x t ) and the hidden state Z(h t-1 ) corresponding to the pulse, the pulse generated by the forget gate neuron is connected to the cell state C at the previous moment. t-1The function of selective forgetting is realized by performing the Hartmann product. The pulse generated by the input gate neuron is used to update the cell state at the current moment. The forget gate and the input gate jointly realize the long-term memory of the time series by forgetting and updating the cell state. The pulse generated by the output gate neuron is consistent with the cell state C at the current moment. t The Hadamard product is the hidden state Z(h corresponding to the current moment) t ); two hidden layers consisting of drift neurons, one of which has an input of Z(x t ) and Z(h t-1 ) corresponding to the pulse, the output result is the cell state calculated based on the current input It is used to correct the pulse emission time of the input gate neuron; the other input is the mean of the above two Hadamard products, and its output is the cell state C at the current moment. t , which is used to correct the pulse emission time of the output gate neuron. This correction process is realized through the Hartmann product. Among them, the cell state C at the current moment t The long-term information of the time series is stored. t+1 ) is input into the network as the cell state at the previous moment; the hidden state Z(h t ) stores the short-term information of the time series. In the next sample Z(x t+1 ) is input as the hidden state of the previous moment into the network. The output layer is composed of non-leaky integration and excitation neurons with exponential kernel functions, which are used to generate the hidden state Z(h t ) and the current cell state C t , calculate the encoded z-domain time series data Z(x t )’s prediction result Z(y t ). The formula is as follows:

[0080] Z(f t )=NLIF(W f ·[Z(x t ), Z(h t-1 )])

[0081] Z(f i )=NLIF(W i ·[Z(x t ), Z(h t-1 )])

[0082]

[0083] Z(o t )=NLIF(W o ·[Z(x t ), Z(ht-1 )])

[0084]

[0085]

[0086] in, represents the Hartmann product, C t-1 and They are used to analyze Z(f t ) and Z(i t ) to correct the pulse emission time. Z(x t ) represents the time series data encoded at the current moment, Z(h t-1 ) represents the hidden state of the previous moment, W f represents the weight of the neuron in the forget gate, W i represents the weight of the NLIF neuron in the input gate, W c represents the weight of the drifting neuron in the input gate, W o represents the weight of the neuron in the output gate, Z(f t ) represents the output value of the forget gate, C t-1 represents the cell state at the last moment, Z(i t ) represents the output value of the input gate, Represents the cell state calculated based on the current input, Z(o t ) represents the output value of the output gate, C t Indicates the cell state at the current moment (with Compared with the previous moment C t-1 ), Z(h t ) represents the hidden state at the current moment.

[0087] The final prediction result Z(y t )for:

[0088] Z(y t )=NLIF(W y ·Z(h t ))*exp(-0.6)

[0089] Among them, exp(-0.6) is used to correct the overall delay of pulse emission time between the input layer and the output layer, and its value is related to the length of the time interval T. y Represents the weight of the output layer neuron. In order to train the network weight W of the drift spiking neural network, the derivative of the NLIF neuron j in the hidden layer or output layer can be obtained as follows:

[0090]

[0091]

[0092] Preferably, since the derivative of the drift neuron is discontinuous and almost all zero, a normal distribution probability density function is used to approximate the derivative of the step function for error feedback. The approximate function needs to satisfy the maximum value at x=0, and the larger the absolute value of the value at x=x0, the smaller the function value. In addition to meeting the above requirements, the normal distribution probability density function is continuous everywhere, and the function shape can be adjusted by the standard deviation parameter. The approximate derivative of the drift neuron j is:

[0093]

[0094]

[0095] Where δ is the standard deviation of the normal distribution. θ is the threshold of the neuron, represents the membrane potential of drifting neuron j, w pj represents the weight from neuron p to neuron j, Z pj represents the weight from neuron p to neuron j, and C represents the input pulse at t j The subset of neurons that arrived at j before time.

[0096] Embodiment 2

[0097] A time series data prediction method, comprising:

[0098] Using the encoding method described in the drift pulse neural network construction method for time series prediction as described above, the current time series data is encoded to obtain encoded z-domain time series data;

[0099] Based on the encoded z-domain time series data, a drift pulse neural network constructed by a drift pulse neural network construction method for time series prediction as described in Example 1 is used to obtain a prediction result.

[0100] It should be noted that according to the designed time encoding method, the predicted result Z(y t ) to decode the predicted value of the standardized time series:

[0101]

[0102] Then perform an inverse normalization transformation to obtain the predicted value of the original time series. The formula is as follows:

[0103]

[0104] Based on the drift pulse neural network designed by the present invention, the prediction of time series can be realized.

[0105] Embodiment 3

[0106] A computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute a drift pulse neural network construction method for time series prediction as described above and / or a time series data prediction method as described above.

[0107] The relevant technical solutions are the same as those in Embodiment 1 and Embodiment 2 and will not be described in detail here.

[0108] Embodiment 4

[0109] A server, comprising: a processor, a transceiver, and the computer-readable storage medium as described above, wherein:

[0110] The transceiver is used to send and receive data under the control of the processor;

[0111] When the processor executes the computer program on the computer-readable storage medium, it implements the steps of the drift pulse neural network construction method for time series prediction as described above and / or the steps of the time series data prediction method as described above.

[0112] The relevant technical solutions are the same as those in Embodiment 1 and Embodiment 2 and will not be described in detail here.

[0113] In summary, the present invention proposes a drift pulse neural network for time series prediction, which performs pulse time encoding on time series and realizes the prediction of time series, providing ideas and improvements for the application of pulse neural networks and providing technical support for time series prediction. Compared with the existing pulse neural network, the pulse neural network adopts a drift pulse mechanism, which effectively solves the time delay problem between input and output by correcting the pulse emission time, and has a certain long-term memory ability, which is more suitable for time series prediction problems.

[0114] It should be noted that the time series data of the present invention can be the time series data of the power system, including power generation, electricity price and load. In specific applications, the relevant time series data can be directly time-encoded and used for training and prediction applications of drift pulse neural networks. The specific training and prediction application methods are the same as the method proposed in the present invention.

[0115] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for constructing a drift pulse neural network for time series prediction, characterized in that: include: Encode the values ​​in the time series data into the time when the spiking neuron fires a pulse and perform a z-transform to obtain the encoded z-domain time series data; Using z-domain time series data Z(x t ), iteratively train the synaptic weights of every two neurons connected between adjacent layers in the constructed drift pulse neural network framework to complete the construction of the drift pulse neural network for time series prediction; The network framework includes: an input layer, three gates, namely a forget gate, an input gate and an output gate, which are used as hidden layers, two other hidden layers for time correction, and an output layer; The input layer is used to calculate the z-domain time series data Z(x t ), the cell state C at the previous moment t-1 and the hidden state Z(h t-1 ), in Z(x t ) emits pulses at corresponding moments; The input of each of the three gates is the Z(x t ) and the Z(h t-1 ) corresponding to the pulse, and the pulse generated by the forget gate neuron is consistent with the C t-1 Perform correction calculation to achieve selective forgetting; the input of one hidden layer in the other two hidden layers is the Z(x t ) and the Z(h t-1 ) corresponding to the pulse, the output is the cell state calculated based on the current input It is used to perform correction calculation with the pulse generated by the input gate neuron to advance the pulse emission time of the input gate neuron; the average of the above two correction calculation results is used as the input of another hidden layer in the other two hidden layers, and its output result is the cell state C at the current moment t , to update the cell state, the forget gate and the input gate jointly realize the long-term memory of the time series by forgetting and updating the cell state; the pulses generated by the output gate neurons are connected to C t Perform the Hadamard product to correct the pulse emission time of the output gate neuron and obtain the hidden state Z (h t ); The output layer is used to calculate the t ) and C t , calculate Z(x t )’s prediction result Z(y t ).

2. The method for constructing a drift pulse neural network according to claim 1, characterized in that: Before the encoding, the method further comprises: collecting time series data L={l h ,h∈H}, H={1,2,…,H}, H is the number of sampling points in the time series data; the original time series is standardized to obtain the standardized time series The standardization method is: Among them, l max is the maximum value in the time series, l min is the minimum value in the time series.

3. The method for constructing a drift pulse neural network according to claim 1 or 2, characterized in that: The encoding method is: Among them, T represents the interval length of the encoded pulse emission time, and its value is a preset value based on the oscillation amplitude of the required network weight update.

4. The method for constructing a drift pulse neural network according to claim 1, characterized in that: The three gates of the forget gate, the input gate and the output gate are all composed of non-leaky integration and excitation neurons with exponential kernel functions; the other two hidden layers for time correction are composed of drift neurons, which are pulse neurons that can detect whether there is a time delay in the pulse emission time of the non-leaky integration and excitation neurons with exponential kernel functions, and are used to correct the neuron pulse emission time; In the z domain, the membrane potential of drifting neuron j The relationship between the input pulse is: The input-output relationship of drift neuron j is: Among them, Z ij is the time t when neuron j receives the first pulse emitted by neuron i ij The value in the z domain, w ij is the weight of the synaptic connection from neuron i to neuron j, C is the pulse input to neuron j at t j The subset of neurons that arrived at j before time t, C∈{1,…,N}, that is, C={i:t i <t j }, t j represents the time when neuron j fires a pulse, t i represents the time when neuron i emits a pulse, t ij =t i Shift j represents the output of drift neuron j, Θ is a step function; θ is the threshold of drift neuron; t d is the drift time, whose value is related to T and the number of neurons in each layer. It is adjusted as a hyperparameter through network training and reflects the amplitude of time correction.

5. The method for constructing a drift pulse neural network according to claim 4, characterized in that: When performing the iterative training, the approximate derivative of the drift neuron j required to update the synaptic weight is: Where δ is the standard deviation of the normal distribution, θ is the threshold of the neuron, represents the membrane potential of drifting neuron j, w pj represents the synaptic weight from neuron p to neuron j, Z pj represents the synaptic weight from neuron p to neuron j, and C is the input pulse at t j The subset of neurons that arrived at j before time.

6. The method for constructing a drift pulse neural network according to claim 1, characterized in that: The output value Z(f t )=NLIF(W f ·[Z(x t ),Z(h t-1 )]); the output value Z(f i )=NLIF(W i ·[Z(x t ),Z(h t-1 )]); The cell state calculated based on the current input The output value Z(o t )=NLIF(W o ·[Z(x t ),Z(h t-1 )]); The cell state at the current moment The hidden state at the current moment in, represents the Hadamard product; C t-1 and They are used to analyze Z(f t ) and Z(i t ) to correct the pulse emission time; Z(x t ) represents the time series data encoded at the current moment, Z(h t-1 ) represents the hidden state of the previous moment, W f represents the weight of the neuron in the forget gate, W i represents the weight of the input gate neuron, W c represents the weight of the drifting neuron j that calculates the cell state according to the current input, W o represents the weight of the neuron in the output gate, C t-1 represents the cell state at the last moment, Z(i t ) represents the output value of the input gate.

7. The method for constructing a drift pulse neural network according to claim 6, characterized in that: For the encoded z-domain time series data Z(x t )’s prediction result Z(y t )for: Z(y t )=NLIF(W y ·Z(h t ))*exp(-0.6); Among them, W y Represents the weight of the output layer neurons. exp(-0.6) is used to correct the overall delay in pulse emission time between the input layer and the output layer. The value is related to the length of the time interval T.

8. A time series data prediction method, characterized in that: include: Adopting the encoding method described in the drift pulse neural network construction method for time series prediction according to any one of claims 1 to 7, encoding the current time series data to obtain encoded z-domain time series data; Based on the encoded z-domain time series data, a drift pulse neural network constructed by the drift pulse neural network construction method for time series prediction as described in any one of claims 1 to 7 is used to obtain a prediction result.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed by the processor, the device where the storage medium is located is controlled to execute a drift pulse neural network construction method for time series prediction as described in any one of claims 1 to 7 and / or a time series data prediction method as described in claim 8.

10. A server, characterized in that: include: A processor, a transceiver, and a computer-readable storage medium as claimed in claim 9, wherein: The transceiver is used to send and receive data under the control of the processor; When the processor executes the computer program on the computer-readable storage medium, it implements the steps of a drift pulse neural network construction method for time series prediction as described in any one of claims 1 to 7 and / or the steps of a time series data prediction method as described in claim 8.