A spiking neural network structure

By using resistive random access memory and comparators to generate random numbers in spiking neural networks, the problems of high device consistency and resource consumption are solved, achieving efficient synaptic weight adjustment and reducing operational complexity.

CN116245147BActive Publication Date: 2025-12-05INST OF MICROELECTRONICS CHINESE ACAD OF SCI LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111470318.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2025-12-05
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

In spiking neural networks, existing probabilistic STDP training rules suffer from poor device consistency and high resource consumption, making them difficult to implement in large-scale applications.

Method used

A probability selection unit based on resistive random access memory (RRAM) is used to generate random numbers related to a preset probability through a comparator. Combining the random noise characteristics of RRAM, a spiking neural network structure is designed to adjust synaptic weights.

Benefits of technology

It improves device consistency with limited resources, reduces operational difficulty and power consumption, simplifies the random number generation process, and is suitable for large-scale integration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116245147B_ABST
    Figure CN116245147B_ABST
Patent Text Reader

Abstract

The application provides a pulse neural network structure, comprising a first neuron, a synaptic unit and a second neuron connected in sequence, and a probability selection unit connected with the first neuron, the probability selection unit is used for generating a random number, the first neuron is used for determining a required action of the synaptic unit as a long-term potentiation action or a long-term depression action according to an actual time difference of a first pulse emitted by the first neuron and a second pulse emitted by the second neuron, when the random number is a preset random number, an adjusting pulse is sent to the synaptic unit according to the required action of the synaptic unit, the synaptic unit is used for storing a synaptic weight, and the synaptic weight is adjusted according to the adjusting pulse. In the embodiment of the application, the probability selection unit is designed based on a resistive random access memory, a large amount of resources is saved, and the stability is relatively high without depending on the device characteristics of the resistive random access memory, so that higher device consistency can be realized by using limited resources.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computers, and in particular to a pulse neural network structure. BACKGROUND

[0002] In the era of big data, current digital data has shown explosive growth. Due to the existence of a storage wall between a memory and a computing unit, a deep learning hardware platform based on a Von Neumann structure consumes a huge amount of energy. A spike neural network (SNN) as a new type of computing paradigm inspired by biology can effectively solve the bottleneck of power consumption and storage.

[0003] There are mainly two training rules for synapses in a current SNN: a deterministic spike timing dependent plasticity (STDP) and a probabilistic STDP. The training rule based on the deterministic STDP has two significant shortcomings: the decay of the STDP is complex to be implemented by a hardware circuit and needs to consume a large chip area, and a large number of digital or analog storage units are needed to store synaptic weights. In comparison, the probabilistic STDP has more advantages in hardware implementation, resource consumption, and training effect.

[0004] There are mainly two methods to implement the probabilistic STDP in the SNN: one is to use the probability conversion characteristics of a device itself, and the other is to implement it by an external probability generation circuit. In the first scheme, new devices such as RRAM, PCM, and MRAM can be selected, and the basic principle is that the resistance of the new device itself changes with the number, amplitude, and width of the applied pulse to produce a probabilistic flip. This scheme has a significant disadvantage: the flip probability varies with the applied pulse (such as the number, amplitude, and width of the pulse) inconsistently between different new devices, and needs to be corrected by an additional circuit. At the same time, the device is greatly affected by the external environment (such as temperature and noise), and the consistency of the device is not good. In the second scheme, a probability generation circuit is added when designing the synapse, a random number is generated by a pseudo-random number generator (such as a linear feedback shift register), and a probability adjustable is realized by combining a peripheral logic circuit (such as a combinational logic gate). Finally, the probabilistic synapse is implemented by a digital circuit method. This method has a significant problem of excessive resource consumption, and lacks support for core peripheral circuits. At the same time, the random number generator module is implemented by a digital circuit, and the power consumption is large. Due to the above problems of device consistency, resource consumption, and high power consumption, the above two schemes are not conducive to application in a large-scale SNN.

[0005] In the probabilistic STDP, how to use limited resources to achieve high device consistency is an important problem in the field. SUMMARY

[0006] Therefore, the present application aims to provide a pulse neural network structure.

[0007] Specifically, the present application provides a pulse neural network structure, comprising a first neuron, a synapse unit and a second neuron connected in sequence, and a probability selection unit connected with the first neuron.

[0008] The present application provides a pulse neural network structure, comprising a first neuron, a synapse unit and a second neuron connected in sequence, and a probability selection unit connected with the first neuron.

[0009] The probability selection unit comprises a first resistive random access memory, a reference resistor and a comparator; wherein a first end of the first resistive random access memory is used to be applied with a first voltage, a second end of the first resistive random access memory is connected with a first end of the reference resistor, and a second end of the reference resistor is used to be applied with a second voltage; a positive input end of the comparator is connected with the second end of the first resistive random access memory, a negative input end of the comparator is used to be applied with a reference voltage, and a comparison result output by an output end of the comparator is used as a random number; and the reference voltage is determined according to a preset probability.

[0010] The first neuron is used to determine a required action of the synapse unit as a long-term potentiation action or a long-term depression action according to an actual time difference of a first pulse emitted by the first neuron and a second pulse emitted by the second neuron; and when the random number is a preset random number, an adjusting pulse is sent to the synapse unit according to the required action of the synapse unit.

[0011] The synapse unit is used to store a synapse weight and adjust the synapse weight according to the adjusting pulse.

[0012] Optionally, the probability selection unit further comprises a first transistor, a first end of the first transistor is connected with the second end of the reference resistor, a second end of the first transistor is used to be applied with the second voltage, and a control end of the first transistor is used to be applied with a control signal.

