Training method and device of pulse neural network, electronic equipment and computing system

By adding noise when training a spiking neural network on a high-precision device to mimic low-precision quantization noise, the problem of decreased output accuracy after deployment on low-precision devices is solved, thus improving the robustness of the network.

CN115713110BActive Publication Date: 2026-06-23LYNXI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LYNXI TECH CO LTD
Filing Date
2022-11-11
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

When deploying high-precision spiking neural networks on low-precision devices, small changes in the source operands can cause quantization noise to affect the accuracy of the output data due to the spiking mechanism of neurons.

Method used

When training a spiking neural network on a high-precision device, the robustness of the network can be improved by adding noise during the forward and backward propagation stages to mimic low-precision quantization noise.

Benefits of technology

It improves the robustness of spiking neural networks to quantization noise, ensuring that accurate processing results can still be output after deployment on low-precision devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115713110B_ABST
    Figure CN115713110B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a method and device for training a spiking neural network, an electronic device and a computing system. The method comprises: inputting a spiking signal corresponding to a training sample into the spiking neural network; and training the spiking neural network according to a back propagation rule, wherein noise is added to a signal transmitted to a next network layer in at least one of a forward propagation stage and a back propagation stage. By simulating low-precision quantization noise during the training process, the robustness of the spiking neural network to quantization noise can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a training method, apparatus, electronic device, and computing system for a spiking neural network. Background Technology

[0002] When a spiking neural network trained on a high-precision device is deployed to a low-precision device, small changes in the source operands can cause significant differences in the results due to the spiking mechanism of the neurons. Therefore, the accuracy of the output data of a spiking neural network deployed on a low-precision device will be affected by quantization noise. Summary of the Invention

[0003] In view of the above, the present disclosure provides at least one training method, apparatus, electronic device, storage medium, and computing system for a spiking neural network.

[0004] According to a first aspect of this disclosure, a method for training a spiking neural network is provided, the method comprising: inputting a pulse signal corresponding to a training sample into the spiking neural network; training the spiking neural network according to a backpropagation rule, wherein, in at least one of the forward propagation stage and the backpropagation stage, noise is added to the signal transmitted to the next network layer.

[0005] In some embodiments, adding noise to the signal transmitted to the next network layer during the forward propagation phase includes: for at least one pair of adjacent network layers in the spiking neural network, inputting the membrane voltage of a first network layer and a first noise into a second network layer, wherein the first noise is generated based on the membrane voltage of the first network layer, and the first network layer precedes the second network layer.

[0006] In some embodiments, the method further includes adding a noise layer between the adjacent network layers, the noise layer being used to generate the first noise.

[0007] In some embodiments, the variance of the first noise is proportional to the variance of the membrane voltage, and the mean of the first noise is 0.

[0008] In some embodiments, adding noise to the signal transmitted to the next network layer during the backpropagation phase includes adding a second noise to the surrogate function of the impulse response function in the spiking neural network.

[0009] In some embodiments, adding a second noise to the surrogate function of the impulse response function includes adding a second noise to the amplitude of the surrogate function.

[0010] In some embodiments, the variance of the second noise is a constant less than a set threshold, and the mean of the second noise is 0.

[0011] In some embodiments, the method is applied to a first device, the accuracy of which is higher than that of a second device, the second device being used to deploy a trained spiking neural network.

[0012] In some embodiments, the method further includes adding a conversion layer before the second network layer, the conversion layer being used to convert the first noise output by the noise layer from a first precision to a second precision, wherein the first precision is higher than the second precision.

[0013] According to a second aspect of this disclosure, a training apparatus for a spiking neural network is provided. The apparatus includes: an input unit for inputting pulse signals corresponding to training samples into the spiking neural network; and a training unit for training the spiking neural network according to a backpropagation rule. The training unit includes a noise-adding subunit, which adds noise to the signal transmitted to the next network layer during at least one of the forward propagation phase and the backpropagation phase.

[0014] In some embodiments, when the noise addition unit is used to add noise to the signal transmitted to the next network layer during the forward propagation phase, it is specifically used to: for at least one pair of adjacent network layers in the spiking neural network, input the membrane voltage of the first network layer and the first noise to the second network layer, wherein the first noise is generated according to the membrane voltage of the first network layer, and the first network layer is before the second network layer.

