Approximate time coding method for shallow pulse neural network accelerator

By introducing approximate time encoding methods and synaptic pruning technology into pulse neural network accelerators, the problem of reducing the number of pulses without losing accuracy is solved, and the calculation amount and energy consumption are achieved, while maintaining high accuracy.

CN120146125AActive Publication Date: 2025-06-13HARBIN INST OF TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510340927.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-06-13
Estimated Expiration
2045-03-21

AI Technical Summary

Technical Problem

While reducing the number of pulses, how to reduce the overall accuracy loss of pulsed neural network (SNN)?

Method used

A method of approximate time encoding for shallow pulsed neural network accelerator is proposed. By calculating the approximate time window Tap and performing synaptic pruning, the activity of neurons is regulated, thereby reducing the number of pulses and reducing the amount of calculation.

Benefits of technology

It effectively reduces the number of pulses, reduces the calculation amount and energy consumption, while maintaining high accuracy and the accuracy loss is within 1%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120146125A_ABST
    Figure CN120146125A_ABST
Patent Text Reader

Abstract

The invention discloses an approximate time coding method for a shallow pulse neural network accelerator, and belongs to the technical field of neural network processors. In order to reduce the overall precision loss of the SNN while reducing the number of pulses, the method comprises the following steps: calculating the pulse receiving emission time of an input neuron of a to-be-designed pulse neural network accelerator for processing input data and converting the input data into a time sequence pulse sequence; extracting an average pulse rate of a pulse neural network accelerator to be designed; constructing an adaptive configuration method of approximate time coding, and calculating an approximate time window; and performing synaptic pruning on the spiking neural network accelerator to be designed, then adjusting neurons in the spiking neural network accelerator based on the approximate time window, and waiting to enter a new time window of the neurons after the adjustment is completed. According to the invention, less precision loss can be generated while more energy consumption is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of neural network processors, and particularly relates to an approximate time encoding method for a shallow spiking neural network accelerator. Background Art

[0002] A spiking neural network (SNN) is the third generation of neural network that biologically simulates synapses and neurons. The inference process of SNN is mainly inspired by the working mode of the human brain, and is characterized by the propagation of information between neurons by spikes. Since SNN has stronger biological interpretability, it is considered to be one of the most promising forms of brain-like computing in the future. Neurons in SNN update their states only when receiving or sending spikes. This property is called event-driven, making the calculations inside SNN sparse. Research has shown that SNN has better performance than classical activation function-based networks.

[0003] To enable SNN to operate more efficiently, academia and industry will design accelerators for SNN inference. As a dedicated computing chip, the accelerator has higher energy consumption and computing efficiency compared to general computing chips such as CPUs and GPUs. Before the SNN accelerator executes an inference task, an encoding mechanism is required to convert binary inputs into a temporal pulse sequence. The most popular encoding methods currently are frequency encoding and time encoding. The pulses generated by frequency encoding follow a Poisson distribution, and the parameter of the Poisson distribution depends on the size of the input data. Larger input data will generate more pulses. For frequency encoding, since the generation of pulses depends on pseudo-random numbers, there may be uncertainties in the input information, which is not conducive to training. Time encoding represents different information by the pulse moments, and the encoder converts binary values into specific pulse emission times as a function. Research has shown that the operations of emitting and receiving pulses dissipate the most power in SNN. Therefore, for event-driven SNN, the fewer the pulses, the less the computational amount and the lower the energy consumption. However, from the perspective of biological neurons, the importance of the information carried by the pulses at different moments in the pulse sequence is different, that is, there is non-critical information in the pulse sequence. The firing of a neuron requires stimulation, and the pulse time is the delay time from when the neuron receives the stimulation to when it fires. When a neuron fires, if the time interval between the pulse time and the time of receiving the stimulation is long, then the information carried by this stimulation and the pulse is relatively non-critical. Summary of the Invention

[0004] The problem to be solved by the present invention is to reduce the overall accuracy loss of SNN while reducing the number of pulses, and proposes an approximate time encoding method for a shallow spiking neural network accelerator.

[0005] To achieve the above object, the present invention is realized through the following technical solutions:

[0006] An approximate time encoding method for a shallow spiking neural network accelerator, comprising the following steps:

[0007] S1. For the to-be-designed spiking neural network accelerator, calculate the emission time of the pulses received by the input neurons of the spiking neural network accelerator, and use it to process and convert the input data into a time series pulse sequence;