[0013] Optionally, the synapse unit comprises a second resistive random access memory, or the synapse unit comprises an interconnected second resistive random access memory and a second transistor.

[0014] Optionally, the adjusting pulse corresponding to the long-term potentiation action is a set pulse, and the adjusting pulse corresponding to the long-term depression action is a reset pulse.

[0015] Optionally, the probability selection unit comprises a first selection unit and a second selection unit, the first selection unit is configured to generate a random number corresponding to the LTP based on a preset probability corresponding to the LTP, and the second selection unit is configured to generate a random number corresponding to the LTD based on a preset probability corresponding to the LTD; and when the random number is a preset random number, the adjustment pulse is sent to the synaptic unit according to the requirement of the synaptic unit, comprising:

[0016] when the requirement of the synaptic unit is the LTP, if the random number corresponding to the LTP is a preset random number, the adjustment pulse of the LTP is sent to the synaptic unit;

[0017] when the requirement of the synaptic unit is the LTD, if the random number corresponding to the LTD is a preset random number, the adjustment pulse of the LTD is sent to the synaptic unit.

[0018] Optionally, the probability selection unit comprises a first selection unit and a second selection unit, the first selection unit is configured to generate a random number corresponding to the LTP based on a preset probability corresponding to the LTP, and the second selection unit is configured to generate a random number corresponding to the LTD based on a preset probability corresponding to the LTD; and when the random number is a preset random number, the adjustment pulse is sent to the synaptic unit according to the requirement of the synaptic unit, comprising:

[0019] the LTP corresponds to a plurality of continuous first time difference ranges; and the plurality of random numbers corresponding to the LTP correspond to the plurality of first time difference ranges respectively;

[0020] the LTD corresponds to a plurality of continuous second time difference ranges; and the plurality of random numbers corresponding to the LTD correspond to the plurality of second time difference ranges respectively;

[0021] when the random number is a preset random number, the adjustment pulse is sent to the synaptic unit according to the requirement of the synaptic unit, comprising:

[0022] when the requirement of the synaptic unit is the LTP, if the random number corresponding to the first time difference range to which the actual emission time difference belongs is a preset random number, the adjustment pulse of the LTP is sent to the synaptic unit;

[0023] when the requirement of the synaptic unit is the LTD, if the random number corresponding to the second time difference range to which the actual emission time difference belongs is a preset random number, the adjustment pulse of the LTD is sent to the synaptic unit.

[0024] Optionally, the first unit group comprises three probability selection units, and the second unit group comprises three probability selection units.

[0025] Optionally, the pulse neural network structure further comprises:

[0026] a counter configured to calculate a reference clock quantity between the time of emitting the first pulse and the time of emitting the second pulse based on a reference clock signal; the actual time difference of emitting is determined according to a period of the reference clock signal and the reference clock quantity.

[0027] Optionally, the first neuron, the synapse unit and the second neuron are multiple, and one synapse unit is arranged between one first neuron and one second neuron.

[0028] Optionally, the second neuron has a leaky integrate-and-fire neuron model, configured to send a second pulse to the first neuron connected with the second neuron when activated.

[0029] The embodiment of the application provides a pulse neural network structure, comprising a first neuron, a synapse unit and a second neuron connected in sequence, and a probability selection unit connected with the first neuron, the probability selection unit is configured to generate a random number, the first neuron is configured to determine a required action of the synapse unit as a long-term potentiation action or a long-term depression action according to an actual time difference of emitting a first pulse emitted by the first neuron and a second pulse emitted by the second neuron, send an adjustment pulse to the synapse unit according to the required action of the synapse unit when the random number is a preset random number, and the synapse unit is configured to store a synapse weight and adjust the synapse weight according to the adjustment pulse.

[0030] Optionally, the probability selection unit can comprise a first resistive random access memory, a reference resistor and a comparator, a first end of the first resistive random access memory is configured to be applied with a first voltage, a second end of the first resistive random access memory is connected with a first end of the reference resistor, and a second end of the reference resistor is configured to be applied with a second voltage, so that the voltage of the second end of the first resistive random access memory fluctuates due to the random noise inherent in the first resistive random access memory, the second end of the first resistive random access memory is connected to a positive input end of the comparator, a negative input end of the comparator is configured to be applied with a reference voltage, and a comparison result output by an output end of the comparator can be used as the random number, and the reference voltage is determined according to a preset probability, so that the random number is related to the preset probability.

[0031] In the embodiments of the present application, the probabilistic selection unit is designed based on the resistive random access memory, which saves a large amount of resources compared with the method of using linear feedback shift register. The probabilistic selection unit based on the resistive random access memory does not depend on the device characteristics of the resistive random access memory, so the stability is higher, and therefore the device consistency can be realized with limited resources. In addition, the correlation between the preset probability and the random number is established by using the comparator, and the adjustment of the random number is simpler and more flexible compared with the logic gate method, and also has a simple code, which reduces the operation difficulty. BRIEF DESCRIPTION OF DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0033] Figure 1 A schematic diagram of a pulse neural network structure provided in the embodiments of the present application;

[0034] Figure 2 A schematic diagram of a probabilistic STDP rule in the embodiments of the present application;

[0035] Figure 3 A circuit diagram of a probabilistic selection unit provided in the embodiments of the present application;

[0036] Figure 4 A flowchart of an operation method of a pulse neural network in the embodiments of the present application;

[0037] Figure 5 A schematic diagram of an operation timing provided in the embodiments of the present application;

[0038] Figure 6 A schematic diagram of a simplified probabilistic STDP rule in the embodiments of the present application;