[0015] In some embodiments, the apparatus further includes a noise layer generation unit for adding a noise layer between the adjacent network layers, the noise layer being used to generate the first noise.

[0016] In some embodiments, the variance of the first noise is proportional to the variance of the membrane voltage, and the mean of the first noise is 0.

[0017] In some embodiments, when the noise-adding subunit is used to add noise to the signal transmitted to the next network layer during the backpropagation phase, it is specifically used to: add noise to the signal transmitted to the next network layer during the backpropagation phase includes: adding a second noise to the surrogate function of the impulse response function in the spiking neural network.

[0018] In some embodiments, when the noise-adding subunit is used to add second noise to the surrogate function of the impulse response function, it is specifically used to add second noise to the amplitude of the surrogate function.

[0019] In some embodiments, the variance of the second noise is a constant less than a set threshold, and the mean of the second noise is 0.

[0020] In some embodiments, the apparatus is applied to a first device, the first device having higher accuracy than a second device, the second device being used to deploy a trained spiking neural network.

[0021] In some embodiments, the apparatus further includes a conversion layer generation unit for adding a conversion layer before the second network layer, the conversion layer being used to convert the first noise output by the noise layer from a first precision to a second precision, wherein the first precision is higher than the second precision.

[0022] According to a third aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory storing computer-readable instructions, which, when executed by the processor, implement the training method of a spiking neural network according to any embodiment of this disclosure.

[0023] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided, comprising: a computer program that, when executed by a processor, implements a training method for a spiking neural network according to any embodiment of this disclosure.

[0024] According to a fifth aspect of this disclosure, a computing system is provided, comprising: a first device for inputting pulse signals corresponding to training samples into a spiking neural network, training the spiking neural network according to a backpropagation rule, wherein noise is added to the signal transmitted to the next network layer in at least one of the forward propagation phase and the backpropagation phase; and a second device for acquiring pulse signals corresponding to data to be processed, processing the pulse signals through the trained spiking neural network, and outputting a processing result; wherein the accuracy of the first device is higher than the accuracy of the second device.

[0025] In this embodiment of the disclosure, when the pulse signal corresponding to the training sample is input into the spiking neural network and the spiking neural network is trained according to the backpropagation rule, noise is added to the signal transmitted to the next network layer in at least one of the forward propagation and backpropagation stages. By mimicking low-precision quantization noise during the training process to perturb the features, the robustness of the spiking neural network to quantization noise can be improved. Attached Figure Description

[0026] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which:

[0027] Figure 1 A flowchart illustrating a training method for a spiking neural network according to an embodiment of the present disclosure is shown schematically.

[0028] Figure 2A A schematic diagram of a spiking neural network according to an embodiment of the present disclosure is shown.

[0029] Figure 2B A schematic diagram of another spiking neural network according to an embodiment of the present disclosure is shown.

[0030] Figure 2C A schematic diagram of another spiking neural network according to an embodiment of the present disclosure is shown.

[0031] Figure 3 This diagram illustrates the addition of a second noise to the surrogate function of the impulse function;

[0032] Figure 4 A schematic diagram of a training apparatus for a spiking neural network according to an embodiment of the present disclosure is shown.

[0033] Figure 5 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown.

[0034] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0035] The principles and spirit of this disclosure will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement this disclosure, and are not intended to limit the scope of this disclosure in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.

[0036] Those skilled in the art will recognize that embodiments of this disclosure can be implemented as a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0037] When deploying a spiking neural network trained on a high-precision device to a low-precision device, small changes in the source operands can lead to significant differences in results due to the spiking mechanism of neurons.

[0038] Taking the deployment of a single-precision (fp32) spiking neural network to a half-precision (fp16) device as an example, suppose there are 200 data points with the error of 0->1 or 1->0 in 1 million data points. Although the error of a single data point is very small, the impact gradually increases as the result propagates to deeper layers and as the time step increases, eventually affecting the result.

[0039] It is evident that spiking neural networks trained on high-precision equipment will have their output data accuracy affected by quantization noise when deployed on low-precision equipment.