[0008] S2. For the to-be-designed spiking neural network accelerator, extract the average pulse rate;

[0009] S3. Based on the average pulse rate obtained in step S2, construct an adaptive configuration method for approximate time encoding, and calculate the approximate time window T ap ;

[0010] S4. Perform synaptic pruning on the to-be-designed spiking neural network accelerator, and then adjust the neurons in the spiking neural network accelerator based on the approximate time window obtained in step S3. After completion of the adjustment, wait for the time window of the new neurons to enter.

[0011] Further, the specific implementation method of step S1 is to convert the input data into a time series pulse sequence in the CPU, and the emission time t in of the pulses received by the input neurons of the spiking neural network accelerator is calculated by the formula:

[0012] t in = f(p) = (p max - p) / p max * T w (1)

[0013] where p is the pixel value of the input image, p max is the maximum value of the pixels in the input image, and T w is the neuron time window of the SNN accelerator.

[0014] Further, in step S2, the to-be-designed spiking neural network accelerator is run on a software platform composed of the open-source Pytorch framework, and the emission time t in of the pulses received by the input neurons of the spiking neural network accelerator obtained in step S1 is used as the input pulse, and the average pulse rate of the SNN is obtained

[0015] Further, the specific implementation method of step S3 includes the following steps:

[0016] S3.1. For the shallow spiking neural network, use a linear formula to fit the neuron behavior, and construct a calculation formula for the pulse time of the information transmitted inside the SNN using time encoding as:

[0017] tf (x) = (T w - 1)(1 - x)(2)

[0018] where t f (x) represents the value of the moment when a pulse is sent within the time window, and x is the pulse density of the neuron;

[0019] S3.2. Set the pulse density x of the neuron to the product of the pulse rate and the neuron time window T of the SNN accelerator, and then calculate the probability P that the neuron fires a pulse at the end of the time window w of the SNN accelerator, and the calculation formula is: 0 The calculation formula is:

[0020]

[0021] Take P 0 as the probability that the time window is idle. By multiplying P 0 by the neuron time window T of the SNN accelerator w to obtain the change amount ΔT of the neuron time window of the SNN accelerator w The calculation formula is:

[0022]

[0023] S3.3. Use ΔT w to calculate and obtain the approximate time window T ap The calculation formula is:

[0024] T ap = T w - ΔT w , ΔT w ≤ 0.5T w . (5)

[0025] Furthermore, the specific implementation method of step S4 includes the following steps:

[0026] S4.1. Perform synaptic pruning on the pulse neural network accelerator to be designed; select the probability P that a neuron fires a pulse at the end of the time window represented by formula (3) in step S3 0 as the pruning factor pr, calculate the average absolute value w mean of the synaptic weight matrix w, and set the pruning coefficient c. Set the synaptic weights less than pr * w mean * c to 0 to obtain the pruned approximate synaptic weight matrix w th The expression is:

[0027]

[0028] Among them, sr is the pulse rate of the SNN, and the value range of c is between 0.8 and 1.2;

[0029] S4.2. Introduce a local clock time t for each neuron, and add a judgment unit to the output of each neuron for judgment. When the local clock time t ≤ T ap it is allowed to emit a pulse. When t ≤ T ap the condition for releasing a pulse is reached or t > T ap then the local clock time t and the input layer neuron V in the pulse neural network accelerator are reset simultaneously. After the adjustment, wait to enter the time window of the new neuron.

[0030] Furthermore, the designed time encoding generator consists of a judgment module, a counter, and a logical AND gate.

[0031] Furthermore, for each subsequent inference, sr is calculated using the number of pulses counted during the previous inference process, and then T ap and P 0 are calculated respectively, and then approximate time encoding and pruning operations are performed on the pulse neural network accelerator.

[0032] Furthermore, for the already designed SNN accelerator, the operation in step S2 is skipped.

[0033] Furthermore, for the already designed SNN accelerator, the pruning operation in step S4 is skipped.

[0034] Advantages of the present invention:

[0035] The approximate time encoding method for a shallow pulse neural network accelerator described in the present invention proposes to reduce pulses by using an approximated time window, thereby reducing the computational amount; proposes an adaptive configuration scheme, and can configure an approximated time window with low precision loss and high pulse reduction benefit without a large number of tests; prunes the SNN with sparser pulses, thereby reducing the memory access overhead. Compared with approximate computing technologies such as approximate memories, approximate adders, and pruning based on STDP, the approximate computing method proposed in the present invention can reduce more energy consumption while generating less precision loss, and the accuracy loss is within 1%. Description of the Drawings