[0039] Figure 7 A schematic diagram of another simplified probabilistic STDP rule in the embodiments of the present application;

[0040] Figure 8 A schematic diagram of another pulse neural network structure provided in the embodiments of the present application. DETAILED DESCRIPTION

[0041] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings.

[0042] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be practiced without the specific details. In other instances, well-known methods have not been described in detail in order not to unnecessarily obscure aspects of the present application.

[0043] As described in the background, there are two main methods to realize probabilistic STDP in the current pulse neural network: one is to use the probabilistic conversion characteristics of the device itself, and the other is to realize it through an external probability generation circuit. The basic principle of the first scheme is that the resistance of the new device itself changes with the number, amplitude and width of the applied pulse to produce probabilistic flipping. This scheme has a significant disadvantage: the flipping probability varies with the applied pulse inconsistently between different new devices, and needs to be corrected by an additional circuit. At the same time, the device is greatly affected by the external environment, and the consistency of the device is not good. The second scheme increases the probability generation circuit when designing the synapse, generates random numbers through a pseudo-random number generator, combines the peripheral logic circuit to realize the adjustable probability, and finally realizes the probabilistic synapse by using the method of digital circuit. This method has the obvious problem of excessive resource consumption, and lacks the support of core peripheral circuit. At the same time, the external random number generator module is realized by digital circuit, and the power consumption is large.

[0044] In probabilistic STDP, how to use limited resources to achieve high device consistency is an important problem in the field.

[0045] Based on the above technical problems, the embodiments of the present application provide a pulse neural network structure, comprising a first neuron, a synapse unit and a second neuron connected in sequence, and a probability selection unit connected with the first neuron, the probability selection unit is used to generate a random number, the first neuron is used to determine the required action of the synapse unit as long-term potentiation or long-term depression according to the actual time difference of the first pulse emitted by the first neuron and the second pulse emitted by the second neuron, when the random number is a preset random number, the adjustment pulse is sent to the synapse unit according to the required action of the synapse unit, and the synapse unit is used to store the synapse weight and adjust the synapse weight according to the adjustment pulse.

[0046] The probability selection unit can include a first resistive random access memory, a reference resistor and a comparator, a first end of the first resistive random access memory is configured to be applied with a first voltage, a second end of the first resistive random access memory is connected with a first end of the reference resistor, a second end of the reference resistor is configured to be applied with a second voltage, the voltage at the second end of the first resistive random access memory fluctuates due to the random noise inherent in the first resistive random access memory, the second end of the first resistive random access memory is connected to a positive input end of the comparator, a negative input end of the comparator is configured to be applied with a reference voltage, a comparison result output by an output end of the comparator can be used as a random number, the reference voltage is determined according to a preset probability, and the random number is related to the preset probability.

[0047] In the embodiment of the application, the probability selection unit is designed based on the resistive random access memory, a large amount of resources is saved compared with the method of using a linear feedback shift register, the probability selection unit based on the resistive random access memory does not depend on the device characteristics of the resistive random access memory, and therefore has high stability, so that high device consistency can be realized by using limited resources. In addition, the correlation between the preset probability and the random number is established by using the comparator, the adjustment of the random number is simpler and more flexible compared with the logic gate method, and the random number also has a simple code, thereby reducing the operation difficulty.

[0048] In order to facilitate understanding, the pulse neural network structure provided by the embodiment of the application is described in detail below with reference to the accompanying drawings.

[0049] Reference Figure 1 As shown in the figure, the pulse neural network structure provided by the embodiment of the application is a schematic diagram of a pulse neural network structure, the pulse neural network includes a first neuron, a synaptic unit and a second neuron connected in sequence, and a probability selection unit connected with the first neuron.

[0050] In the embodiment of the application, the first neuron, the synaptic unit and the second neuron are basic units in the pulse neural network, the first neuron and the second neuron can send pulses, the synaptic unit is configured to store synaptic weights, the synaptic weights represent the connection weights between the first neuron and the second neuron, when the synaptic weights are large, the correlation between the first neuron and the second neuron is high, and when the synaptic weights are small, the correlation between the first neuron and the second neuron is low.

[0051] Generally, when presynaptic discharge precedes postsynaptic discharge, the synaptic unit exhibits long-term potentiation (LTP), requiring a larger synaptic weight. Conversely, when postsynaptic discharge precedes presynaptic discharge, the synaptic unit exhibits long-term depression (LTD), requiring a smaller synaptic weight. In other words, to achieve LTP, the synaptic weight can be increased; to achieve LTD, the synaptic weight can be decreased. Adjusting the synaptic weight can be achieved by sending adjustment pulses to the synaptic unit.

[0052] In this embodiment, the first neuron serves as the preneuron and the second neuron as the postneuron. The first neuron can determine whether the required function of the synaptic unit is LTP or LTD based on the actual time difference between the first pulse emitted by the first neuron and the second pulse emitted by the second neuron. The emission time of the first pulse can be denoted as t. pre The second pulse is emitted at time t. post The actual time difference between the two pulses is Δt = t post -t pre Thus, determining the demand action of the synaptic unit as LTD when the actual transmission time difference is less than zero can reduce the synaptic weight of the synaptic unit, while determining the demand action of the synaptic unit as LTP when the actual transmission time difference is greater than zero can increase the synaptic weight of the synaptic unit.

[0053] refer to Figure 2 The figure shows a schematic diagram of a probabilistic STDP rule in an embodiment of this application. The horizontal axis is the actual time difference Δt between the two pulses, and the vertical axis is the change in synaptic weight (Δw). As can be seen from the figure, when the actual time difference Δt is less than zero, the change in synaptic weight is less than 0, and when the actual time difference Δt is greater than zero, the change in synaptic weight is greater than 0.