[0040] In view of this, to enhance the anti-quantization noise performance of spiking neural networks, this disclosure proposes a training method for spiking neural networks. This method is applicable to scenarios where the spiking neural network is trained on a high-precision device and deployed on a low-precision device for inference. Here, high precision can refer to fp64, fp32, etc., and low precision can refer to fp16, fp8, etc. Those skilled in the art should understand that the above precision values ​​are merely examples, and this disclosure does not impose specific limitations on them.

[0041] Figure 1 A flowchart illustrating a training method for a spiking neural network according to an embodiment of this disclosure is shown schematically. The training method for the spiking neural network can be executed by a server, which may include a local server or a cloud server, etc. The method can also be implemented by a processor calling computer-readable instructions stored in memory. For example... Figure 1 As shown, the method may include the following processes:

[0042] In step 101, the pulse signal corresponding to the training sample is input into the spiking neural network.

[0043] The pulse signal corresponding to the training sample can be a pulse signal generated based on the training sample.

[0044] In some embodiments, the training samples themselves are in the form of pulse signals, or pulse signals can be generated by pulse encoding the original training samples; the pulse signals can be in the form of pulse sequences.

[0045] In some embodiments, the pulse signal corresponding to the training sample may include at least one of the following: image pulse sequence corresponding to image sample, audio pulse sequence corresponding to audio sample, text pulse sequence corresponding to text sample, and video pulse sequence corresponding to video sample; in some embodiments, the pulse signal corresponding to the training sample may also include pulse signals corresponding to feature maps, feature points, and other feature information.

[0046] In some embodiments, before the step of inputting the pulse signal corresponding to the training sample into the spiking neural network to be trained, the method may further include: initializing various parameters of the spiking neural network, including synaptic weights, activation parameters, etc.

[0047] In some embodiments, the neuron model of the spiking neural network can employ a Leaky Integrate-and-Fire (LIF) model. In the LIF model, a pulse is generated when the neuron's membrane voltage reaches a threshold voltage. The membrane voltage refers to the voltage generated by stimulation from other neurons connected to the neuron, and this membrane voltage is calculated based on the stimulation signals emitted by those neurons. Specifically, the input potential can be obtained by weighting the multiple stimulation signals according to their respective weights, and then summed with the neuron's membrane voltage at the previous time step to obtain the current membrane voltage.

[0048] In step 102, the spiking neural network is trained according to the backpropagation rule.

[0049] The backpropagation rule includes a forward propagation stage and a backpropagation stage. Backpropagation is performed based on the error between the actual output value and the expected output value in the forward propagation stage. This process is repeated iteratively to learn and train the parameters of the spiking neural network model.

[0050] In this embodiment of the disclosure, noise is added to the signal transmitted to the next network layer during at least one of the forward propagation phase and the backward propagation phase.

[0051] By adding noise to the transmitted signal during training, low-precision quantization noise can be mimicked. This allows a spiking neural network trained on a high-precision device to still output accurate processing results when deployed on a low-precision device, even when the input signal is disturbed by quantization noise. This improves the spiking neural network's resistance to noise and enhances its robustness to quantization noise. Furthermore, the inference process using the spiking neural network does not include the step of adding noise; therefore, the noise added by the training method proposed in this embodiment has no impact on the inference model.

[0052] After training, the spiking neural network can be used to implement various functions, including object detection, behavior recognition, and image processing. When training the neural network, appropriate training samples are selected according to the functions to be implemented, such as image feature information and image sequences. Those skilled in the art should understand that regardless of the specific function implemented by the neural network, the methods provided in this disclosure can be used for training.

[0053] In this embodiment of the disclosure, when the pulse signal corresponding to the training sample is input into the spiking neural network and the spiking neural network is trained according to the backpropagation rule, noise is added to the signal transmitted to the next network layer in at least one of the forward propagation and backpropagation stages. By mimicking low-precision quantization noise during the training process to perturb the features, the robustness of the spiking neural network to quantization noise can be improved.

[0054] During the forward propagation phase, noise can be added to the signal transmitted to the next network layer by the following method: for at least one pair of adjacent network layers in a spiking neural network, the membrane voltage of the first network layer and the first noise are input together to the second network layer, wherein the first noise is generated according to the membrane voltage of the first network layer, and the first network layer is before the second network layer.