[0036] Figure 1 is a flowchart of the approximate time encoding method for a shallow pulse neural network accelerator described in the present invention;

[0037] Figure 2 is a schematic diagram of the approximate time encoding mechanism of the present invention;

[0038] Figure 3 is a block diagram of the approximate time encoding deployment process of the present invention;

[0039] Figure 4 This is a schematic diagram of the approximate time encoding hardware structure of the present invention. Detailed implementation manners

[0040] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in combination with the accompanying drawings and specific implementation manners. It should be understood that the specific implementation manners described herein are only used to explain the present invention and are not used to limit the present invention, that is, the specific implementation manners described are only a part of the implementation manners of the present invention, rather than all of the specific implementation manners. Usually, the components of the specific implementation manners of the present invention described and shown in the accompanying drawings herein can be arranged and designed in various different configurations, and the present invention can also have other implementation manners.

[0041] Therefore, the detailed description of the specific implementation manners of the present invention provided in the accompanying drawings below is not intended to limit the scope of the claimed invention, but only represents the selected specific implementation manners of the present invention. Based on the specific implementation manners of the present invention, all other specific implementation manners obtained by those skilled in the art without creative efforts fall within the scope of protection of the present invention.

[0042] To further understand the content, features and effects of the present invention, the following specific implementation manners are exemplified and are accompanied by Figure 1 -Accompanying Figure 4 The detailed description is as follows:

[0043] Example 1:

[0044] An approximate time encoding method for a shallow pulse neural network accelerator includes the following steps:

[0045] S1. For the pulse neural network accelerator to be designed, calculate the emission time of the pulses received by the input neurons of the pulse neural network accelerator for processing the input data and converting it into a time sequence pulse sequence;

[0046] Furthermore, the specific implementation method of step S1 is to convert the input data into a time sequence pulse sequence in the CPU, and the emission time t in of the pulses received by the input neurons of the pulse neural network accelerator is calculated by the formula:

[0047] t in = f(p) = (p max - p) / p max * T w (1)

[0048] where p is the pixel value of the input image, p max is the maximum value of the pixels in the input image, and T wThe neuron time window for the SNN accelerator.

[0049] Further, p max Varies according to the format of the input image, generally 255; T w Is an input parameter of the method, used to provide a reference for judging the emission time of the pulse and also used to provide an upper time limit for the pulse emission. This value is set artificially. For the shallow SNN with time encoding, it is generally set between 10 and 100;

[0050] S2. For the pulse neural network accelerator to be designed, extract the average pulse rate;

[0051] Further, in step S2, the pulse neural network accelerator to be designed is run on a software platform based on the open-source Pytorch framework, and the emission time t of the input neuron receiving the pulse of the pulse neural network accelerator obtained in step S1 in Is used as the input pulse to obtain the average pulse rate of the SNN

[0052] S3. Based on the average pulse rate obtained in step S2, construct an approximate time-encoding adaptive configuration method to calculate the approximate time window T ap ;

[0053] Further, the specific implementation method of step S3 includes the following steps:

[0054] S3.1. For the shallow pulse neural network, use a linear formula to fit the neuron behavior, and construct a calculation formula for the pulse time of the information transmitted inside the SNN using time encoding as:

[0055] t f (x) = (T w -1)(1 - x) (2)

[0056] Where, t f (x) represents the value of the moment when the pulse is emitted within the time window, and x is the pulse density of the neuron;

[0057] S3.2. Set the pulse density x of the neuron to the product of the pulse rate and the neuron time window T of the SNN accelerator w , and then calculate the probability P 0 of the neuron emitting a pulse at the end of the time window. The calculation formula is:

[0058]

[0059] The pulse rate is the ratio of the number of pulses emitted within the time window to the time steps of the time window, and is usually used to measure the pulse density of the SNN; The probability P of the neuron emitting a pulse at the end of the time window can be deduced.0 , and use P 0 to determine the approximation degree;

[0060] Take P 0 as the probability that the time window is idle. By multiplying P 0 with the neuron time window T w of the SNN accelerator, the change amount ΔT w of the neuron time window of the SNN accelerator is obtained. The calculation formula is:

[0061]

[0062] S3.3. Use ΔT w to calculate and obtain the approximate time window T ap . The calculation formula is:

[0063] T ap = T w - ΔT w , ΔT w ≤ 0.5T w . (5)