[0054] In probabilistic spiking neural network structures, the adjustment of synaptic weights within synaptic units is probabilistic. That is, given that the required action of a synaptic unit is LTP (Life-Touch Pulse), we can determine whether to increase the synaptic weights based on a certain probability, denoted as P, corresponding to the probability of LTP. LTP When the required function of a synaptic unit is determined to be LTD, it is possible to determine whether to reduce the synaptic weight in the synaptic unit based on a certain probability. This probability is the probability corresponding to LTD, denoted as P. LTD Among them, P LTP and P LTD The values ​​can be the same or different.

[0055] Based on this, in the embodiments of the present application, the pulse neural network structure includes a probability selection unit for generating a random number related to a preset probability. In this way, the first pulse unit can determine whether to send an adjustment pulse corresponding to the demand action of the synapse unit to the synapse unit according to the random number, and the synapse unit can adjust the synaptic weight according to the adjustment pulse after receiving the adjustment pulse. Specifically, the first pulse unit can send an adjustment pulse to the synapse unit according to the demand action of the synapse unit when the random number is a preset random number, and not send an adjustment pulse when the random number is not the preset random number. The probability of the occurrence of the preset random number is the preset probability.

[0056] Reference Figure 3 As shown in the circuit diagram of the probability selection unit provided by the embodiments of the present application, the probability selection unit includes a first resistive random access memory (RRAM), a reference resistor, and a comparator. The first end of the first RRAM is used to be applied with a first voltage. The second end of the first RRAM is connected with the first end of the reference resistor. The second end of the reference resistor is used to be applied with a second voltage. In this way, the first RRAM and the reference resistor are connected in series between the first voltage and the second voltage. Because the first RRAM has inherent random noise, the resistance value of the first RRAM fluctuates, so the voltage at the second end of the first RRAM fluctuates. In this way, the second end of the first RRAM is connected to the positive input end of the comparator. The negative input end of the comparator is used to be applied with a reference voltage. The comparison result output by the output end of the comparator can be used as a random number. The reference voltage is determined according to a preset probability, so the random number is related to the preset probability. The first voltage can be a read voltage V read , and the second voltage can be 0 V. The first RRAM can be represented as RRAM, and the reference resistor can be represented as R ref .

[0057] In the embodiments of the present application, the random number obtained by the probability selection unit can be 0 or 1. The probability of the occurrence of 0 or 1 is related to the preset probability. When the random number is 1, the first pulse unit can generate and send an adjustment pulse. When the random number is 0, the first pulse unit can not generate an adjustment pulse. Of course, the adjustment pulse will not be sent.

[0058] In the embodiments of the present application, the resistive random access memory (RRAM) is a new type of memory, which has the characteristics of high density, low power consumption, easy integration, low cost, and more physical random characteristics. The probability selection unit is designed based on the RRAM, which saves a large amount of resources compared with the method of using linear feedback shift register. The probability selection unit based on the RRAM does not depend on the device characteristics of the RRAM itself, so the stability is high, and there is no deviation between devices. Therefore, high device consistency can be achieved with limited resources, and large-scale integration is easy. In addition, the comparator is used to establish the correlation between the preset probability and the random number. The adjustment of the random number is simpler and more flexible than the logic gate method, and also has a simple encoding, which reduces the operation difficulty.

[0059] In addition, the probability selection unit further includes a first transistor, a first end of the first transistor is connected to a second end of the reference resistance, a second end of the first transistor is configured to be applied with a second voltage, and a control end of the first transistor is configured to be applied with a control signal. When the control signal controls the first transistor to be turned on, the first end and the second end of the first transistor have the same potential, so that the second end of the reference resistance connected to the first end of the first transistor also has the second voltage. The control signal can be an address (ADDR) signal.

[0060] In the embodiments of the present application, the clock signal can be input to the comparator, so that the comparison result is output according to a certain period.

[0061] Since the RRAM is used as a random source of a true random number generator, the voltage at the positive input end of the comparator is related to the resistance of the RRAM. The resistance of the RRAM fluctuates up and down on both sides of the reference resistance. Therefore, the voltage at the positive input end of the comparator also fluctuates up and down on both sides of the reference voltage, which is related to the reference resistance of the RRAM. The probability that the voltage at the positive input end of the comparator is greater than the reference voltage is basically equal to the probability that the voltage at the positive input end of the comparator is less than the reference voltage. Therefore, when the reference voltage is equal to the reference voltage, the probabilities of the comparator outputting 0 and 1 are equal. This random number generation method does not use the voltage variation characteristics of the device itself. The stability is high, the consistency between different devices is good, and the resources required are reduced. The input of the positive input end of the comparator and the input of the negative input end of the comparator can be 8-bit binary numbers. The input of the positive input end of the comparator is realized by the resistance fluctuation of the RRAM, and the input of the negative input end of the comparator can be determined by configuration.

[0062] In the embodiments of the present application, the probabilities of 0 and 1 output by the comparator can be adjusted by setting a suitable reference voltage input to the negative input terminal of the comparator. For example, if the probability of 1 output by the comparator is required to be 0.4, the negative input terminal of the comparator can be set to 01100110 (0.4*256≈102 in decimal), so that the comparator outputs a random number with a probability of 0.4. Based on the correspondence between the probability and the reference voltage, the preset probability can be adjusted simply, and the setting is more flexible without modifying the circuit structure.