[0055] Assuming the membrane voltage of the first network layer is V, a first noise Δ1 can be generated based on the membrane voltage V. The sum V' of the membrane voltage V of the first network layer and the first noise Δ1 in the adjacent network layers is input to the second network layer, so that the input signal of the second network layer contains the disturbance of the first noise Δ1. When V' is greater than the threshold voltage (pulse firing threshold) Vth of the second network layer, the second network layer outputs a pulse; when V' is less than or equal to the threshold voltage Vth of the second network layer, no pulse is output.

[0056] Since V' contains the first noise Δ1, the parameters in the spiking neural network are adjusted through backpropagation rules during training to address noise interference. This allows the spiking neural network trained on a high-precision device to still output accurate processing results when deployed on a low-precision device, even when the input signal is disturbed by quantization noise. This improves the spiking neural network's ability to resist noise and enhances its robustness to quantization noise.

[0057] It should be noted that the spiking neural network in the embodiments of this disclosure may include a pair of adjacent network layers as described above, or may include multiple pairs of such adjacent network layers. The specific number of the adjacent network layers described above is not limited in this disclosure.

[0058] In one example, a noise layer can be added between adjacent network layers to generate the initial noise. See also Figure 2AThe diagram illustrates the structure of a spiking neural network. The first network layer 201 and the second network layer 202 are a pair of adjacent network layers. The first network layer 201 precedes the second network layer 202; that is, during the forward propagation phase, the signal flows from the first network layer 201 to the second network layer 202. A noise layer 203 is added between the first network layer 201 and the second network layer 202. The membrane voltage V of the first network layer 201 is input to the noise layer 203. The noise layer 203 generates a first noise Δ1 based on this membrane voltage V, and uses the sum of the membrane voltage V of the first network layer 201 and the first noise Δ1, V', as the output data of the noise layer, which is then input to the second network layer 202.

[0059] See another example. Figure 2B The diagram of another spiking neural network shown also demonstrates how variance statistics module 204 can be used to calculate the noise output of noise layer 203. Specifically, variance statistics module 204 can perform feature statistics based on the output of first network layer 201 to ensure that the amplitude of the added first noise has a certain proportional relationship with the variance of the film voltage V of first network layer 201. For example, the variance of the first noise Δ1 can be... in, The variance of the membrane voltage V of the first network layer 201 is represented, and the mean of the first noise Δ1 is 0. The added first noise can be Gaussian random white noise, uniformly distributed noise, or other noise that conforms to the above distribution pattern.

[0060] In the above embodiments, noisy data is added for training during the forward propagation phase, while in the backpropagation phase, since the added noise has no derivative, it is equivalent to no noise being added. Furthermore, when deploying the spiking neural network trained on a high-precision device to a low-precision device for inference, the noise layer that generates the first noise is not added.

[0061] Suppose a spiking neural network is trained on a first device with first precision and deployed on a second device with second precision, where the first precision is higher than the second precision, for example, the first precision is fp32 and the second precision is fp16. In this case, a transformation layer can be added before the second network layer to convert the first noise output from the noise layer from the first precision to the second precision.

[0062] See Figure 2CThe diagram shows another type of spiking neural network structure. The first network layer 201 and the second network layer 202 are a pair of adjacent network layers in the spiking neural network. The first network layer 201 precedes the second network layer 202; that is, during the forward propagation phase, the signal flows from the first network layer 201 to the second network layer 202. A noise layer 203 exists between the first network layer 201 and the second network layer 202. The noise layer 203 outputs a first noise Δ1 based on the calculation result of the variance statistics module 204. The sum of the membrane voltage V of the first network layer 201 and the first noise Δ1, V', is used as the output data of the noise layer 203 and input to the conversion layer 205 to obtain converted data V'". The converted data V' is then used as the input signal to the second network layer 202. The output data V' of the noise layer 203 has a first precision, and the output data V' of the conversion layer 205 has a second precision. The first precision is higher than the second precision; for example, the first precision is fp32, and the second precision is fp16.