[0064] S4. Perform synaptic pruning on the to-be-designed spiking neural network accelerator, and then adjust the neurons in the spiking neural network accelerator based on the approximate time window obtained in step S3. After the adjustment, wait for the time window of the new neurons to enter.

[0065] Since the approximate time encoding reduces the spike rate of the SNN, fewer spikes are emitted by the neurons, and the synapses have less task of transmitting spikes. The synapses that transmit fewer spikes can also be deleted, which is called synaptic pruning. Deleting unnecessary synaptic weights can not only reduce the storage overhead of synaptic weights but also reduce the computational energy consumption caused by synaptic weight operations;

[0066] Further, the specific implementation method of step S4 includes the following steps:

[0067] S4.1. Perform synaptic pruning on the to-be-designed spiking neural network accelerator; select the probability P 0 that a neuron emits a spike at the end of the time window represented by formula (3) in step S3 as the pruning factor pr, calculate the average absolute value w mean of the synaptic weight matrix w, and set the pruning coefficient c. Set the synaptic weights less than pr * w mean * c to 0 to obtain the pruned approximate synaptic weight matrix w th . The expression is:

[0068]

[0069] where, sr is the pulse rate of the SNN, and the value range of c is between 0.8 and 1.2;

[0070] S4.2. Introduce a local clock time t into each neuron, and add a judgment unit to the output of each neuron for judgment. When the local clock time t ≤ T ap it is allowed to emit a pulse. When t ≤ T ap the condition for releasing a pulse is reached or t > T ap then reset the local clock time t and the input layer neuron V in the spiking neural network accelerator simultaneously, and wait for the time window of the new neuron to enter after the adjustment is completed.

[0071] Furthermore, according to the approximate time window T obtained by the adaptive configuration scheme in S3 ap adjust the input layer neurons in the SNN accelerator. In this embodiment, a time encoding generator is designed, which consists of a judgment module, a counter, and a logical AND gate. A local clock signal is introduced into each neuron, and a judgment unit is added to the output of the neuron. The judgment unit has two input messages, which are the output of the neuron and the set T ap , and it is only allowed to emit a pulse when the local clock time t ≤ T ap . At this time, the membrane potential V is updated by the membrane potential update module owned by the spiking neuron, and then the membrane potential V is compared with the set threshold voltage v th as the condition for pulse generation. Once the condition for releasing a pulse is reached at t ≤ T ap or t > T ap , then reset the local clock t and the neuron membrane potential V together.

[0072] Furthermore, in each subsequent inference, sr is calculated using the number of pulses counted in the previous inference process, and then T ap and P 0 are calculated respectively, and then approximate time encoding and pruning operations are performed on the spiking neural network accelerator.

[0073] In this embodiment, an SNN accelerator is designed in a 28nm process library, and energy consumption evaluation is performed using Cadence Genus 15.0 software. In addition, accuracy testing is performed on a software platform based on the open-source PyTorch framework. On the MNIST dataset, the SNN accelerator optimized by the method proposed in this embodiment can even obtain a slight improvement in accuracy compared with that before optimization, while the energy consumption is reduced by up to 60.3%. In contrast, other optimization methods have problems such as poor energy consumption optimization effect or excessive accuracy loss. The comparison results are shown in Table 1:

[0074] Table 1 Energy consumption and accuracy evaluation results on the MNIST dataset

[0075] Energy consumption optimization method Accuracy rate Precision change compared with that before optimization Percentage of energy consumption reduction ApprAdder 98.32 No decrease, no improvement 29.0% Sparkxd 91.50 Decrease by 0.10% 40.0% Pruning based on STDP 81.60 Decrease by 2.10% 68.0% AxSNN Not published Decrease by 1.00% 46.2% FSpiNN 91.60 Improve by 4.00% 44.4% This embodiment 97.96 Improve by 0.17% 60.3%

[0076] Example 2:

[0077] An approximate time encoding method for a shallow pulse neural network accelerator, comprising the following steps:

[0078] S1. For the designed pulse neural network accelerator, calculate the emission time of the pulses received by the input neurons of the pulse neural network accelerator, for processing the input data and converting it into a time series pulse sequence;

[0079] Furthermore, the specific implementation method of step S1 is to convert the input data into a time series pulse sequence in the CPU, and the emission time t of the pulses received by the input neurons of the pulse neural network accelerator in The calculation formula is:

[0080] t in = f(p) = (p max - p) / p max * T w (1)