[0063] In the embodiments of the present application, the synaptic unit can include a second resistive random access memory (RRAM), or the synaptic unit can include an interconnected second RRAM and a second transistor. The synaptic unit can be based on a binary second RRAM, and the synaptic weight stored can be 0 or 1. The adjustment pulse corresponding to the long-term potentiation is a set pulse, i.e., the synaptic weight is set to 1, and the adjustment pulse corresponding to the long-term depression is a reset pulse, i.e., the synaptic weight is reset to 0.

[0064] In the embodiments of the present application, the first neuron can send a first pulse to a second neuron connected to the synaptic unit through the connected synaptic unit, and the first pulse is generated according to an encoding pulse. The second neuron can have a leaky integrate-and-fire (LIF) neuron model for sending a second pulse to the first neuron when activated. The LIF neuron model is used for integral operation on the first pulse, and the second neuron is activated when the integral operation value reaches a preset value. The LIF neuron model can be implemented by a CMOS circuit or an RRAM memristor.

[0065] In the embodiments of the present application, the pulse neural network structure can further include a counter for calculating a reference clock quantity between the sending time of the first pulse and the sending time of the second pulse based on a reference clock signal. The actual time difference between the sending of the first pulse and the sending of the second pulse can be determined according to the period of the reference clock signal and the reference clock quantity. For example, the actual time difference between the sending of the first pulse and the sending of the second pulse can be the product of the period of the reference clock signal and the reference clock quantity. Of course, the pulse neural network structure can further include a register for latching the reference clock quantity, so that the reference clock quantity can be obtained from the register, and the actual time difference can be calculated conveniently. The register can be arranged in the second neuron.

[0066] Reference Figure 4As shown in the figure, it is a flow chart of an operation method of a pulse neural network in the embodiment of the present application. An encoding pulse is input into a first neuron, and a counter is reset, at which time the counting result is zero. The first neuron forms a first pulse according to the encoding pulse. The encoding pulse is input into the first neuron asynchronously in one step, so that the first pulse also has a certain periodicity. The first neuron sends the first pulse to a second neuron through a synaptic unit (RRAM). After the counter is reset, the counter is incremented by 1 every time a reference clock signal arrives. If the second neuron is activated, the second neuron sends a second pulse to the first neuron. At this time, the counting value of the counter is the number of reference clocks between the time when the first pulse is sent and the time when the second pulse is sent. At this time, the counting value of the counter can be stored in a register.

[0067] The first neuron determines the actual time difference between the first pulse and the second pulse according to the counting value in the register, and determines the role of the synaptic unit as a long-pulse enhancement role or a long-pulse inhibition role. When the role of the synaptic unit is the long-pulse enhancement role, a probability P corresponding to the long-pulse enhancement role is used to generate a set pulse for a random number. LTP When the role of the synaptic unit is the long-pulse inhibition role, a probability P corresponding to the long-pulse inhibition role is used to generate a reset pulse for a random number. LTD The foregoing steps are executed multiple times when multiple training of the synaptic unit is required. The foregoing steps are executed multiple times when multiple training of the synaptic unit is required.

[0068] In the embodiment of the present application, since the first pulse is a periodic pulse, the first pulse and the second pulse within a certain pulse period can be defined as comparison objects. For example, the first pulse and the second pulse within a first preset time period after the first pulse, and the first pulse and the second pulse within a second preset time period before the first pulse can be defined as a pulse period. When the second pulse is within the pulse period, the sending time of the second pulse is compared with the sending time of the first pulse. When the second pulse is outside the pulse period, the sending time of the second pulse is compared with the sending time of another first pulse after the first pulse. For example, the sending time of the second pulse within a time period of 4 reference clock quantities after the first pulse is compared with the sending time of the first pulse. The sending time of the second pulse within a time period of more than 4 reference clock quantities after the first pulse is compared with the sending time of another first pulse after the first pulse.

[0069] Reference Figure 5 As shown in the figure, it is a schematic diagram of an operation timing provided in the embodiment of the present application. The first pulse sent by the first neuron can also be referred to as a pre-neuron pulse, and the second pulse sent by the second neuron can also be referred to as a post-neuron pulse. As can be seen from the figure, the reference clock signal (clk) has a certain period. When the first neuron sends a first first pulse, the counter is reset, and the counting value is zero.

[0070] In an embodiment, the post-spike neuron pulse is emitted when the counter value is 3, which is recorded as post-spike neuron 1 pulse, and register 1 records the time difference between the pre-spike neuron pulse and the post-spike neuron pulse as 3 reference clock signals, at this time, the post-spike neuron pulse is considered to be emitted later than the first pre-spike neuron pulse, and the required action of the synaptic unit is LTP, so that the synaptic unit can be set, i.e., a set pulse can be sent to the synaptic unit. The synaptic unit is RRAM, and the set end of the RRAM can generate a pulse, which is used to set the RRAM, referred to as a set pulse.

[0071] In another embodiment, the post-spike neuron pulse is emitted when the counter value is 6, which is recorded as post-spike neuron 2 pulse, and register 2 can record the time difference between the pre-spike neuron pulse and the post-spike neuron pulse as 6 reference clock signals, at this time, the post-spike neuron pulse is considered to be emitted earlier than the second pre-spike neuron pulse, and the required action of the synaptic unit is LTD, so that the synaptic unit can be reset, i.e., a reset pulse can be sent to the synaptic unit. The synaptic unit is RRAM, and the reset end of the RRAM can generate a pulse, which is used to reset the RRAM, referred to as a reset pulse.

[0072] In the embodiment of the application, the probability selection unit can be one, and a random number is generated, and whether to emit an adjustment pulse is determined according to the random number, regardless of whether it is long-term potentiation or long-term depression, that is, the probabilities of long-term potentiation and long-term depression are the same.