[0063] By comparing the low-precision input signal V” with the threshold voltage Vth of the second network layer 202 during the training of the spiking neural network on a high-precision device, it is possible to determine whether the second network layer 202 should issue a pulse. This can further reduce the error caused by deploying the spiking neural network on a low-precision device for inference, thereby improving the processing accuracy of the spiking neural network.

[0064] Furthermore, during the backpropagation phase, the conversion layer 205 is shorted, and no reverse conversion of accuracy is performed.

[0065] For spiking neural networks, the difficulty in training using the backpropagation rule lies in the training challenges caused by the non-differentiability of impulses. Taking a pair of adjacent network layers in a spiking neural network—the first and second layers—as an example, in the forward propagation phase, the first layer precedes the second layer, meaning the output signal of the first layer flows to the second layer. In the backpropagation phase, it is necessary to calculate the derivative of the second layer's output signal. However, since this derivative is an impulse function, it cannot be directly used for backpropagation.

[0066] In view of this, embodiments of this disclosure propose a method for improving the robustness of spiking neural networks to quantization noise by adding noise during backpropagation: adding a second noise to the surrogate function of the impulse response function in the spiking neural network. The surrogate function is used to approximate the impulse response; for example, a rectangular function can be used as the surrogate function for the impulse response function, and the second noise is added to this surrogate function.

[0067] In one example, a second noise Δ2 can be added to the magnitude of the surrogate function.

[0068] See Figure 3As shown, h1 represents a rectangular function used to approximate the impulse function. The width of the rectangular function can be set to Δ, and the height can be set to 1 / Δ. Δ is typically set to a small constant, such as 0.5. h2 represents adding a second noise Δ2 to the amplitude of the surrogate function. The variance of the second noise Δ2 can be set to a constant less than a set threshold, and the mean of the second noise Δ2 is 0. This set threshold can be determined based on the height of the rectangular function; for example, it can be set to... Here, p is usually set to a small constant to avoid having too much influence on the magnitude of the surrogate function; for example, p can be set to 0.1.

[0069] In this embodiment of the disclosure, by adding a second noise to the surrogate function of the impulse response function during the backpropagation stage, low-precision quantization noise can be simulated. This allows the spiking neural network trained on a high-precision device to still output accurate processing results when deployed on a low-precision device, even if the signal transmitted during backpropagation is disturbed by quantization noise. This improves the spiking neural network's ability to resist noise and thus enhances its robustness to quantization noise.

[0070] To implement the training method of the spiking neural network in any embodiment of the present disclosure, the present disclosure also provides a training apparatus for the spiking neural network. Figure 4 A schematic diagram of a training apparatus for a spiking neural network according to an embodiment of this disclosure is shown. For example, this apparatus can be applied to an electronic device. In the following description, the functions of each module of the apparatus will be briefly described; detailed processing can be found in conjunction with the description of the training method for a spiking neural network according to any embodiment of this disclosure. Figure 4 As shown, the device may include: an input unit 401, used to input the pulse signal corresponding to the training sample into the spiking neural network;

[0071] Training unit 402 is used to train a spiking neural network according to the backpropagation rule; wherein, the training unit includes a noise addition subunit 4021, which is used to add noise to the signal transmitted to the next network layer in at least one of the forward propagation stage and the backpropagation stage.

[0072] In some embodiments, when the noise-adding subunit is used to add noise to the signal transmitted to the next network layer during the forward propagation phase, it is specifically used to: for at least one pair of adjacent network layers in the spiking neural network, input the membrane voltage of the first network layer and a first noise to the second network layer, wherein the first noise is generated based on the membrane voltage of the first network layer, and the first network layer is before the second network layer.

[0073] In some embodiments, the apparatus further includes a noise layer generation unit for adding a noise layer between the adjacent network layers, the noise layer being used to generate the first noise.

[0074] In some embodiments, the variance of the first noise is proportional to the variance of the membrane voltage, and the mean of the first noise is 0.

[0075] In some embodiments, when the noise-adding subunit is used to add noise to the signal transmitted to the next network layer during the backpropagation phase, it is specifically used to: add noise to the signal transmitted to the next network layer during the backpropagation phase includes: adding a second noise to the surrogate function of the impulse response function in the spiking neural network.

