Spike-bp on-chip learning method and system based on ca-lif neuron model and processor
By using the Ca-LIF neuron model and the calcium-gated bipolar leakage integral ignition mechanism, the computation process is simplified, solving the problems of high resource consumption and poor performance in existing SNN training, and achieving low-power, high-efficiency on-chip learning and performance improvement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV
- Filing Date
- 2023-05-29
- Publication Date
- 2026-04-21
AI Technical Summary
Existing exponential leakage LIF neuron models are computationally complex and resource-intensive, making it difficult to implement efficient SNN training in hardware design. Furthermore, the existing Spike-BP algorithm still lags behind ANN in performance and cannot effectively port high-recognition-rate error backpropagation algorithms.
By employing the Ca-LIF neuron model, and through trainable linear leakage parameters and a calcium-gated bipolar leakage integral ignition mechanism, the computation process is simplified, complex threshold and weight normalization operations are avoided, and low-power on-chip learning is achieved.
It reduces hardware resource consumption, improves learning speed and performance, effectively approximates the ReLU function, realizes the porting of the backpropagation algorithm in ANN to SNN, and improves the training efficiency of spiking neural networks.
Smart Images

Figure CN116629344B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of microprocessor technology, specifically relating to an on-chip learning method, system, and processor based on the Ca-LIF neuron model, called Spike-BP. Background Technology
[0002] In recent years, artificial intelligence and deep learning have been widely applied in fields such as facial recognition, speech recognition, industrial product inspection, target tracking, and autonomous driving. Traditional Artificial Neural Network (ANN) models require all neurons to participate in synchronous, intensive computation, and are implemented using general-purpose CPUs and GPUs, resulting in high power consumption and slow processing speeds. Even with dedicated acceleration chips, energy efficiency remains unsatisfactory. In contrast, Spiking Neural Networks (SNNs) simulate the working mechanism of the human brain, encoding, transmitting, and processing data based on spatiotemporally sparse pulse signals, thus mimicking the energy-efficient cognitive mechanisms of the human cerebral cortex. Compared to ANNs, SNNs are closer to the biological structure and operating mechanism of the brain. They are considered to have a superior ability to capture temporal dynamic information from complex and ever-changing environments. Furthermore, because pulses are sparse in the time domain, neurons in SNNs can only operate when a pulse arrives at their synapse, thus achieving energy-efficient "asynchronous" computation.
[0003] On the one hand, while mainstream SNN algorithms have low computational complexity, their performance still lags behind ANN, primarily due to the lack of suitable and efficient training algorithms. On the other hand, although some algorithms can match the performance of ANN training algorithms, their complexity makes them unsuitable for on-chip learning implementation in hardware design.
[0004] The existing exponential leakage LIF neuron models are as follows:
[0005]
[0006] Among them, V j (t) represents the membrane potential of the j-th LIF neuron at the current time step, V j (t-1) represents the membrane potential of the j-th LIF neuron in the previous time step, τ is the membrane potential decay coefficient, and w ij x represents the synaptic weight connecting the i-th Ca-LIF neuron in the previous layer and the j-th neuron in the current layer. i (t) represents the input pulse of the i-th LIF neuron at the current time step. If the input pulse at the current time step is a positive pulse, then x i (t) = +1, if the input pulse at the current time step is a negative pulse, then xi (t) = -1. This exponential leakage LIF neuron model combines τ with V... j Multiplying by (t-1) to perform the leakage operation will consume a large amount of computational resources for subsequent hardware design. Furthermore, in this exponential leakage LIF neuron model, the LIF neurons involved, when their membrane potential V... j (t) is greater than or equal to the preset membrane potential threshold V th At one time, a pulse is emitted, simultaneously setting the membrane electrode to zero; while when its membrane potential V... j When (t) is a large negative value, it is impossible to emit a "negative" pulse to transmit the information and cancel out the positive pulse emitted earlier. As a result, the number of pulses cannot statistically approach the characteristics of the ReLU function commonly used in ANNs. Therefore, it is impossible to transplant the mature and high-recognition-rate error backpropagation algorithm in the ANN field to deep SNN learning.
[0007] The existing Spike-BP (i.e., spike backpropagation) synaptic weight update derivative path is as follows:
[0008]
[0009] Where, Δw m It is the synaptic weight update matrix of the m-th layer. The output a of the m-th layer m LIF (t) with respect to membrane potential V m The gradient of (t), γ is the total number of output pulses within the time window T, τ is the membrane potential decay coefficient, and t k It represents the emission time of the k-th pulse before time step t, and e is the natural exponent. Here, we can see the LIF neuron's... The solution is too complex and involves the calculation of the natural exponent e, which increases the computational complexity of the algorithm and greatly increases the resource consumption for hardware design. Summary of the Invention
[0010] The purpose of this invention is to provide a Spike-BP on-chip learning method, system, and processor based on the Ca-LIF neuron model, so as to achieve low-power on-chip learning and improve the performance of spiking neural network training.
[0011] The Spike-BP on-chip learning method based on the Ca-LIF neuron model described in this invention, used for training spiking neural networks, includes:
[0012] Step 1: Rate encoding is performed on the input image to convert the static frame image into pulse form, which is regarded as the input pulse of the input layer of the spiking neural network. The spiking neural network is composed of Ca-LIF neurons, and the Ca-LIF neurons in different layers are connected through synaptic weights to transmit pulses.
[0013] Step 2: Perform forward propagation based on the Ca-LIF neuron model, transmitting the input pulses from the input layer to the output layer L, and obtaining the membrane potential matrix V of the output layer L at the last time step. L (T). In this model, the output layer L of the spiking neural network does not emit pulses, and the Ca-LIF neuron model is as follows:
[0014]
[0015] V j (t) represents the membrane potential of the j-th Ca-LIF neuron at the current time step, V j (t-1) represents the membrane potential of the j-th Ca-LIF neuron in the previous time step, w ij x represents the synaptic weight connecting the i-th Ca-LIF neuron in the previous layer and the j-th Ca-LIF neuron in the current layer. i (t) represents the input pulse of the i-th Ca-LIF neuron at the current time step, b j Let x represent the trainable linear leakage parameter of the j-th Ca-LIF neuron, T represent the time window length, j take any integer from 1 to n, and n represent the total number of Ca-LIF neurons in each layer; if the input pulse at the current time step is a positive pulse, then x i (t) = +1, if the input pulse at the current time step is a negative pulse, then x i (t) = -1.
[0016] Step 3: Calculate the loss function E with respect to the membrane potential matrix V of the output layer L at the last time step. L The gradient matrix δ of (T) L .
[0017] Step 4: Perform spike-back propagation (i.e., Spike-BP) using the gradient matrix δ. L Iteratively calculate the gradient matrix of the loss function E with respect to the membrane potential matrix of the hidden layer.
[0018] Step 5: Calculate the synaptic weight update matrix and the linear leakage parameter update matrix for the output layer L and the hidden layer.
[0019] Step 6: Update the synaptic weight matrix and linear leakage parameter matrix of the output layer L and the hidden layer based on the learning rate, the synaptic weight update matrix of the output layer L and the hidden layer, and the linear leakage parameter update matrix.
[0020] Step 7: Repeat steps 1 through 6 until the training of the spiking neural network is complete.
[0021] Preferably, during the ignition phase, when V j (t)≥V th At that time, the j-th Ca-LIF neuron emits a positive pulse, and by subtracting V th To reset its membrane potential; during the ignition phase, when V j (t)≤-V th And satisfy the gating condition y S When (t-1)>0, the j-th Ca-LIF neuron emits a negative pulse, and by adding V th To reset its membrane potential. Wherein, V th V represents the preset membrane potential threshold. th >0, y S (t-1) represents the arithmetic sum of the number of pulses in the previous time step, y S (t-1) equals the cumulative number of positive pulses in the previous time step minus the cumulative number of negative pulses. S (t-1) is similar to the calcium ion concentration in biological neurons (i.e., Ca). + When the concentration of calcium ions outside the cell is greater than the concentration of calcium ions inside the cell, the cell membrane can maintain normal nerve conduction function.
[0022] Preferably, during the integration and leakage phases, the Ca-LIF neuron accumulates the product of the input pulses and the synaptic weights to obtain a weighted sum, and the leakage operation is achieved through a trainable linear leakage parameter.
[0023] Preferably, in step three, the formula is used: Calculate the loss function E with respect to the membrane potential matrix V of the output layer L at the last time step. L The gradient matrix δ of (T) L Wherein, loss is the error loss of the j-th Ca-LIF neuron in the output layer L. j The matrix formed, loss j =output j -label j ,output j The label represents the output of the j-th Ca-LIF neuron in output layer L. j This indicates the corresponding one-hot tag.
[0024] Preferably, in step four, the formula is used: Calculate the loss function E with respect to the membrane potential matrix V of the hidden layer l. l The gradient matrix δ of (t) l Where l takes all integers from L-1 to 2, and Tr represents the transpose; w l Let w be the synaptic weight matrix of hidden layer l, consisting of the synaptic weights w connecting the i-th Ca-LIF neuron in hidden layer l-1 and the j-th Ca-LIF neuron in hidden layer l. ij composition.
[0025] Preferably, in step four, the formula is used: Calculate the loss function E with respect to the membrane potential matrix V of hidden layer 1. 1 The gradient matrix δ of (t) 1 Among them, w 1 The synaptic weight matrix of hidden layer 1 consists of the synaptic weights w connecting the i-th neuron in the input layer and the j-th neuron in hidden layer 1. ij Composition; δ 2 Let the loss function E be the membrane potential matrix V of hidden layer 2. 2 The gradient matrix of (t).
[0026] Preferably, in step five, the formula is used: Calculate the synaptic weight update matrix Δw of the output layer L. L ;where x L (T) represents the input pulse matrix of each Ca-LIF neuron in the output layer L.
[0027] Preferably, in step five, the formula is used: Calculate the linear leakage parameter update matrix Δb of the output layer L. L .
[0028] Preferably, in step five, the formula is used: Calculate the synaptic weight update matrix Δw of hidden layer l l ;where x l (t) represents the input pulse matrix of each Ca-LIF neuron in hidden layer l.
[0029] Preferably, in step five, the formula is used: Calculate the linear leakage parameter update matrix Δb of hidden layer l. l .
[0030] Preferably, in step five, the formula is used: Calculate the synaptic weight update matrix Δw of hidden layer 1. 1 ;where x 1(t) represents the input pulse matrix of each Ca-LIF neuron in hidden layer 1.
[0031] Preferably, in step five, the formula is used: Calculate the linear leakage parameter update matrix Δb of hidden layer 1. 1 .
[0032] Preferably, in step six, the method for updating the synaptic weight matrix of the output layer L is as follows: The synaptic weight matrix w of the output layer L... L Updated to w L -lr*Δw L Among them, w L The synaptic weight w connecting the i-th neuron in hidden layer L-1 and the j-th neuron in output layer L ij The components are: lr represents the learning rate.
[0033] Preferably, in step six, the method for updating the linear leakage parameter matrix of the output layer L is as follows: The linear leakage parameter matrix b of the output layer L is updated... L Updated to b L -lr*Δb L Among them, b L The trainable linear leakage parameter b of the j-th Ca-LIF neuron in the output layer L j composition.
[0034] Preferably, in step six, the method for updating the synaptic weight matrix of hidden layer l is as follows: The synaptic weight matrix w of hidden layer l is... l Updated to w l -lr*Δw l .
[0035] Preferably, in step six, the method for updating the linear leakage parameter matrix of hidden layer l is as follows: The linear leakage parameter matrix b of hidden layer l is updated... l Updated to b l -lr*Δb l Among them, b l The trainable linear leakage parameter b of the j-th Ca-LIF neuron in hidden layer l j composition.
[0036] Preferably, in step six, the method for updating the weight matrix of hidden layer 1 is as follows: the synaptic weight matrix w of hidden layer 1 is updated. 1 Updated to w 1 -lr*Δw 1 .
[0037] Preferably, in step six, the method for updating the linear leakage parameter matrix of hidden layer 1 is as follows: The linear leakage parameter matrix b of hidden layer 1 is updated... 1 Updated to b 1 -lr*Δb 1 Among them, b 1 The trainable linear leakage parameter b of the j-th Ca-LIF neuron in hidden layer 1 j composition.
[0038] The Spike-BP on-chip learning system based on the Ca-LIF neuron model described in this invention is used to perform on-chip learning according to the Spike-BP on-chip learning method based on the Ca-LIF neuron model, and to form a corresponding spiking neural network.
[0039] The Spike-BP on-chip learning processor based on the Ca-LIF neuron model described in this invention integrates the aforementioned Spike-BP on-chip learning system based on the Ca-LIF neuron model.
[0040] Compared to existing deep SNN learning algorithms for exponentially leaky LIF models, the Ca-LIF neuron model and Spike-BP method proposed in this invention avoid complex threshold and weight normalization operations as well as exponential leakage balance compensation operations, which can save a lot of hardware resources and improve learning speed.
[0041] The present invention has the following effects:
[0042] (1) A trainable linear leakage parameter is used, which only needs to be subtracted for the Ca-LIF neuron model. This enables linear leakage operations, which saves a significant amount of computational resources in subsequent hardware design compared to the multiplicative leakage operations used in existing LIF neuron models.
[0043] (2) Trainable linear leakage parameters are used to implement leakage operation, avoiding complex leakage compensation operation when solving gradient matrix, greatly reducing hardware implementation complexity, realizing low-power on-chip learning, and improving the performance of spiking neural network training.
[0044] (3) The Ca-LIF neuron model is a calcium-gated bipolar leaky integrate & fire (Ca-LIF) neuron model. It adopts a positive and negative dual-channel pulse emission mechanism based on calcium gating, which statistically allows the arithmetic sum of the number of bipolar pulses to better approximate the ReLU function. Furthermore, the backpropagation algorithm in the ANN field is ported to SNN to realize on-chip learning, thereby improving the performance of spiking neural network training. Attached Figure Description
[0045] Figure 1 This is a flowchart of the Spike-BP on-chip learning method based on the Ca-LIF neuron model in this embodiment.
[0046] Figure 2 This is a diagram of the Ca-LIF neuron model in this embodiment.
[0047] Figure 3 This is a schematic diagram of pulse back propagation in this embodiment. Detailed Implementation
[0048] like Figure 1 As shown, the Spike-BP on-chip learning method based on the Ca-LIF neuron model in this embodiment is used for training a spiking neural network, and includes the following steps:
[0049] Step 1: Rate encoding is performed on the input image, converting the static frame image into pulse form, which is regarded as the input pulse of the input layer of the spiking neural network. The spiking neural network is composed of Ca-LIF neurons, and Ca-LIF neurons in different layers are connected through synaptic weights to transmit pulses.
[0050] Step 2: Perform forward propagation based on the Ca-LIF neuron model, transmitting the input pulses from the input layer to the output layer L, and obtaining the membrane potential matrix V of the output layer L at the last time step. L (T). In this model, the output layer L of the spiking neural network does not emit pulses; the Ca-LIF neuron model (see...) Figure 2 )for:
[0051]
[0052] V j (t) represents the membrane potential of the j-th Ca-LIF neuron at the current time step, V j (t-1) represents the membrane potential of the j-th Ca-LIF neuron in the previous time step, and the initial value of the membrane potential V of the j-th Ca-LIF neuron. j (0) = 0, w ij x represents the synaptic weight connecting the i-th Ca-LIF neuron in the previous layer and the j-th Ca-LIF neuron in the current layer. i (t) represents the input pulse of the i-th Ca-LIF neuron at the current time step, b j Let x represent the trainable linear leakage parameter of the j-th Ca-LIF neuron, T represent the time window length, j take any integer from 1 to n, and n represent the total number of Ca-LIF neurons in each layer. If the input pulse at the current time step is a positive pulse, then x i(t) = +1, if the input pulse at the current time step is a negative pulse, then x i (t) = -1.
[0053] Step 3: Calculate the loss function E against V L The gradient matrix δ of (T) L Specifically, using the formula: Calculate the loss function E against the membrane potential matrix V L The gradient matrix δ of (T) L Wherein, loss is the error loss of the j-th Ca-LIF neuron in the output layer L. j The matrix formed, loss j =output j -label j ,output j The label represents the output of the j-th Ca-LIF neuron in output layer L. j This indicates the corresponding one-hot tag, V th V represents the preset membrane potential threshold. th >0.
[0054] The derivation process is as follows: (Setting) If the loss function E uses mean squared error, then the loss function E affects the output of the j-th Ca-LIF neuron in the output layer L. j The gradient is:
[0055]
[0056] because For the j-th Ca-LIF neuron in the output layer L The matrix formed, V L (T) is the membrane potential V of the j-th neuron in the output layer L at the last time step. j (T) constitutes; therefore,
[0057] Using the chain rule of differentiation, we obtain the membrane potential matrix V of the loss function E with respect to the output layer L at the last time step. L The gradient matrix of (T):
[0058]
[0059] Step 4: Perform spike-back propagation (i.e., Spike-BP) using the gradient matrix δ. L Iteratively calculate the gradient matrix of the loss function E with respect to the membrane potential matrix of the hidden layer (see...). Figure 3 Specifically:
[0060] Using the formula: Calculate the loss function E with respect to the membrane potential matrix V of the hidden layer l. l The gradient matrix δ of (t) l Where l takes all integers from L-1 to 2, Tr represents the transpose; w l Let w be the synaptic weight matrix of hidden layer l, consisting of the synaptic weights w connecting the i-th Ca-LIF neuron in hidden layer l-1 and the j-th Ca-LIF neuron in hidden layer l. ij composition. Figure 3 Convolutional layer 2 in the above is equivalent to hidden layer 2 in this embodiment. Figure 3 In the diagram, fully connected layers l-1, l, ..., L-1 are all hidden layers, and fully connected layer L-1 is equivalent to hidden layer L-1.
[0061] The derivation process is as follows: (Setting)
[0062] The output of hidden layer l The gradient matrix is:
[0063] Using the chain rule of differentiation, we obtain the membrane potential matrix V of the loss function E with respect to the hidden layer l. l The gradient matrix of (t):
[0064]
[0065] Using the formula: Calculate the loss function E with respect to the membrane potential matrix V of hidden layer 1. 1 The gradient matrix δ of (t) 1 Among them, w 1 For hidden layer 1 (i.e. Figure 3 The synaptic weight matrix of convolutional layer 1 is composed of the synaptic weights w connecting the i-th neuron in the input layer and the j-th neuron in hidden layer 1. ij Composition; δ 2 Let the loss function E be the membrane potential matrix V of hidden layer 2. 2 The gradient matrix of (t).
[0066] Step 5: Calculate the synaptic weight update matrix and the linear leakage parameter update matrix for the output layer L and the hidden layers. Specifically:
[0067] Using the formula: Calculate the synaptic weight update matrix Δw of the output layer L. L Using the formula: Calculate the linear leakage parameter update matrix Δb of the output layer L. L .
[0068] Among them, w Lw represents the synaptic weight matrix of the output layer L. L The synaptic weight w connecting the i-th neuron in hidden layer L-1 and the j-th neuron in output layer L ij Composition; b L Let b represent the linear leakage parameter matrix of the output layer L. L The trainable linear leakage parameter b of the j-th Ca-LIF neuron in the output layer L j Composition; x L (T) represents the input pulse matrix of each Ca-LIF neuron in the output layer L (composed of multiple +1 and -1 values. If the input pulse of a Ca-LIF neuron is a positive pulse, the corresponding value in the input pulse matrix is +1; if the input pulse of a Ca-LIF neuron is a negative pulse, the corresponding value in the input pulse matrix is -1).
[0069] The derivation process is as follows: (Setting)
[0070] Using the chain rule for differentiation, we get
[0071]
[0072]
[0073] Using the formula: Calculate the synaptic weight update matrix Δw of hidden layer l l Using the formula: Calculate the linear leakage parameter update matrix Δb of hidden layer l. l .
[0074] Among them, b l The trainable linear leakage parameter b of the j-th Ca-LIF neuron in hidden layer l j Composition; x l (t) represents the input pulse matrix of each Ca-LIF neuron in hidden layer l (composed of multiple +1 and -1 values. If the input pulse of a Ca-LIF neuron is a positive pulse, the corresponding value in the input pulse matrix is +1; if the input pulse of a Ca-LIF neuron is a negative pulse, the corresponding value in the input pulse matrix is -1).
[0075] The derivation process is as follows: (Setting)
[0076] Using the chain rule for differentiation, we get
[0077]
[0078]
[0079] Using the formula: Calculate the synaptic weight update matrix Δw of hidden layer 1. 1 Using the formula: Calculate the linear leakage parameter update matrix Δb of hidden layer 1. 1 Among them, x 1 (t) represents the input pulse matrix of each Ca-LIF neuron in hidden layer 1 (composed of multiple +1 and -1 values. If the input pulse of a Ca-LIF neuron is a positive pulse, the corresponding value in the input pulse matrix is +1; if the input pulse of a Ca-LIF neuron is a negative pulse, the corresponding value in the input pulse matrix is -1).
[0080] Step 6: Update the synaptic weight matrix and linear leakage parameter matrix of the output layer L and hidden layers based on the learning rate, the synaptic weight update matrix of the output layer L and hidden layers, and the linear leakage parameter update matrix, thereby obtaining the updated w. ij and b j .
[0081] Update the synaptic weight matrix of the output layer L (i.e., update w). L w in ij The method is as follows: The synaptic weight matrix w of the output layer L... L Updated to w L -lr*Δw L Where lr represents the learning rate. The linear leakage parameter matrix of the output layer L is updated (i.e., b is updated). L b j The method is as follows: The linear leakage parameter matrix b of the output layer L... L Updated to b L -lr*Δb L .
[0082] Update the synaptic weight matrix of hidden layer l (i.e., update w). l w in ij The method is as follows: The synaptic weight matrix w of hidden layer l... l Updated to w l -lr*Δw l Update the linear leakage parameter matrix of hidden layer l (i.e., update b). l b j The method is as follows: The linear leakage parameter matrix b of the hidden layer l... l Updated to b l -lr*Δb l .
[0083] Update the weight matrix of hidden layer 1 (i.e., update w). 1 w in ijThe method is as follows: The synaptic weight matrix w of hidden layer 1... 1 Updated to w 1 -lr*Δw 1 Update the linear leakage parameter matrix of hidden layer 1 (i.e., update b). 1 b j The method is as follows: The linear leakage parameter matrix b of hidden layer 1... 1 Updated to b 1 -lr*Δb 1 Among them, b 1 The trainable linear leakage parameter b of the j-th Ca-LIF neuron in hidden layer 1 j composition.
[0084] Step 7: Repeat steps 1 through 6 until the training of the spiking neural network is complete.
[0085] In the aforementioned Ca-LIF neuron model, during the ignition phase, when V j (t)≥V th At that time, the j-th Ca-LIF neuron emits a positive pulse, and by subtracting V th To reset its membrane potential; when V j (t)≤-V th And satisfy the gating condition y S When (t-1)>0, the j-th Ca-LIF neuron emits a negative pulse, and by adding V th To reset its membrane potential. Where, y S (t-1) represents the arithmetic sum of the number of pulses in the previous time step, y S (t-1) equals the cumulative number of positive pulses in the previous time step minus the cumulative number of negative pulses. S (t-1) is similar to the calcium ion concentration in biological neurons (i.e., Ca). + When the extracellular calcium ion concentration is greater than the intracellular calcium ion concentration, the cell membrane can maintain normal nerve conduction function. During the integration and leakage phases, Ca-LIF neurons accumulate the product of input impulses and synaptic weights, obtain a weighted sum, and implement the leakage operation through trainable linear leakage parameters.
[0086] This embodiment also provides a Spike-BP on-chip learning system based on the Ca-LIF neuron model. This system is used to perform on-chip learning according to the Spike-BP on-chip learning method based on the Ca-LIF neuron model described above, and to form a corresponding spiking neural network.
[0087] This embodiment also provides a Spike-BP on-chip learning processor based on the Ca-LIF neuron model, which integrates the aforementioned Spike-BP on-chip learning system based on the Ca-LIF neuron model.
Claims
1. A Spike-BP on-chip learning method based on the Ca-LIF neuron model for training spiking neural networks, characterized in that, include: Step 1: Rate encoding is performed on the input image to convert the static frame image into a pulse form, which is regarded as the input pulse of the input layer of the spiking neural network. The spiking neural network is composed of Ca-LIF neurons, and the Ca-LIF neurons in different layers are connected through synaptic weights to transmit pulses. Step 2: Perform forward propagation based on the Ca-LIF neuron model, transmitting the input pulses from the input layer to the output layer L, and obtaining the membrane potential matrix V of the output layer L at the last time step. L (T); where the output layer L of the spiking neural network does not emit pulses, and the Ca-LIF neuron model is: V j (t) represents the membrane potential of the j-th Ca-LIF neuron at the current time step, V j (t-1) represents the membrane potential of the j-th Ca-LIF neuron in the previous time step, w ij x represents the synaptic weight connecting the i-th Ca-LIF neuron in the previous layer and the j-th Ca-LIF neuron in the current layer. i (t) represents the input pulse of the i-th Ca-LIF neuron at the current time step, b j Let represent the trainable linear leakage parameter of the j-th Ca-LIF neuron, T represent the time window length, j take any integer from 1 to n, and n represent the total number of Ca-LIF neurons in each layer. Step 3: Calculate the loss function E with respect to the membrane potential matrix V. L The gradient matrix δ of (T) L ; Step 4: Perform pulse backpropagation, using the gradient matrix δ L Iteratively calculate the gradient matrix of the loss function E with respect to the membrane potential matrix of the hidden layer; Step 5: Calculate the synaptic weight update matrix and the linear leakage parameter update matrix for the output layer L and the hidden layers; Step 6: Update the synaptic weight matrix and linear leakage parameter matrix of the output layer L and the hidden layer based on the learning rate, the synaptic weight update matrix of the output layer L and the hidden layer, and the linear leakage parameter update matrix. Step 7: Repeat steps 1 through 6 until the training of the spiking neural network is complete.
2. The Spike-BP on-chip learning method based on the Ca-LIF neuron model according to claim 1, characterized in that: During the ignition phase, when V j (t)≥V th At that time, the j-th Ca-LIF neuron emits a positive pulse, and by subtracting V th To reset its membrane potential; During the ignition phase, when V j (t)≤-V th And satisfy the gating condition y S When (t-1)>0, the j-th Ca-LIF neuron emits a negative pulse, and by adding V th To reset its membrane potential; Among them, V th V represents the preset membrane potential threshold. th >0, y S (t-1) represents the arithmetic sum of the number of pulses in the previous time step, y S (t-1) equals the cumulative number of positive pulses in the previous time step minus the cumulative number of negative pulses.
3. The Spike-BP on-chip learning method based on the Ca-LIF neuron model according to claim 2, characterized in that: During the integration and leakage phases, the Ca-LIF neuron accumulates the product of the input pulses and synaptic weights to obtain a weighted sum, and performs the leakage operation through a trainable linear leakage parameter.
4. The Spike-BP on-chip learning method based on the Ca-LIF neuron model according to claim 2, characterized in that: In step three, the formula is used: Calculate the loss function E with respect to the membrane potential matrix V. L The gradient matrix δ of (T) L Wherein, loss is the error loss of the j-th Ca-LIF neuron in the output layer L. j The matrix formed, loss j =output j -label j ,output j The label represents the output of the j-th Ca-LIF neuron in output layer L. j This indicates the corresponding one-hot tag.
5. The Spike-BP on-chip learning method based on the Ca-LIF neuron model according to claim 4, characterized in that: In step four, the formula is used: Calculate the loss function E with respect to the membrane potential matrix V of the hidden layer l. l The gradient matrix δ of (t) l Where l takes all integers from L-1 to 2, and Tr represents the transpose; w l Let w be the synaptic weight matrix of hidden layer l, consisting of the synaptic weights w connecting the i-th Ca-LIF neuron in hidden layer l-1 and the j-th Ca-LIF neuron in hidden layer l. ij composition; In step four, the formula is used: Calculate the loss function E with respect to the membrane potential matrix V of hidden layer 1. 1 The gradient matrix δ of (t) 1 Among them, w 1 The synaptic weight matrix of hidden layer 1 consists of the synaptic weights w connecting the i-th neuron in the input layer and the j-th neuron in hidden layer 1. ij Composition; δ 2 Let the loss function E be the membrane potential matrix V of hidden layer 2. 2 The gradient matrix of (t).
6. The Spike-BP on-chip learning method based on the Ca-LIF neuron model according to claim 5, characterized in that: In step five, the formula is used: Calculate the synaptic weight update matrix Δw of the output layer L. L ;where x L (T) represents the input pulse matrix of each Ca-LIF neuron in the output layer L; In step five, the formula is used: Calculate the linear leakage parameter update matrix Δb of the output layer L. L ; In step five, the formula is used: Calculate the synaptic weight update matrix Δw of hidden layer l l ;where x l (t) represents the input pulse matrix of each Ca-LIF neuron in hidden layer l; In step five, the formula is used: Calculate the linear leakage parameter update matrix Δb of hidden layer l. l ; In step five, the formula is used: Calculate the synaptic weight update matrix Δw of hidden layer 1. 1 ;where x 1 (t) represents the input pulse matrix of each Ca-LIF neuron in hidden layer 1; In step five, the formula is used: Calculate the linear leakage parameter update matrix Δb of hidden layer 1. 1 .
7. The Spike-BP on-chip learning method based on the Ca-LIF neuron model according to claim 6, characterized in that: In step six, the method for updating the synaptic weight matrix of the output layer L is as follows: The synaptic weight matrix w of the output layer L... L Updated to w L -lr*Δw L Among them, w L The synaptic weight w connecting the i-th neuron in hidden layer L-1 and the j-th neuron in output layer L ij Composition, where lr represents the learning rate; In step six, the method for updating the linear leakage parameter matrix of the output layer L is as follows: The linear leakage parameter matrix b of the output layer L is... L Updated to b L -lr*Δb L Among them, b L The trainable linear leakage parameter b of the j-th Ca-LIF neuron in the output layer L j composition; In step six, the method for updating the synaptic weight matrix of hidden layer l is as follows: The synaptic weight matrix w of hidden layer l... l Updated to w l -lr*Δw l ; In step six, the method for updating the linear leakage parameter matrix of hidden layer l is as follows: The linear leakage parameter matrix b of hidden layer l is... l Updated to b l -lr*Δb l Among them, b l The trainable linear leakage parameter b of the j-th Ca-LIF neuron in hidden layer l j composition; In step six, the method for updating the weight matrix of hidden layer 1 is as follows: the synaptic weight matrix w of hidden layer 1 is updated. 1 Updated to w 1 -lr*Δw 1 ; In step six, the method for updating the linear leakage parameter matrix of hidden layer 1 is as follows: The linear leakage parameter matrix b of hidden layer 1 is updated... 1 Updated to b 1 -lr*Δb 1 Among them, b 1 The trainable linear leakage parameter b of the j-th Ca-LIF neuron in hidden layer 1 j composition.
8. A Spike-BP on-chip learning system based on the Ca-LIF neuron model, characterized in that: The system is used to perform on-chip learning in accordance with the method described in any one of claims 1 to 7 and to form a corresponding spiking neural network.
9. A Spike-BP on-chip learning processor based on the Ca-LIF neuron model, characterized in that: The processor integrates the Spike-BP on-chip learning system based on the Ca-LIF neuron model as described in claim 8.
Citation Information
Patent Citations
Low-power-consumption pulse neural network on-chip learning system based on time coding
CN114676831A
Lightweight on-chip learning method, system and processor based on simplified SDSP algorithm
CN115018058A