An approximate temporal coding method for shallow pulse neural network accelerator

By using approximate time coding and synaptic pruning techniques, the coding process of the spiking neural network accelerator is optimized, solving the problems of high computational load and high energy consumption caused by a large number of pulses, and achieving energy reduction while maintaining accuracy.

CN120146125BActive Publication Date: 2025-11-11HARBIN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing spiking neural network accelerators suffer from high computational load and energy consumption due to the large number of pulses during the encoding process, and time-coding methods may introduce information uncertainty and accuracy loss.

Method used

An approximate time coding method is adopted. By calculating the average pulse rate and adaptively configuring the approximate time window, combined with synaptic pruning techniques, the number of pulses is reduced and neuron behavior is optimized. A time coding generator is designed to control pulse emission.

Benefits of technology

It effectively reduces the computational load and energy consumption of spiking neural network accelerators while maintaining high accuracy with an accuracy loss of less than 1%, and achieves high pulse reduction with low accuracy loss without extensive testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120146125B_ABST
    Figure CN120146125B_ABST
Patent Text Reader

Abstract

An approximate time coding method for shallow spiking neural network accelerators belongs to the field of neural network processor technology. To reduce the number of pulses while minimizing the overall accuracy loss of SNNs, this invention includes: calculating the emission time of the input neurons of the spiking neural network accelerator to be designed, which is used to process the input data and convert it into a time-series pulse sequence; extracting the average pulse rate of the spiking neural network accelerator; constructing an adaptive configuration method for approximate time coding and calculating the approximate time window; performing synaptic pruning on the spiking neural network accelerator; and then adjusting the neurons in the spiking neural network accelerator based on the approximate time window, waiting for the time window for new neurons to enter after adjustment. This invention can reduce energy consumption while incurring less accuracy loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of neural network processor technology, specifically relating to an approximate time coding method for shallow spiking neural network accelerators. Background Technology

[0002] Spiking Neural Networks (SNNs) are third-generation neural networks that biologically mimic synapses and neurons. The reasoning process of SNNs is primarily inspired by the human brain, characterized by the propagation of information between neurons via spikes. Due to their stronger biological interpretability, SNNs are considered one of the most promising forms of brain-inspired computing. Neurons in SNNs only update their state when receiving or sending spikes. This characteristic, known as event-driven computing, makes the computation within SNNs sparse. Research has shown that SNNs outperform classic activation function-based networks.

[0003] To enable SNNs to operate more efficiently, both academia and industry design accelerators for SNN inference. Accelerators, as dedicated computing chips, offer higher energy consumption and computational efficiency compared to general-purpose computing chips like CPUs and GPUs. Before an SNN accelerator performs inference tasks, an encoding mechanism is needed to convert the binary input into a temporal pulse sequence. Currently, the most popular encoding methods are frequency encoding and temporal encoding. Frequency encoding generates pulses that follow a Poisson distribution, the parameters of which depend on the size of the input data; larger input data will generate more pulses. For frequency encoding, because it relies on pseudo-random numbers to generate pulses, the input information may be uncertain, which is detrimental to training. Temporal encoding uses pulse timing to represent different information; the encoder, as a function, converts binary values ​​into specific pulse emission times. Research shows that the operation of emitting and receiving pulses dissipates the most power in SNNs. Therefore, for event-driven SNNs, fewer pulses result in less computation and lower energy consumption. However, from the perspective of biological neurons, the importance of information carried by pulses at different times in a pulse sequence varies; that is, non-critical information exists in the pulse sequence. Neuron firing requires stimulation, and pulse time is the delay time from receiving a stimulus to firing. When a neuron fires, if the time interval between the pulse and the received stimulus is long, then the information carried by the stimulus and the pulse is relatively unimportant. Summary of the Invention

[0004] The problem this invention aims to solve is to reduce the overall accuracy loss of SNNs while reducing the number of pulses, and proposes an approximate time coding method for shallow spiking neural network accelerators.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] An approximate time coding method for shallow spiking neural network accelerators includes the following steps:

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

[0008] S2. Extract the average pulse rate of the spiking neural network accelerator to be designed;

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

[0010] S4. Perform synaptic pruning on the spiking neural network accelerator to be designed, 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.