[0081] Where p is the pixel value of the input image, p max is the maximum value of the pixels in the input image, and T w is the neuron time window of the SNN accelerator.

[0082] Furthermore, p max varies according to the format of the input image, generally 255; T w is an input parameter of the method, used to provide a reference for judging the emission time of the pulses and also used to provide an upper time limit for the pulse emission. This value is set artificially. For the shallow SNN with time encoding, it is generally set between 10 - 100;

[0083] S2. For the designed pulse neural network accelerator, collect the average pulse rate;

[0084] S3. Based on the average pulse rate obtained in step S2, construct an adaptive configuration method for approximate time encoding, and calculate the approximate time window T ap ;

[0085] Furthermore, the specific implementation method of step S3 includes the following steps:

[0086] S3.1. For the shallow pulse neural network, use a linear formula to fit the neuron behavior, and construct a calculation formula for the pulse time of the information transmitted inside the SNN using time encoding as:

[0087] t f (x) = (T w-1)(1 - x)(2)

[0088] where t f (x) represents the value of the moment when a pulse is sent within the time window, and x is the pulse density of the neuron;

[0089] S3.2. Set the pulse density x of the neuron to the product of the pulse rate and the neuron time window T of the SNN accelerator w and then calculate the probability P that the neuron sends a pulse at the end of the time window 0 , and the calculation formula is:

[0090]

[0091] The pulse rate is the ratio of the number of pulses sent within the time window to the time steps of the time window, and is usually used to measure the pulse density of the SNN; the probability p that the neuron sends a pulse at the end of the time window can be derived 0 , and p 0 is used to determine the approximation degree;

[0092] Take p 0 as the probability that the time window is idle, and multiply P 0 by the neuron time window T of the SNN accelerator w to obtain the change amount ΔT of the neuron time window of the SNN accelerator w , and the calculation formula is:

[0093]

[0094] S3.3. Use ΔT w to calculate and obtain the approximate time window T ap , and the calculation formula is:

[0095]

[0096] S4. Based on the approximate time window obtained in step S3, adjust the neurons in the spiking neural network accelerator, and wait for the time window of the new neuron to enter after the adjustment.

[0097] Furthermore, the specific implementation method of step S4 is to introduce a local clock time t in each neuron and add a judgment unit in the output of each neuron for judgment. When the local clock time t ≤ T ap , allowing a pulse to be sent, when t ≤ T ap , the condition for releasing a pulse is reached or when t > T ap , then reset the local clock time t and the input layer neuron V in the spiking neural network accelerator simultaneously, and wait for the time window of the new neuron to enter after the adjustment.

[0098] Further, the approximate time window T obtained according to the adaptive configuration scheme of S3 ap Adjust the input layer neurons in the SNN accelerator. In this embodiment, a time encoding generator is designed, which consists of a judgment module, a counter, and a logical AND gate. A local clock signal is introduced into each neuron, and a judgment unit is added to the output of the neuron. The judgment unit has two input messages, which are the output of the neuron and the set T ap , and only when the local clock time t ≤ T ap is a pulse allowed to be emitted. At this time, the membrane potential V is updated by the membrane potential update module inherent in the pulse neuron, and then the membrane potential V is compared with the set threshold voltage v th as a condition for pulse generation. Once the condition for releasing a pulse is reached at t ≤ T ap or t > T ap , the local clock t and the neuron membrane potential V are reset together.

[0099] Further, for each subsequent inference, sr is calculated using the number of pulses counted during the previous inference process, and then T ap and P 0 are calculated respectively, and then approximate time encoding and pruning operations are performed on the pulse neural network accelerator.

[0100] It should be noted that relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0101] Although the present application has been described above with reference to specific embodiments, various improvements can be made to it and components therein can be replaced with equivalents without departing from the scope of the present application. In particular, as long as there is no structural conflict, the various features in the specific embodiments disclosed in the present application can be combined with each other in any way, and the cases of these combinations are not exhaustively described in this specification only for the sake of saving space and resources. Therefore, the present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. An approximate time coding method for a shallow spiking neural network accelerator, characterized in that: The steps include: S1. For the pulse neural network accelerator to be designed, calculate the emission time of the input neuron receiving the pulse of the pulse neural network accelerator, so as to process the input data and convert it into a time-series pulse sequence; S2. extracting the average pulse rate of the designed spiking neural network accelerator; S3. Based on the average pulse rate obtained in step S2, an adaptive configuration method for approximate time coding is constructed to calculate the approximate time window T ap ; S4. Perform synaptic pruning on the designed spiking neural network accelerator, and then adjust the neurons in the spiking neural network accelerator based on the approximate time window obtained in step S3. After the adjustment is completed, wait for the time window to enter a new neuron.