[0076] In some embodiments, when the noise adding unit is used to add second noise to the surrogate function of the impulse response function, it is specifically used to add second noise to the amplitude of the surrogate function.

[0077] In some embodiments, the variance of the second noise is a constant less than a set threshold, and the mean of the second noise is 0.

[0078] In some embodiments, the apparatus is applied to a first device, the first device having higher accuracy than a second device, the second device being used to deploy a trained spiking neural network.

[0079] In some embodiments, the apparatus further includes a conversion layer generation unit for adding a conversion layer before the second network layer, the conversion layer being used to convert the first noise output by the noise layer from a first precision to a second precision, wherein the first precision is higher than the second precision.

[0080] Figure 5 An electronic device provided in at least one embodiment of the present disclosure includes a memory and a processor. The memory is used to store computer instructions that can be executed on the processor, and the processor is used to implement the training method of the spiking neural network according to any embodiment of the present disclosure when executing the computer instructions.

[0081] At least one embodiment of this disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the training method for a spiking neural network according to any embodiment of this disclosure.

[0082] At least one embodiment of this disclosure also provides a computing system, including:

[0083] A first device is used to input the pulse signal corresponding to the training sample into a spiking neural network and train the spiking neural network according to the backpropagation rule, wherein, in at least one of the forward propagation stage and the backpropagation stage, noise is added to the signal transmitted to the next network layer.

[0084] The second device is used to acquire the pulse signal corresponding to the data to be processed, process the pulse signal through a trained spiking neural network, and output the processing result.

[0085] The accuracy of the first device is higher than that of the second device.

[0086] That is, a high-precision first device can be used to train a spiking neural network, and a low-precision second device can be used to deploy the trained spiking neural network for inference. After training the spiking neural network using the training method provided in this embodiment, the robustness of the spiking neural network to quantization noise can be improved when deployed to a low-precision device.

[0087] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, circuit, or computer program product. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0088] This specification also provides a computer-readable storage medium on which a computer program can be stored. When executed by a processor, the program implements the steps of the intelligent driving method described in any embodiment of this specification. The term "and / or" indicates at least one of two options; for example, "A and / or B" includes three options: A, B, and "A and B".

[0089] The same or similar parts between the various embodiments in this specification can be referred to mutually, and each embodiment focuses on describing the differences from other embodiments. In particular, for the method embodiments, since the various steps are basically similar to the functions implemented by the various modules of the intelligent driving device, the description is relatively simple, and relevant parts can be referred to the description of the device embodiments.

[0090] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0091] The embodiments of the subject matter and functional operation described in this specification can be implemented in the following ways: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or combinations thereof. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by a data processing apparatus or for controlling the operation of a data processing apparatus. Alternatively or additionally, the program instructions may be encoded on artificially generated propagation signals, such as machine-generated electrical, optical, or electromagnetic signals, which are generated to encode information and transmit it to a suitable receiving device for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or combinations thereof.

[0092] The processing and logic flow described in this specification can be executed by one or more programmable computers that execute one or more computer programs to perform corresponding functions by operating on input data and generating output. The processing and logic flow can also be executed by dedicated logic circuitry—such as FPGAs (Field-Programmable Gate Arrays) or ASICs (Application-Specific Integrated Circuits), and the device can also be implemented as dedicated logic circuitry.