[0011] 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 pulse emission time t of the input neuron of the spiking neural network accelerator is... in The calculation formula is:

[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 T is the maximum value of the pixels in the input image. w This represents the neuron time window of the SNN accelerator.

[0014] Furthermore, in step S2, the spiking 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 neurons of the spiking neural network accelerator obtained in step S1 is used as the input. in As the input pulse, the average pulse rate of the SNN is obtained.

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

[0016] S3.1. For shallow spiking neural networks, a linear formula is used to fit the neuron behavior. The formula for calculating the pulse time of the information transmitted internally by the time-encoded SNN is as follows:

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

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

[0019] S3.2. Set the neuron's pulse density x as the pulse rate and the neuron's time window T of the SNN accelerator. w The product of these factors is used to calculate the probability P0 of the neuron firing a pulse at the end of the time window. The formula is as follows:

[0020]

[0021] Using P0 as the probability of an idle time window, we can further refine P0 by matching it with the neuron time window T of the SNN accelerator. w Multiplying these yields the change ΔT in the neuron time window of the SNN accelerator. w The calculation formula is:

[0022]

[0023] S3.3. Using ΔT w The approximate time window T is calculated. 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 spiking neural network accelerator to be designed; select the probability P0 of a neuron firing a pulse at the end of the time window as 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 *Set the synaptic weights of *c to 0 to obtain the approximate synaptic weight matrix w after pruning. th The expression is:

[0027]

[0028] Where sr is the pulse rate of the SNN, and c ranges from 0.8 to 1.2;

[0029] S4.2. Introduce a local clock time t to each neuron, and add a judgment unit to the output of each neuron to make a judgment when the local clock time t ≤ T. ap A pulse can be emitted when t≤T ap When the condition for releasing the pulse is met or t>T, the release pulse is achieved. ap Then, the local clock time t and the input layer neuron V in the spiking neural network accelerator are simultaneously reset, and after adjustment, they wait for the time window to enter a new neuron.

[0030] Furthermore, the time encoding generator is designed to consist of a decision module, a counter, and a logic AND gate.

[0031] Furthermore, in each subsequent inference, sr is calculated using the number of pulses counted in the previous inference process, and then T is calculated respectively. ap And P0, and then perform approximate time coding and pruning operations on the spiking neural network accelerator.

[0032] Furthermore, for SNN accelerators that have already been designed, step S2 can be skipped.

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

[0034] The beneficial effects of this invention are:

[0035] This invention presents an approximate time coding method for shallow spiking neural network accelerators. It proposes reducing pulses by using an approximate time window, thereby decreasing computational load. It also proposes an adaptive configuration scheme that allows for configuring an approximate time window with low accuracy loss and reduced benefit from high pulse counts without extensive testing. Furthermore, it prunes the sparser pulses in the SNN, thereby reducing memory access overhead. Compared to approximate computation techniques such as approximate memory, approximate adders, and STDP-based pruning, the approximate computation method proposed in this invention can reduce energy consumption while incurring less accuracy loss, keeping the accuracy loss within 1%. Attached Figure Description

[0036] Figure 1 This is a flowchart of an approximate time coding method for shallow spiking neural network accelerators according to the present invention;

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

[0038] Figure 3 This is a flowchart illustrating the approximate time-coding 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

[0040] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only for explaining the invention and are not intended to limit the invention; that is, the described specific embodiments are merely a part of the embodiments of the invention, and not all of them. The components of the specific embodiments of the invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations, and the invention may also have other embodiments.

[0041] Therefore, the following detailed description of specific embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected specific embodiments of the invention. All other specific embodiments obtained by those skilled in the art based on these specific embodiments without inventive effort are within the scope of protection of this invention.

[0042] To further understand the invention's content, features, and effects, the following specific embodiments are provided, along with accompanying drawings. Figure 1 -Appendix Figure 4 Detailed explanation is as follows:

[0043] Example 1:

[0044] An approximate time coding method for shallow spiking neural network accelerators includes the following steps:

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

[0046] 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 pulse emission time t of the input neuron of the spiking neural network accelerator is... in The calculation formula is:

[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 T is the maximum value of the pixels in the input image. w This represents the neuron time window of the SNN accelerator.

[0049] Furthermore, p maxIt varies depending on the format of the input image, but is generally 255; T w It is an input parameter of the method, used to provide a reference for judging the pulse emission time, and also to provide an upper limit for the pulse emission time. This value is set manually, and for shallow SNNs with time coding, it is generally set between 10 and 100.

[0050] S2. Extract the average pulse rate of the spiking neural network accelerator to be designed;

[0051] Furthermore, in step S2, the spiking 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 neurons of the spiking neural network accelerator obtained in step S1 is used as the input. in As the input pulse, the average pulse rate of the SNN is obtained.

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

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

[0054] S3.1. For shallow spiking neural networks, a linear formula is used to fit the neuron behavior. The formula for calculating the pulse time of the information transmitted internally by the time-encoded SNN is as follows:

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

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

[0057] S3.2. Set the neuron's pulse density x as the pulse rate and the neuron's time window T of the SNN accelerator. w The product of these factors is used to calculate the probability P0 of the neuron firing a pulse at the end of the time window. The formula is as follows:

[0058]

[0059] The pulse rate is the ratio of the number of pulses emitted within a time window to the number of time steps within that time window. It is commonly used to measure the pulse density of a SNN. The probability P0 of a neuron emitting a pulse at the end of the time window can be derived, and P0 can be used to determine the degree of approximation.

[0060] Using P0 as the probability of an idle time window, we can further refine P0 by matching it with the neuron time window T of the SNN accelerator. w Multiplying these yields the change ΔT in the neuron time window of the SNN accelerator. w The calculation formula is:

[0061]

[0062] S3.3. Using ΔT w The approximate time window T is calculated. 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 spiking neural network accelerator to be designed, 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.

[0065] Because approximate temporal encoding reduces the impulse rate of SNNs, neurons emit fewer impulses, and synapses bear less responsibility for transmitting impulses. Synapses that transmit fewer impulses can also be deleted, a process known as synaptic pruning. Deleting unnecessary synaptic weights not only reduces the storage overhead of synaptic weights but also reduces the computational energy consumption caused by synaptic weight operations.

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

[0067] S4.1. Perform synaptic pruning on the spiking neural network accelerator to be designed; select the probability P0 of a neuron firing a pulse at the end of the time window as 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 *Set the synaptic weights of *c to 0 to obtain the approximate synaptic weight matrix w after pruning. th The expression is:

[0068]

[0069] Where sr is the pulse rate of the SNN, and c ranges from 0.8 to 1.2;

[0070] S4.2. Introduce a local clock time t to each neuron, and add a judgment unit to the output of each neuron to make a judgment when the local clock time t ≤ T.ap A pulse can be emitted when t≤T ap When the condition for releasing the pulse is met or t>T, the release pulse is achieved. ap Then, the local clock time t and the input layer neuron V in the spiking neural network accelerator are simultaneously reset, and after adjustment, they wait for the time window to enter a new neuron.

[0071] Furthermore, based on the approximate time window T obtained from the adaptive configuration scheme of S3... ap The input layer neurons in the SNN accelerator are adjusted. This embodiment designs a time-encoding generator, consisting of a decision module, a counter, and an AND gate. A local clock signal is introduced into each neuron, and the decision unit is added to the neuron's output. The decision unit has two inputs: the neuron's output and the set T. ap Only when the local clock time t≤T ap At this time, pulses are allowed to be emitted. The membrane potential V is then updated by the spiking neuron's own membrane potential update module, and then compared with the set threshold voltage v. th Comparison, as a condition for pulse generation. Once t≤T ap When the condition for releasing the pulse is met or t>T, the release pulse is achieved. ap Then the local clock t and the neuron membrane potential V will be reset together.

[0072] Furthermore, in each subsequent inference, sr is calculated using the number of pulses counted in the previous inference process, and then T is calculated respectively. ap And P0, and then perform approximate time coding and pruning operations on the spiking neural network accelerator.

[0073] This embodiment designs an SNN accelerator using a 28nm process library and evaluates its energy consumption using Cadence Genus 15.0 software. Furthermore, accuracy tests are conducted on a software platform based on the open-source PyTorch framework. On the MNIST dataset, the SNN accelerator optimized using the method proposed in this embodiment achieves a slight improvement in accuracy compared to the unoptimized version, while reducing energy consumption by up to 60.3%. In contrast, other optimization methods suffer from poor energy efficiency or excessive accuracy loss. The comparison results are shown in Table 1.

[0074] Table 1 shows the energy consumption and accuracy evaluation results on the MNIST dataset.

[0075] Energy consumption optimization methods accuracy Change in accuracy compared to before optimization Percentage reduction in energy consumption ApprAdder 98.32 No decrease, no increase 29.0% Sparkxd 91.50 Decrease of 0.10% 40.0% STDP-based pruning 81.60 Decrease of 2.10% 68.0% AxSNN Not announced Decrease of 1.00% 46.2% FSpiNN 91.60 Increased by 4.00% 44.4% This embodiment 97.96 Increased by 0.17% 60.3%

[0076] Example 2:

[0077] An approximate time coding method for shallow spiking neural network accelerators includes the following steps:

[0078] S1. For the designed spiking neural network accelerator, calculate the emission time of the pulse received by the input neurons of the spiking neural network accelerator, which is used to process the input data and convert 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 pulse emission time t of the input neuron of the spiking neural network accelerator is... 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 T is the maximum value of the pixels in the input image. w This represents the neuron time window of the SNN accelerator.

[0082] Furthermore, p max It varies depending on the format of the input image, but is generally 255; T w It is an input parameter of the method, used to provide a reference for judging the pulse emission time, and also to provide an upper limit for the pulse emission time. This value is set manually, and for shallow SNNs with time coding, it is generally set between 10 and 100.

[0083] S2. For the designed spiking 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 coding 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 shallow spiking neural networks, a linear formula is used to fit the neuron behavior. The formula for calculating the pulse time of the information transmitted internally by the time-encoded SNN is as follows:

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

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

[0089] S3.2. Set the neuron's pulse density x as the pulse rate and the neuron's time window T of the SNN accelerator. w The product of these factors is used to calculate the probability P0 of the neuron firing a pulse at the end of the time window. The formula is as follows:

[0090]

[0091] The pulse rate is the ratio of the number of pulses emitted within a time window to the number of time steps in the time window. It is usually used to measure the pulse density of an SNN. The probability p0 of a neuron emitting a pulse at the end of the time window can be derived, and p0 can be used to determine the degree of approximation.

[0092] Using p0 as the probability of an idle time window, we can correlate p0 with the neuron time window T of the SNN accelerator. w Multiplying these yields the change ΔT in the neuron time window of the SNN accelerator. w The calculation formula is:

[0093]

[0094] S3.3. Using ΔT w The approximate time window T is calculated. ap The calculation formula is:

[0095]

[0096] S4. Adjust the neurons in the spiking neural network accelerator based on the approximate time window obtained in step S3, and wait for the new time window of the neurons to be entered after the adjustment is completed.

[0097] Furthermore, step S4 is specifically implemented by introducing a local clock time t into each neuron and adding a judgment unit to the output of each neuron for judgment when the local clock time t ≤ T. ap A pulse can be emitted when t≤T ap When the condition for releasing the pulse is met or t>T, the release pulse is achieved. ap Then, the local clock time t and the input layer neuron V in the spiking neural network accelerator are simultaneously reset, and after adjustment, they wait for the time window to enter a new neuron.

[0098] Furthermore, based on the approximate time window T obtained from the adaptive configuration scheme of S3... ap The input layer neurons in the SNN accelerator are adjusted. This embodiment designs a time-encoding generator, consisting of a decision module, a counter, and an AND gate. A local clock signal is introduced into each neuron, and the decision unit is added to the neuron's output. The decision unit has two inputs: the neuron's output and the set T. ap Only when the local clock time t≤Tap At this time, pulses are allowed to be emitted. The membrane potential V is then updated by the spiking neuron's own membrane potential update module, and then compared with the set threshold voltage v. th Comparison, as a condition for pulse generation. Once t≤T ap When the condition for releasing the pulse is met or t>T, the release pulse is achieved. ap Then the local clock t and the neuron membrane potential V will be reset together.

[0099] Furthermore, in each subsequent inference, sr is calculated using the number of pulses counted in the previous inference process, and then T is calculated respectively. ap And P0, and then perform approximate time coding and pruning operations on the spiking neural network accelerator.

[0100] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0101] Although this application has been described above with reference to specific embodiments, various modifications can be made and components can be replaced with equivalents without departing from the scope of this application. In particular, as long as there is no structural conflict, the features in the specific embodiments disclosed in this application can be combined with each other in any way. The lack of an exhaustive description of these combinations in this specification is merely for the sake of brevity and resource conservation. Therefore, this 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 shallow spiking neural network accelerators, characterized in that, Includes the following steps: S1. For the spiking neural network accelerator to be designed, calculate the emission time of the pulse received by the input neurons of the spiking neural network accelerator, which is used to process the input data and convert it into a time-series pulse sequence; The specific implementation method of step S1 is to convert the input data into a time-series pulse sequence in the CPU, and the pulse emission time t of the input neuron of the spiking neural network accelerator is used to receive the pulse. in The calculation formula is: t in =f(p)=(p max -p) / p max *T w (1) Where p is the pixel value of the input image, p max T is the maximum value of the pixels in the input image. w For the neuron time window of the SNN accelerator; S2. Extract the average pulse rate of the spiking neural network accelerator to be designed; In step S2, the spiking neural network accelerator to be designed is run on a software platform based on the open-source PyTorch framework. The input neuron emission time t of the spiking neural network accelerator obtained in step S1 is used as the input. in As the input pulse, the average pulse rate of the SNN is obtained. S3. Based on the average pulse rate obtained in step S2, construct an adaptive configuration method for approximate time coding and calculate the approximate time window T. ap ; 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 the neuron behavior. The formula for calculating the pulse time of the information transmitted internally by the time-encoded SNN is as follows: t f (x)=(T w -1)(1-x) (2) Among them, t f (x) represents the value of the moment when a pulse is emitted within the time window, where x is the pulse density of the neuron; S3.

2. Set the neuron's pulse density x as the pulse rate and the neuron's time window T of the SNN accelerator. w The product of these factors is used to calculate the probability P0 of the neuron firing a pulse at the end of the time window. The formula is as follows: Using P0 as the probability of an idle time window, we can further refine P0 by matching it with the neuron time window T of the SNN accelerator. w Multiplying these yields the change ΔT in the neuron time window of the SNN accelerator. w The calculation formula is: S3.

3. Using ΔT w The approximate time window T is calculated. ap The calculation formula is: T ap =T w -ΔT w ,ΔT w ≤0.5T w ; (5) S4. Perform synaptic pruning on the spiking neural network accelerator to be designed, 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 coding method for shallow spiking neural network accelerators according to claim 1, characterized in that, The specific implementation method of step S4 includes the following steps: S4.

1. Perform synaptic pruning on the spiking neural network accelerator to be designed; select the probability P0 of a neuron firing a pulse at the end of the time window as 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 *Set the synaptic weights of *c to 0 to obtain the approximate synaptic weight matrix w after pruning. th The expression is: Where sr is the pulse rate of the SNN, and c ranges from 0.8 to 1.2; S4.

2. Introduce a local clock time t to each neuron, and add a judgment unit to the output of each neuron to make a judgment when the local clock time t ≤ T. ap A pulse can be emitted when t≤T ap When the condition for releasing the pulse is met or t>T, the release pulse is achieved. ap Then, the local clock time t and the input layer neuron V in the spiking neural network accelerator are simultaneously reset, and after adjustment, they wait for the time window to enter a new neuron.

3. The approximate time coding method for shallow spiking neural network accelerators according to claim 2, characterized in that, The time encoding generator is designed to consist of a decision module, a counter, and a logic AND gate.

4. The approximate time coding method for shallow spiking neural network accelerators according to claim 3, characterized in that, In each subsequent inference, sr is calculated using the pulse count from the previous inference, and then T is calculated respectively. ap And P0, and then perform approximate time coding and pruning operations on the spiking neural network accelerator.

5. The approximate time coding method for shallow spiking neural network accelerators according to claim 4, characterized in that, For SNN accelerators that have already been designed, skip step S2.

6. The approximate time coding method for shallow spiking neural network accelerators according to claim 5, characterized in that, For SNN accelerators that have already been designed, skip the pruning operation in step S4.