[0073] In the embodiment of the application, the probability selection unit can be two, referred to as a first selection unit and a second selection unit, the first selection unit is used to generate a random number corresponding to long-term potentiation according to a preset probability P LTP , and the second selection unit is used to generate a random number corresponding to long-term depression according to a preset probability P LTD . In this way, when the random number is the preset random number, an adjustment pulse is sent to the synaptic unit according to the required action of the synaptic unit, which can be specifically: when the required action of the synaptic unit is long-term potentiation, if the random number corresponding to long-term potentiation is the preset random number, a long-term potentiation adjustment pulse is sent to the synaptic unit; when the required action of the synaptic unit is long-term depression, if the random number corresponding to long-term depression is the preset random number, a long-term depression adjustment pulse is sent to the synaptic unit. The preset probability P LTP corresponding to long-term potentiation and the preset probability P LTD corresponding to long-term depression can be the same or different according to actual conditions.

[0074] For example, the preset random number can be 1, and the first selection unit generates the first random number based on P LTP The second selection unit generates the second random number based on P LTD The second selection unit generates the second random number based on P LTP When the synaptic unit needs to be in LTP, if the first random number is determined to be 1, an LTP adjustment pulse is sent to the synaptic unit, and if the first random number is determined to be 0, no LTP adjustment pulse is sent to the synaptic unit; when the synaptic unit needs to be in LTD, if the second random number is determined to be 1, an LTD adjustment pulse is sent to the synaptic unit, and if the second random number is determined to be 0, no LTD adjustment pulse is sent to the synaptic unit.

[0075] Reference Figure 6 Fig. 1 is a schematic diagram of a simplified probabilistic STDP rule in an embodiment of the present application, and the simplified probabilistic STDP has a simpler hardware structure, in which Figure 6 In Fig. A, the horizontal coordinate is the actual time difference △t of two pulses (the difference between the sending time of the second pulse and the sending time of the first pulse), and the vertical coordinate is the change amount (△w) of the synaptic weight. As can be seen from the figure, when the actual time difference △t is greater than -100 and less than 0, or greater than 20 and less than 100 (an example of the LTD range), the change amount of the synaptic weight is -100%, and when the actual time difference △t is greater than 0 and less than 20 (an example of the LTP range), the change amount of the synaptic weight is 100%. Figure 6 In Fig. B, the horizontal coordinate is the actual time difference △t of two pulses, and the vertical coordinate is the conversion probability, that is, the probability of sending an adjustment pulse by the first neuron. As can be seen from the figure, when the actual time difference △t is less than 0 or greater than 20, the conversion probability of the synaptic weight is P LTD , that is, the RRAM has a P LTD probability of the reset process, and when the actual time difference △t is greater than 0 and less than 20, the conversion probability of the synaptic weight is P LTP , that is, the RRAM has a P LTP probability of the set process, P LTD and P LTP may be set according to actual conditions, and their sizes are between 0% and 100%.

[0076] In an embodiment of the present application, the probability selection unit can be divided into multiple and divided into a first unit group and a second unit group, and the multiple probability selection units in the first unit group are used to generate multiple random numbers corresponding to the long-term potentiation according to the preset probability P LTP The multiple probability selection units in the second unit group are used to generate multiple random numbers corresponding to the long-term depression according to the preset probability P LTDThe plurality of random numbers corresponding to long-term depression are generated. The long-term potentiation can correspond to a plurality of continuous first time difference ranges, and the plurality of random numbers corresponding to the long-term potentiation correspond to the plurality of first time difference ranges respectively; the long-term depression can correspond to a plurality of continuous second time difference ranges, and the plurality of random numbers corresponding to the long-term depression correspond to the plurality of second time difference ranges respectively. The preset probability P LTP corresponding to the long-term potentiation and the preset probability P LTD corresponding to the long-term depression can be the same or different according to actual conditions.

[0077] When the random number is the preset random number, the adjustment pulse is sent to the synaptic unit according to the demand action of the synaptic unit, which can be specifically: when the demand action of the synaptic unit is the long-term potentiation action, if the random number corresponding to the first time difference range to which the actual time difference belongs is the preset random number, the long-term potentiation adjustment pulse is sent to the synaptic unit; when the demand action of the synaptic unit is the long-term depression action, if the random number corresponding to the second time difference range to which the actual time difference belongs is the preset random number, the long-term depression adjustment pulse is sent to the synaptic unit.

[0078] For example, the first unit group can include 3 probability selection units, so that the long-term potentiation can correspond to 3 preset probabilities P LTP (are respectively denoted as P LTP1 , P LTP2 , P LTP3 ), and correspond to 3 random numbers, and the 3 random numbers correspond to 3 first time difference ranges respectively, and the 3 first time difference ranges are respectively denoted as: the fourth sub-range, the fifth sub-range, and the sixth sub-range; the second unit group can include 3 probability selection units, so that the long-term depression can correspond to 3 preset probabilities P LTD (are respectively denoted as P LTD1 , P LTD2 , P LTD3 ), and correspond to 3 random numbers, and the 3 random numbers correspond to 3 second time difference ranges respectively, and the 3 second time difference ranges are respectively denoted as: the first sub-range, the second sub-range, and the third sub-range. The random number generated by the probability selection unit in the first unit group is denoted as the first random number, the random number generated by the probability selection unit in the second unit group is denoted as the second random number, and the preset random number can be 1.