[0093] Suitable computers for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit receives instructions and data from read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as disks, magneto-optical disks, or optical disks, or the computer will be operatively coupled to such mass storage devices to receive data from or transfer data to them, or both. However, a computer is not required to have such devices. Furthermore, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning circuit (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.

[0094] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, such as semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. Processors and memory may be supplemented by or incorporated into dedicated logic circuitry.

[0095] While this specification contains numerous specific implementation details, these should not be construed as limiting the scope of any invention or the scope of the claims, but rather are primarily intended to describe features of specific embodiments of a particular invention. Certain features described in the various embodiments herein may also be implemented in combination in a single embodiment. Conversely, various features described in a single embodiment may also be implemented separately in various embodiments or in any suitable sub-combination. Furthermore, while features may function in certain combinations as described above and even initially claimed in this way, one or more features from a claimed combination may be removed from that combination in some cases, and a claimed combination may refer to a sub-combination or a variation thereof.

[0096] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order shown or sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various circuit modules and components in the above embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the described program components and circuits can generally be integrated together in a single software product or packaged into multiple software products.

[0097] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings are not necessarily shown in a specific order or sequence to achieve the desired result. In some implementations, multitasking and parallel processing may be advantageous.

[0098] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the scope of protection of one or more embodiments of this specification.

Claims

1. A method of training a spiking neural network, characterized in that, The pulse neural network is trained on a first device with a first precision and deployed to a second device with a second precision, wherein the first precision is higher than the second precision. The method comprises: inputting a pulse signal corresponding to a training sample into a pulse neural network; training the pulse neural network according to a back propagation rule, wherein noise is added to a signal transmitted to a next network layer in at least one of a forward propagation stage and a back propagation stage; wherein adding noise to the signal transmitted to the next network layer in the forward propagation stage comprises: for at least one pair of adjacent network layers in the pulse neural network, jointly inputting a membrane voltage of a first network layer and a first noise in the adjacent network layers into a second network layer, the first noise being generated according to the membrane voltage of the first network layer, the first network layer being before the second network layer; the method further comprises: adding a conversion layer before the second network layer, the conversion layer being used to convert the first noise from the first precision to the second precision.

2. The method of claim 1, wherein, the method further comprises: adding a noise layer between the adjacent network layers, the noise layer being used to generate the first noise.

3. The method of claim 1, wherein, a variance of the first noise has a proportional relationship with a variance of the membrane voltage, and a mean of the first noise is 0.

4. The method of claim 1, wherein, adding noise to the signal transmitted to the next network layer in the back propagation stage comprises: adding a second noise in a proxy function of an impulse response function in the pulse neural network, to simulate low-precision quantization noise.

5. The method of claim 4, wherein, adding the second noise in the proxy function of the impulse response function comprises: adding the second noise on an amplitude of the proxy function.

6. The method of claim 4, wherein, a variance of the second noise is a constant less than a set threshold, and a mean of the second noise is 0.

7. A device for training a spiking neural network, characterized in that The pulse neural network is trained on a first device with a first precision and deployed to a second device with a second precision, wherein the first precision is higher than the second precision. The device comprises: an input unit configured to input a pulse signal corresponding to a training sample into a pulse neural network; a training unit configured to train the pulse neural network according to a back propagation rule; wherein the training unit comprises a noise adding subunit configured to add noise to a signal transmitted to a next network layer in at least one of a forward propagation stage and a back propagation stage; wherein adding noise to the signal transmitted to the next network layer in the forward propagation stage comprises: for at least one pair of adjacent network layers in the pulse neural network, jointly inputting a membrane voltage of a first network layer and a first noise in the adjacent network layers into a second network layer, the first noise being generated according to the membrane voltage of the first network layer, the first network layer being before the second network layer; the device further comprises a conversion layer generation unit configured to add a conversion layer before the second network layer, the conversion layer being used to convert the first noise from the first precision to the second precision.

8. An electronic device, comprising: comprises: a processor; and A memory storing computer-readable instructions that, when executed by the processor, implement the training method for a spiking neural network as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, It includes a computer program that, when executed by a processor, implements the training method for a spiking neural network as described in any one of claims 1 to 6.

10. A computing system, comprising: include: A first device is used to input the pulse signal corresponding to the training sample into a spiking neural network and train the spiking neural network according to the backpropagation rule, wherein, in at least one of the forward propagation stage and the backpropagation stage, noise is added to the signal transmitted to the next network layer. The second device is used to acquire the pulse signal corresponding to the data to be processed, process the pulse signal through a trained spiking neural network, and output the processing result. Wherein, the first accuracy of the first device is higher than the second accuracy of the second device; Adding noise to the signal transmitted to the next network layer during the forward propagation phase includes: For at least one pair of adjacent network layers in the spiking neural network, the membrane voltage of the first network layer and a first noise are jointly input to the second network layer. The first noise is generated based on the membrane voltage of the first network layer, and the first network layer is before the second network layer. A conversion layer is included before the second network layer, which is used to convert the first noise from the first precision to the second precision.