2. The approximate time encoding method for a shallow spiking neural network accelerator according to claim 1, characterized in that: The specific implementation method of step S1 is to convert the input data into a time-series pulse sequence in the CPU, and the emission time t of the input neuron receiving the pulse of the pulse neural network accelerator is in The calculation formula is: t in =f(p)=(p max -p) / p max *T w (1) Among them, p is the pixel value of the input image, p max is the maximum value of pixels in the input image, T w is the neuron time window of the SNN accelerator.

3. The approximate time coding method for shallow spiking neural network accelerator according to claim 2, characterized in that: In step S2, the pulse neural network accelerator to be designed is run on a software platform based on the open source Pytorch framework, and the emission time t of the input neuron receiving the pulse of the pulse neural network accelerator obtained in step S1 is input. in As the input pulse, we get the average pulse rate of SNN 4. The approximate time encoding method for a shallow spiking neural network accelerator according to claim 3, characterized in that: The specific implementation method of step S3 includes the following steps: S3.

1. For shallow spiking neural networks, a linear formula is used to fit neuron behavior, and the calculation formula for the pulse time of information transmitted within the SNN using time encoding is constructed as follows: t f (x)=(T w -1)(1-x) (2) Among them, t f (x) represents the value of the moment of spiking within the time window, and x is the spike density of the neuron; S3.

2. Set the neuron pulse density x to the pulse rate and the neuron time window T of the SNN accelerator w The product of , and then calculate the probability P0 of the neuron emitting a pulse at the end of the time window, the calculation formula is: We take P0 as the probability that the time window is idle and compare P0 with the neuron time window T of the SNN accelerator. w Multiply by to get the change ΔT of the neuron time window of the SNN accelerator w , the calculation formula is: S3.

3. Using ΔT w Calculate the approximate time window T ap , the calculation formula is: T ap =T w -ΔT w ,ΔT w ≤0.5T w 。 (5) 5. The approximate time encoding method for shallow spiking neural network accelerator according to claim 4, characterized in that: The specific implementation method of step S4 includes the following steps: S4.

1. Perform synaptic pruning on the designed spiking neural network accelerator; select the probability P0 of a neuron emitting a pulse at the end of the time window represented by formula (3) in step S3 as the pruning factor pr, and calculate the average absolute value w of the synaptic weight matrix w mean , and set the pruning coefficient c, which will be less than pr*w mean * The synaptic weights of c are set to 0, and the approximate synaptic weight matrix w after pruning is obtained th , the expression is: Among them, sr is the pulse rate of SNN, and the value range of c is between 0.8-1.2; S4.

2. Introduce the local clock time t in each neuron, and add a judgment unit to the output of each neuron for judgment. When the local clock time t ≤ T ap Pulses are allowed to be emitted when t≤T ap When the condition of releasing pulse is reached or t>T ap When the local clock time t and the input layer neuron V in the pulse neural network accelerator are reset at the same time, after the adjustment is completed, wait for the time window to enter the new neuron.

6. The approximate time encoding method for shallow spiking neural network accelerator according to claim 5, characterized in that: The design time code generator consists of a judgment module, a counter and a logic AND gate.

7. The approximate time encoding method for shallow spiking neural network accelerator according to claim 6, characterized in that: Each subsequent inference uses the pulse count in the previous inference process to calculate sr, and then calculates T ap and P0, and then implement approximate time encoding and pruning operations on the spiking neural network accelerator.

8. The approximate time encoding method for shallow spiking neural network accelerator according to claim 7, characterized in that: For the SNN accelerator that has been designed, skip step S2.

9. The approximate time encoding method for shallow spiking neural network accelerator according to claim 8, characterized in that: For the designed SNN accelerator, the pruning operation in step S4 is skipped.

Citation Information

Patent Citations

  • Visual channel coding method based on pulse neural network

    CN114638286A

  • Pulse neural network neuron time sequence grading activation method

    CN116720552A

  • Data classification method for realizing rapid reasoning and effective learning based on spiking neural network

    CN118133121A

  • Neuromorphic processor capable of learning online based on approximate calculation

    CN119378618A

  • Hardware-oriented deep spiking neural network speech recognition method and system

    WO2024152583A1