[0079] When the demand action of the synaptic unit is LTP, if the first random number corresponding to the first time difference range to which the actual transmission time difference belongs is determined to be 1, then an adjustment pulse of LTP is sent to the synaptic unit; if the first random number corresponding to the first time difference range to which the actual transmission time difference belongs is determined to be 0, then no adjustment pulse of LTP is sent to the synaptic unit. When the demand action of the synaptic unit is LTD, if the first random number corresponding to the second time difference range to which the actual transmission time difference belongs is determined to be 1, then an adjustment pulse of LTD is sent to the synaptic unit; if the first random number corresponding to the second time difference range to which the actual transmission time difference belongs is determined to be 0, then no adjustment pulse of LTD is sent to the synaptic unit.

[0080] refer to Figure 7 The diagram shown illustrates another simplified probability STDP rule in an embodiment of this application, which is different from the previous one. Figure 6 The probabilistic STDP rule in this model is more complex and closer to the ideal probabilistic STDP rule model, but it requires more hardware resources.

[0081] in, Figure 7 In Figure A, the horizontal axis represents the actual time difference Δt between the two pulses (the difference between the time of the second pulse and the time of the first pulse), and the vertical axis represents the change in synaptic weight (Δw). As can be seen from the figure, when the actual time difference Δt is greater than -100 and less than zero (another example of the LTD range), the change in synaptic weight is -100%, and when the actual time difference Δt is greater than zero and less than 100 (another example of the LTP range), the change in synaptic weight is 100%.

[0082] Figure 7 In graph B, the horizontal axis represents the actual time difference Δt between the two pulses, and the vertical axis represents the transition probability, which is the probability that the first neuron sends an adjustment pulse. As can be seen from the graph, when the actual time difference Δt is greater than -100 and less than -40 (an example of the first sub-range within the second time difference range), the transition probability of the synaptic weight is P. LTD3 That is, RRAM has P LTD3 The probability is the reset process; when the actual transmission time difference Δt is greater than -40 and less than -20 (an example of the second sub-range within the second time difference range), the transition probability of the synaptic weight is P. LTD2 That is, RRAM has P LTD2 The probability is the reset process; when the actual transmission time difference Δt is greater than -20 and less than 0 (an example of the third sub-range within the second time difference range), the transition probability of the synaptic weight is P. LTD1 That is, RRAM has P LTD1The probability is the reset process; when the actual transmission time difference Δt is greater than 0 and less than 20 (an example of the fourth sub-range in the first time difference range), the transition probability of the synaptic weight is P. LTP1 That is, RRAM has P LTP1 The probability is set in the process; when the actual transmission time difference Δt is greater than 20 and less than 40 (an example of the fifth sub-range in the first time difference range), the transition probability of the synaptic weight is P. LTP2 That is, RRAM has P LTP2 The probability is set in the process; when the actual transmission time difference Δt is greater than 40 and less than 100 (an example of the sixth sub-range in the first time difference range), the transition probability of the synaptic weight is P. LTP3 That is, RRAM has P LTP3 The probability is obtained through the set process.

[0083] In this embodiment, there can be multiple first neurons, multiple first synaptic units, and multiple second neurons. There is at least one synaptic unit between a first neuron and a second neuron. A first neuron can connect to multiple second neurons through multiple synaptic units, and a second neuron can also connect to multiple first neurons through multiple synaptic units. Specifically, each first neuron can be connected to a first connecting line extending in a first direction, and each second neuron can be connected to a second connecting line extending in a second direction. Synaptic units can be located at the intersection of the first and second connecting lines, and multiple synaptic units can be arranged in an array.

[0084] refer to Figure 8 The diagram illustrates another spiking neural network structure provided in this application embodiment. The first direction is vertical, the second direction is horizontal, and synaptic units are represented by W. A synaptic unit may include an RRAM, or an interconnected RRAM and a transistor. It includes m first neurons and n second neurons. The first neurons are located in the input layer as input neurons, and the second neurons are located in the output layer as LIF neurons. A probability generation unit is used to generate random numbers corresponding to LTP and LTD, also called an LTP and LTD probability generation unit. Each first neuron may correspond to one or more probability generation units. When at least one second neuron is activated, the post-neuron pulse emitted by that second neuron is sent to the first neuron.

[0085] The embodiment of the application provides a pulse neural network structure, comprising a first neuron, a synaptic unit and a second neuron connected in sequence, and a probability selection unit connected with the first neuron, the probability selection unit is used for generating a random number, the first neuron is used for determining a required action of the synaptic unit as a long-term potentiation action or a long-term depression action according to an actual time difference of a first pulse emitted by the first neuron and a second pulse emitted by the second neuron, and the synaptic unit is used for storing a synaptic weight and adjusting the synaptic weight according to an adjusting pulse when the random number is a preset random number.

[0086] The probability selection unit can comprise a first resistive random access memory, a reference resistor and a comparator, a first end of the first resistive random access memory is used for being applied with a first voltage, a second end of the first resistive random access memory is connected with a first end of the reference resistor, and a second end of the reference resistor is used for being applied with a second voltage, so that the voltage of the second end of the first resistive random access memory fluctuates due to the random noise of the first resistive random access memory itself, the second end of the first resistive random access memory is connected to a positive input end of the comparator, a reference voltage is applied to a negative input end of the comparator, and a comparison result output by an output end of the comparator can be used as the random number, and the reference voltage is determined according to the preset probability, so that the random number is related to the preset probability.

