Neuron circuit and switching method of activation function of neuron circuit
By designing a neuron circuit structure that includes transistors and memristors, and using the adjustment of supply voltage and resistance value to switch activation functions, the problems of high power consumption and insufficient adaptability of traditional neuron circuits are solved, and low-cost and low-power activation function switching is achieved.
Patent Information
- Application Number
- CN202511049312.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-18
AI Technical Summary
Traditional neural circuits suffer from high power consumption and high chip area when executing activation functions, and neural solutions based on volatile memristors are difficult to adapt to dynamic tasks in different application scenarios.
A neuron circuit structure consisting of a first transistor, a second transistor, a threshold resistor, a third transistor, and a memristor is used. The activation function is switched by adjusting the supply voltage and the resistance value to achieve linear and nonlinear output.
It achieves activation function switching of neural circuits with low power consumption and low chip area, improving the adaptability to dynamic tasks in different application scenarios and reducing circuit cost and power consumption.
Smart Images

Figure CN120975150A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial neural networks, and in particular to a neuron circuit and a switching method of an activation function of the neuron circuit. BACKGROUND
[0002] With the evolution of data-driven computing paradigm, the energy efficiency bottleneck of traditional von Neumann architecture is increasingly prominent. Frequent data interaction between the processor and the off-chip memory leads to increased power consumption, especially the activation operation passed layer by layer in modern deep neural networks aggravates this bottleneck. Taking ResNet-152 as an example, it has 152 convolutional layers and needs to perform tens of millions of times of activation function operations, thereby greatly increasing the power consumption of the hardware circuit.
[0003] Then, the neuron circuit realized based on traditional hardware (such as resistance, capacitance, and inductance) needs tens of elements to work cooperatively and involves fine layout and multi-layer wiring, resulting in multi-level cascading of signal transmission between elements and thus high power consumption and high chip area occupation. The neuron scheme based on volatile memristor can only realize a single activation function, which is difficult to meet the adaptability of dynamic tasks in different application scenarios. SUMMARY
[0004] The present application provides a neuron circuit and a switching method of an activation function of the neuron circuit to realize switching of different activation functions on the basis of low power consumption and low chip area occupation.
[0005] According to a first aspect of the present application, a neuron circuit is provided, and the method comprises: a first transistor, a second transistor, and a threshold resistance; a first end of the first transistor is connected to an input current, control ends of the first transistor are respectively connected to a first end of the first transistor and a control end of the second transistor, and a second end of the first transistor and a second end of the second transistor are both connected to a ground end; a first end of the second transistor is connected to a second end of the threshold resistance; and a first end of the threshold resistance is connected to a first power supply voltage; a third transistor and a memristor; a first end of the memristor is connected to a second power supply voltage, a second end of the memristor is connected to a first end of the third transistor, and an output voltage is output from the second end of the memristor; a control end of the third transistor is connected to a first end of the second transistor, and a second end of the third transistor is connected to a ground end; If the second supply voltage is less than or equal to a first switching threshold, the output voltage linearly changes with the input current when the input current is greater than a first set threshold; if the second supply voltage is less than or equal to a second switching threshold, the output voltage nonlinearly changes with the input current when the input current is greater than a second set threshold, the first switching threshold being less than the second switching threshold.
[0006] Optionally, the first transistor, the second transistor and the third transistor are all NMOS tubes; the first end of the first transistor, the first end of the second transistor and the first end of the third transistor are all drain electrodes of the NMOS tubes; the second end of the first transistor, the second end of the second transistor and the second end of the third transistor are all source electrodes of the NMOS tubes; the control end of the first transistor, the control end of the second transistor and the control end of the third transistor are all gate electrodes of the NMOS tubes.
[0007] Optionally, the first transistor, the second transistor and the third transistor are all NPN type triodes; the first end of the first transistor, the first end of the second transistor and the first end of the third transistor are all collector electrodes of the NPN type triodes; the second end of the first transistor, the second end of the second transistor and the second end of the third transistor are all emitter electrodes of the NPN type triodes; the control end of the first transistor, the control end of the second transistor and the control end of the third transistor are all base electrodes of the NPN type triodes.
[0008] Optionally, the threshold resistance has a resistance value greater than zero and less than a ratio of the first supply voltage to the input current.
[0009] According to a second aspect of the present application, there is provided a switching method of an activation function of a neuron circuit, the neuron circuit being provided by the first aspect of the present application, the method comprising: When the second supply voltage is switched to be less than or equal to a first switching threshold, the output voltage output by the second end of the memristor is linear when the input current is greater than a first set threshold; When the second supply voltage is switched to be less than or equal to a second switching threshold, the output voltage output by the second end of the memristor is nonlinear when the input current is greater than a second set threshold.
[0010] Optionally, when the second supply voltage is less than or equal to a first switching threshold, the first set threshold is adjusted by adjusting the first supply voltage, the first set threshold increasing with an increase of the first supply voltage. When the second supply voltage is less than or equal to a second switching threshold, the initial value of the output voltage before the input current reaches a second set threshold is adjusted by adjusting the first supply voltage; the initial value of the output voltage decreases with the increase of the first supply voltage.
[0011] Optionally, when the second supply voltage is less than or equal to a first switching threshold, the size of the first set threshold is adjusted by adjusting the resistance of the threshold resistor; the first set threshold increases with the decrease of the resistance of the threshold resistor. When the second supply voltage is less than or equal to a second switching threshold, the initial value of the output voltage before the input current reaches a second set threshold is adjusted by adjusting the resistance of the threshold resistor; the initial value of the output voltage decreases with the decrease of the threshold resistor.
[0012] According to a third aspect of the present application, a neural network architecture is provided, comprising the neuron circuit provided in the first aspect of the present application.
[0013] According to a fourth aspect of the present application, an electronic device is provided, comprising the neural network architecture provided in the third aspect of the present application.
[0014] Compared with the prior art, the technical scheme of the present application has the following beneficial effects: The neuron circuit and the switching method of the activation function of the neuron circuit provided by the application have the following advantages: the first end of the first transistor is connected to an input current, the control end of the first transistor is connected to the first end of the first transistor and the control end of the second transistor respectively, and the second end of the first transistor and the second end of the second transistor are both connected to a ground end, so that the voltage of the first end of the second transistor changes with the input current. Since the voltage of the first end of the second transistor changes with the input current, the first end of the second transistor is connected to the second end of the threshold resistance, and the first end of the threshold resistance is connected to a first power supply voltage, the voltage of the first end of the second transistor decreases with the increase of the input current. On this basis, on the one hand, the first end of the memristor is connected to a second power supply voltage, the second end of the memristor is connected to the first end of the third transistor, and the second end of the memristor outputs an output voltage, and on the other hand, the control end of the third transistor is connected to the first end of the second transistor, and the second end of the third transistor is connected to the ground end, so that the equivalent impedance of the third transistor changes when the voltage of the first end of the second transistor changes, thereby changing the size of the output voltage. By changing the size of the second power supply voltage, the voltage division across the memristor can be changed to further change the resistance of the memristor, and therefore, when the second power supply voltage is less than or equal to a first switching threshold value, the output voltage can change linearly with the input current when the input current is greater than a first set threshold value, and when the second power supply voltage is less than or equal to a second switching threshold value, the output voltage can change nonlinearly with the input current when the input current is greater than a second set threshold value, thereby realizing the switching of different activation functions of the neuron circuit. In addition, since the neuron circuit is composed of three transistors, one resistance and one memristor, the neuron circuit has low circuit cost and low circuit power consumption. In summary, the application realizes the input of the current and the output of the voltage, and realizes the switching of different activation functions of the neuron circuit, and the cost and power consumption of the circuit are both low.
[0015] Further, when the resistance of the threshold resistance is less than the ratio of the first power supply voltage to the input current, adjusting the size of the first power supply voltage can change the size of the first set threshold value of the output voltage when the second power supply voltage is less than or equal to the first switching threshold value, and adjusting the size of the first power supply voltage can change the size of the initial value of the output voltage when the second power supply voltage is less than or equal to the second switching threshold value.
[0016] Further, in the case that the resistance of the threshold resistor is less than the ratio of the first supply voltage and the input current, adjusting the resistance of the threshold resistor can change the size of the first set threshold of the output voltage when the second supply voltage is less than or equal to a first switching threshold, and can change the size of the initial value of the output voltage when the second supply voltage is less than or equal to a second switching threshold. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort based on these drawings.
[0018] Figure 1 The circuit structure diagram of the neuron circuit provided for the present embodiment is shown in the following figure. Figure 2 The I-V curve of the output voltage output by the neuron circuit provided for the present embodiment is shown in the following figure. Figure 1 ; Figure 3 The I-V curve of the output voltage output by the neuron circuit provided for the present embodiment is shown in the following figure. Figure 2 ; Figure 4 The V-I curve diagram of the memristor provided for the present embodiment is shown in the following figure. DETAILED DESCRIPTION
[0019] As described in the background, the neuron circuit realized based on traditional hardware (such as resistors, capacitors, inductors, etc.) needs tens of elements to work together and involves fine layout and multi-layer wiring, resulting in multi-level cascading of signal transmission between elements and high power consumption and high chip area occupation. The neuron scheme based on volatile memristors can only realize a single activation function, which is difficult to meet the adaptability of dynamic tasks in different application scenarios.
[0020] Therefore, the technical scheme of the present application provides a new neuron circuit, which comprises a first transistor, a second transistor, a threshold resistor, a third transistor and a memristor. The first end of the first transistor is connected to an input current, the first transistor and the second transistor are in a current mirror structure, and the threshold resistor is connected between the first power supply voltage and the first end of the second transistor, so as to ensure that the voltage at the first end of the second transistor decreases with the increase of the input current.
[0021] The technical scheme in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0022] The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0023] The technical scheme of the present application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and some embodiments may not be described again for the same or similar concepts or processes.
[0024] Figure 1 The circuit structure schematic diagram of the neuron circuit provided in the embodiment is shown in the figure.
[0025] Please refer to Figure 1 In the embodiment, the neuron circuit comprises a first transistor N1, a second transistor N2, a threshold resistor M1, a third transistor N3 and a memristor M1.
[0026] The first end of the first transistor N1 is connected to an input current, the control end of the first transistor N1 is connected to the first end thereof and the control end of the second transistor N2 respectively, the second end of the first transistor N1 and the second end of the second transistor N2 are both connected to a ground end; the first end of the threshold resistance M1 is connected to the first end of the second transistor N2; the second end of the threshold resistance M1 is connected to a first power supply voltage Vdd.
[0027] The first end of the memristor M1 is connected to a second power supply voltage Vcc, the second end of the memristor M1 is connected to the first end of the third transistor N3, and the second end of the memristor M1 outputs an output voltage Vout; the control end of the third transistor N3 is connected to the first end of the second transistor N2, and the second end of the third transistor N3 is connected to the ground end.
[0028] If the second power supply voltage Vcc is less than or equal to a first switching threshold, the output voltage Vout changes linearly with the input current when the input current is greater than a first set threshold; if the second power supply voltage Vcc is less than or equal to a second switching threshold, the output voltage Vout changes nonlinearly with the input current when the input current is greater than a second set threshold, and the first switching threshold is less than the second switching threshold.
[0029] Of course, the first switching threshold and the second switching threshold of the second power supply voltage described above are determined by the transmission characteristic of the memristor, and when the transmission characteristic of the memristor is affected by temperature and / or environment and / or process, the second power supply voltage that switches the transmission characteristic of the output voltage Vout will also change accordingly, which is not limited here.
[0030] The following takes the first switching threshold of 0.5V and the second switching threshold of 1.5V as an example to illustrate the activation function switching of the neuron circuit of the embodiment.
[0031] It should be noted that the activation function of the neuron circuit is embodied by the transmission characteristic of the output voltage of the neuron circuit, so when the transmission characteristic of the output voltage changes, the activation function of the neuron circuit also changes.
[0032] Figure 2 And Figure 3 are the I-V curves of the output voltage output by the neuron circuit provided by the embodiment. Figure 1 And Figure 2 . Figure 4 is the V-I curve diagram of the memristor provided by the embodiment.
[0033] Please refer to Figure 2 And Figure 4In the embodiment, the first switching threshold is 0.5V. When the second supply voltage Vcc is less than or equal to 0.5V, according to the I-V characteristic of the memristor M1 itself, the resistance of the memristor M1 is limited to be greater than or equal to 250KΩ, so that the change of the resistance of the memristor M1 with voltage is approximately linear, and the output voltage Vout changes linearly with the input current when the input current is greater than a first set threshold, similar to the ReLU activation function. The size of the first set threshold is determined by the size of the first supply voltage Vdd. Specifically, the greater the first supply voltage Vdd, the greater the first set threshold; the smaller the first supply voltage Vdd, the smaller the first set threshold. Figure 2 For example, as shown in the I-V curve diagram, when the first supply voltage Vdd gradually increases from 2V to 3V, the critical point at which the output voltage Vout and the input current enter a linear relationship becomes larger. The critical point is equivalent to the first set threshold, that is, the first set threshold increases with the increase of the first supply voltage Vdd.
[0034] Of course, in addition to the first supply voltage Vdd, the size of the first set threshold is also related to the resistance of the threshold resistor M1. Specifically, the smaller the resistance of the threshold resistor M1, the greater the first set threshold; the greater the resistance of the threshold resistor M1, the smaller the first set threshold.
[0035] For example, as shown in the I-V curve diagram, when the first supply voltage Vdd gradually increases from 2V to 3V, the critical point at which the output voltage Vout and the input current enter a linear relationship becomes larger. The critical point is equivalent to the first set threshold, that is, the first set threshold increases with the increase of the first supply voltage Vdd. Figure 3 Figure 4 In the embodiment, the second switching threshold is 1.5V. When the first supply voltage Vdd is less than or equal to 1.5V, according to the I-V characteristic of the memristor M1 itself, the resistance of the memristor M1 is limited to be greater than or equal to 1.5KΩ, so that the change of the resistance of the memristor M1 with voltage is approximately nonlinear, and the output voltage Vout changes nonlinearly with the input current when the input current is greater than a second set threshold, similar to the Sigmoid activation function. The initial value of the output voltage Vout before the input current reaches the second set threshold is determined by the size of the first supply voltage Vdd. Specifically, the greater the first supply voltage Vdd, the smaller the initial value of the output voltage Vout; the smaller the first supply voltage Vdd, the greater the initial value of the output voltage Vout. Figure 3 For example, as shown in the I-V curve diagram, when the second supply voltage Vcc gradually increases from 2V to 3V, the initial value of the output voltage Vout decreases with the increase of the second supply voltage Vcc before the output voltage Vout changes nonlinearly with the input current.
[0036] Of course, the initial value of the output voltage Vout is related to the threshold resistance M1 in addition to the second power supply voltage Vcc. Specifically, the smaller the resistance of the threshold resistance M1, the smaller the initial value of the output voltage Vout; the larger the resistance of the threshold resistance M1, the larger the initial value of the output voltage Vout.
[0037] As described above, the neuron circuit provided by the embodiment changes the resistance of the memristor M1 by changing the size of the first power supply voltage Vdd, thereby changing the transmission characteristic of the output voltage Vout with the input current, i.e., changing the type of activation function represented by the neuron circuit. Therefore, by setting different first power supply voltages Vdd, the activation function represented by the neuron circuit can be switched, thereby greatly improving the adaptability of the neuron circuit of the embodiment to dynamic tasks in different application scenarios. At the same time, the neuron circuit of the embodiment is composed of only three transistors, one resistance and one memristor M1, so the circuit cost and circuit power consumption are very small.
[0038] In addition, when the second power supply voltage Vcc is fixed, the size of the first power supply voltage Vdd and the resistance of the threshold resistance M1 are adjusted according to the specific size of the second power supply voltage Vcc, thereby adjusting the first set threshold or adjusting the initial value of the output voltage Vout.
[0039] In the embodiment, the first transistor N1, the second transistor N2 and the third transistor N3 are all NMOS tubes. Specifically, the first end of the first transistor N1, the first end of the second transistor N2 and the first end of the third transistor N3 are all drain electrodes of NMOS tubes; the second end of the first transistor N1, the second end of the second transistor N2 and the second end of the third transistor N3 are all source electrodes of NMOS tubes; and the control end of the first transistor N1, the control end of the second transistor N2 and the control end of the third transistor N3 are all gate electrodes of NMOS tubes.
[0040] Of course, in other embodiments, the first transistor N1, the second transistor N2 and the third transistor N3 can also be NPN type triodes, which are not limited herein. Specifically, the first end of the first transistor N1, the first end of the second transistor N2 and the first end of the third transistor N3 are all the collectors of the NPN type triodes; the second end of the first transistor N1, the second end of the second transistor N2 and the second end of the third transistor N3 are all the emitters of the NPN type triodes; and the control end of the first transistor N1, the control end of the second transistor N2 and the control end of the third transistor N3 are all the bases of the NPN type triodes.
[0041] Taking the first transistor N1, the second transistor N2 and the third transistor N3 as NMOS tubes as an example, the working principle of the neuron circuit provided in the embodiment is described.
[0042] When the drain of the first transistor N1 is not connected to the input current, the first transistor N1 and the second transistor N2 are both turned off. At this time, the drain voltage V1 of the second transistor N2 is pulled up to the first power supply voltage Vdd by the threshold resistance M1. Since the drain voltage V1 of the second transistor N2 acts on the gate of the third transistor N3, the third transistor N3 is turned on, and the drain voltage of the third transistor N3, i.e. the output voltage Vout, is pulled down to the ground end and equal to zero.
[0043] When the drain of the first transistor N1 is connected to the input current, the input current charges the gate of the first transistor N1 and the gate of the second transistor N2 to turn on the first transistor N1 and the second transistor N2. The on-resistance of the second transistor N2 will continuously decrease, so that the drain voltage V1 of the second transistor N2 is continuously pulled down, i.e. the drain voltage V1 of the second transistor N2 will decrease with the increase of the input current. Therefore, the degree of conduction of the third transistor N3 will decrease with the decrease of the drain voltage V1 of the second transistor N2, so that the third transistor N3 begins to turn off until the third transistor N3 is completely turned off. During the process from the initial turn-off to the complete turn-off of the third transistor N3, the equivalent impedance of the memristor M1 and the third transistor N3 divides the second power supply voltage Vcc to make the drain of the third transistor N3 output the output voltage Vout. The output voltage Vout is related to the transmission characteristics of the input current and the size of the second power supply voltage Vcc, which will not be described herein.
[0044] In summary, the neuron circuit provided in the embodiment ensures that, when the input current increases, the voltage at the first end of the second transistor decreases, and when the input current decreases, the voltage at the first end of the second transistor increases, by the first transistor, the second transistor and the threshold resistor. The transmission characteristic of the output voltage changing with the input current is changed by changing the second supply voltage, that is, the switching of different activation functions of the neuron circuit is realized, by the memristor and the third transistor. Meanwhile, the neuron circuit composed of three transistors, one resistor and one memristor has low circuit cost and low circuit power consumption.
[0045] Further, in the case where the resistance of the threshold resistor is less than the ratio of the first supply voltage to the input current, when the second supply voltage is less than or equal to a first switching threshold, adjusting the size of the first supply voltage can change the size of the first set threshold of the output voltage, and when the second supply voltage is less than or equal to a second switching threshold, adjusting the size of the first supply voltage can change the size of the initial value of the output voltage.
[0046] Further, in the case where the resistance of the threshold resistor is less than the ratio of the first supply voltage to the input current, when the second supply voltage is less than or equal to a first switching threshold, adjusting the size of the threshold resistor can change the size of the first set threshold of the output voltage, and when the second supply voltage is less than or equal to a second switching threshold, adjusting the size of the threshold resistor can change the size of the initial value of the output voltage.
[0047] Correspondingly, the embodiment further provides a switching method of an activation function of a neuron circuit, based on the neuron circuit provided in the embodiment. The method comprises the following steps: When the second supply voltage is switched to be less than or equal to a first switching threshold, the output voltage output by the second end of the memristor is linear when the input current is greater than a first set threshold.
[0048] When the second supply voltage is switched to be less than or equal to a second switching threshold, the output voltage output by the second end of the memristor is nonlinear when the input current is greater than a second set threshold.
[0049] In addition to the transmission characteristic of the output voltage, in the embodiment, the first set threshold and the initial value of the output voltage before the input current reaches the second set threshold can be adjusted, and the adjustment specifically comprises the following: When the second supply voltage is less than or equal to a first switching threshold, the size of the first set threshold is adjusted by adjusting the first supply voltage. The greater the first supply voltage, the greater the first set threshold.
[0050] When the second supply voltage is less than or equal to a second switching threshold, the initial value of the output voltage before the input current reaches the second set threshold is adjusted by adjusting the first supply voltage; the greater the first supply voltage, the smaller the initial value of the output voltage.
[0051] Of course, in addition to adjusting the first supply voltage, the first set threshold and the initial value of the output voltage before the input current reaches the second set threshold can also be adjusted by adjusting the resistance value of the threshold resistor.
[0052] When the second supply voltage is less than or equal to a first switching threshold, the size of the first set threshold is adjusted by adjusting the resistance value of the threshold resistor; the smaller the resistance value of the threshold resistor, the greater the first set threshold.
[0053] When the second supply voltage is less than or equal to a second switching threshold, the initial value of the output voltage before the input current reaches the second set threshold is adjusted by adjusting the resistance value of the threshold resistor; the smaller the resistance value of the threshold resistor, the smaller the initial value of the output voltage.
[0054] Therefore, the size of the first set threshold and the initial value of the output voltage can be adjusted by the first supply voltage or the threshold resistor alone, or by the first supply voltage and the threshold resistor together, which is not limited here.
[0055] Correspondingly, the embodiment of the present application also provides a neural network architecture, comprising the neuron circuit.
[0056] Correspondingly, the embodiment of the present application also provides an electronic device, comprising the neural network architecture.
[0057] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A neuron circuit, characterized in that, include: A first transistor, a second transistor, and a threshold resistor; the first terminal of the first transistor is connected to the input current, the control terminal of the first transistor is connected to its own first terminal and the control terminal of the second transistor, and the second terminals of the first transistor and the second transistor are both connected to ground; the first terminal of the second transistor is connected to the second terminal of the threshold resistor; the first terminal of the threshold resistor is connected to a first supply voltage. A third transistor and a memristor; the first terminal of the memristor is connected to a second supply voltage, the second terminal of the memristor is connected to the first terminal of the third transistor, and the second terminal of the memristor outputs an output voltage; the control terminal of the third transistor is connected to the first terminal of the second transistor, and the second terminal of the third transistor is connected to ground. If the second supply voltage is less than or equal to the first switching threshold, the output voltage changes linearly with the input current when the input current is greater than the first set threshold. If the second supply voltage is less than or equal to the second switching threshold, the output voltage changes non-linearly with the input current when the input current is greater than the second set threshold, and the first switching threshold is less than the second switching threshold.
2. The neuron circuit according to claim 1, characterized in that, The first transistor, the second transistor, and the third transistor are all NMOS transistors; the first terminal of the first transistor, the first terminal of the second transistor, and the first terminal of the third transistor are all drains of the NMOS transistors; the second terminal of the first transistor, the second terminal of the second transistor, and the second terminal of the third transistor are all sources of the NMOS transistors; the control terminal of the first transistor, the control terminal of the second transistor, and the control terminal of the third transistor are all gates of the NMOS transistors.
3. The neuron circuit according to claim 1, characterized in that, The first transistor, the second transistor, and the third transistor are all NPN transistors; the first terminal of the first transistor, the first terminal of the second transistor, and the first terminal of the third transistor are all collectors of the NPN transistors; the second terminal of the first transistor, the second terminal of the second transistor, and the second terminal of the third transistor are all emitters of the NPN transistors; the control terminal of the first transistor, the control terminal of the second transistor, and the control terminal of the third transistor are all bases of the NPN transistors.
4. The neuron circuit according to claim 1, characterized in that, The threshold resistor has a resistance value greater than zero and is less than the ratio of the first supply voltage to the input current.
5. A method for switching the activation function of a neuron circuit, characterized in that, Based on the neuron circuit according to any one of claims 1 to 4, the method comprises: When the second power supply voltage is switched to be less than or equal to the first switching threshold, the output voltage output from the second terminal of the memristor is linear when the input current is greater than the first set threshold. When the second supply voltage is switched to be less than or equal to the second switching threshold, the output voltage output from the second terminal of the memristor is nonlinear when the input current is greater than the second set threshold.
6. The method for switching activation functions of a neuron circuit according to claim 5, characterized in that, When the second power supply voltage is less than or equal to the first switching threshold, the size of the first set threshold is adjusted by adjusting the first power supply voltage. The first set threshold increases as the first power supply voltage increases. When the second supply voltage is less than or equal to the second switching threshold, the initial value of the output voltage before the input current reaches the second set threshold is adjusted by adjusting the first supply voltage; the initial value of the output voltage decreases as the first supply voltage increases.
7. The method for switching activation functions of a neuron circuit according to claim 5, characterized in that, When the second supply voltage is less than or equal to the first switching threshold, the value of the first set threshold is adjusted by adjusting the resistance of the threshold resistor; the first set threshold increases as the resistance of the threshold resistor decreases. When the second supply voltage is less than or equal to the second switching threshold, the initial value of the output voltage before the input current reaches the second set threshold is adjusted by adjusting the resistance value of the threshold resistor; the initial value of the output voltage decreases as the threshold resistor decreases.
8. A neural network architecture, characterized in that, Includes the neuron circuit described in any one of claims 1 to 4.
9. An electronic device, characterized in that, Including the neural network architecture described in claim 8.