[0087] In the embodiment of the application, the probability selection unit is designed based on the resistive random access memory, a large amount of resources can be saved compared with the method of using a linear feedback shift register, the probability selection unit based on the resistive random access memory does not depend on the device characteristics of the resistive random access memory itself, so the stability is relatively high, and therefore the device consistency can be realized by using limited resources. In addition, the comparator is used to establish the association between the preset probability and the random number, the adjustment of the random number is simpler and more flexible compared with the logic gate method, and the encoding is also relatively simple, and the operation difficulty is reduced.

[0088] The above only describes the preferred embodiments of the application, although the application has disclosed the above preferred embodiments, however, the application is not limited thereto. Any person skilled in the art can make many possible changes and modifications to the technical solutions of the application or modify equivalent embodiments with equivalent changes without departing from the scope of the technical solutions of the application. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the application without departing from the technical solutions of the application, all still belong to the protection scope of the technical solutions of the application.

Claims

1. A pulse neural network structure, characterized by, The application relates to a neural network circuit. The neural network circuit comprises a first neuron, a synaptic unit and a second neuron connected in sequence, and a probability selection unit connected with the first neuron; The probability selection unit comprises a first resistive random access memory, a reference resistor and a comparator; a first end of the first resistive random access memory is used for being applied with a first voltage; a second end of the first resistive random access memory is connected with a first end of the reference resistor; a second end of the reference resistor is used for being applied with a second voltage; a positive input end of the comparator is connected with the second end of the first resistive random access memory; a negative input end of the comparator is used for being applied with a reference voltage; and a comparison result output by an output end of the comparator is used as a random number; and the reference voltage is determined according to a preset probability. The first neuron is used for determining a required action of the synaptic unit as a long-term potentiation action or a long-term depression action according to an actual time difference between a first pulse emitted by the first neuron and a second pulse emitted by the second neuron; and when the random number is a preset random number, an adjusting pulse is sent to the synaptic unit according to the required action of the synaptic unit. The synaptic unit is used for storing a synaptic weight and adjusting the synaptic weight according to the adjusting pulse. The probability selection units are multiple and divided into a first unit group and a second unit group; the multiple probability selection units in the first unit group are used for generating multiple random numbers corresponding to the long-term potentiation according to a preset probability corresponding to the long-term potentiation; and the multiple probability selection units in the second unit group are used for generating multiple random numbers corresponding to the long-term depression according to a preset probability corresponding to the long-term depression. The long-term potentiation corresponds to multiple continuous first time difference ranges; and the multiple random numbers corresponding to the long-term potentiation correspond to the multiple first time difference ranges respectively. The long-term depression corresponds to multiple continuous second time difference ranges; and the multiple random numbers corresponding to the long-term depression correspond to the multiple second time difference ranges respectively. When the random number is the preset random number, the adjusting pulse is sent to the synaptic unit according to the required action of the synaptic unit, which comprises the following steps: When the required action of the synaptic unit is the long-term potentiation action, if a random number corresponding to a first time difference range to which the actual time difference belongs is the preset random number, a long-term potentiation adjusting pulse is sent to the synaptic unit; When the required action of the synaptic unit is the long-term depression action, if a random number corresponding to a second time difference range to which the actual time difference belongs is the preset random number, a long-term depression adjusting pulse is sent to the synaptic unit.

2. The pulse neural network structure of claim 1, wherein, The probability selection unit further comprises a first transistor; a first end of the first transistor is connected with a second end of the reference resistor; a second end of the first transistor is used for being applied with the second voltage; and a control end of the first transistor is used for being applied with a control signal.

3. The pulse neural network structure of claim 1, wherein, The synaptic unit comprises a second resistive random access memory, or the synaptic unit comprises a second resistive random access memory and a second transistor connected in sequence.

4. The pulse neural network structure of claim 3, wherein, The long-term potentiation adjusting pulse is a set pulse, and the long-term depression adjusting pulse is a reset pulse.

5. The pulse neural network structure according to any one of claims 1-4, characterized in that, The probability selection unit comprises a first selection unit and a second selection unit, the first selection unit is used for generating a random number corresponding to the long-term potentiation according to a preset probability corresponding to the long-term potentiation, and the second selection unit is used for generating a random number corresponding to the long-term depression according to a preset probability corresponding to the long-term depression; when the random number is a preset random number, an adjustment pulse is sent to the synaptic unit according to the requirement of the synaptic unit, comprising: When the requirement of the synaptic unit is a long-term potentiation effect, if the random number corresponding to the long-term potentiation is a preset random number, a long-term potentiation adjustment pulse is sent to the synaptic unit; When the requirement of the synaptic unit is a long-term depression effect, if the random number corresponding to the long-term depression is a preset random number, a long-term depression adjustment pulse is sent to the synaptic unit.

6. The pulse neural network structure according to any one of claims 1-4, characterized in that, The first unit group comprises three probability selection units, and the second unit group comprises three probability selection units.

7. The pulse neural network structure according to any one of claims 1-4, characterized in that, The pulse neural network structure further comprises: A counter is used for calculating the number of reference clocks between the sending time of the first pulse and the sending time of the second pulse based on a reference clock signal; the actual sending time difference is determined according to the period of the reference clock signal and the number of reference clocks.

8. The pulse neural network structure according to any one of claims 1-4, characterized in that, The first neuron, the synaptic unit and the second neuron are multiple, and one synaptic unit is arranged between one first neuron and one second neuron.

9. The pulse neural network structure of claim 8, wherein, The second neuron has a leaky integrate-and-fire neuron model, and is used for sending a second pulse to a first neuron connected with the second neuron when activated.

Citation Information

Patent Citations

  • A hardware impulse neural network system

    CN108985447A

  • Probabilistic neuron circuit, and probabilistic neural network topological structure and application thereof

    CN110991610A