Device and method for operating the same
11494619 · 2022-11-08
Assignee
- Taiwan Semiconductor Manufacturing Co., Ltd. (Hsinchu, TW)
- National Yang Ming Chiao Tung University (Hsinchu, TW)
Inventors
Cpc classification
G06N3/061
PHYSICS
G06F18/24317
PHYSICS
G06V30/414
PHYSICS
International classification
G06N3/06
PHYSICS
Abstract
A device includes first wires, second wires, resistors, and a processor. Input signals are transmitted from the first wires through the resistors to the second wires. The processor receives a sum value of the input signals from one of the second wires, and shifts the sum value by a nonlinear activation function to generate a shifted sum value. The processor calculates a backpropagation value based on the shifted sum value and a target value, and generates a pulse number based on a corresponding input signal of the input signal and the backpropagation value. Each of a value of the corresponding input signal and the backpropagation value is higher than or equal to a threshold value. The processor applies a voltage pulse to one of the resistors related to the corresponding input signal based on the pulse number.
Claims
1. A method, comprising: receiving a plurality of input signals by a plurality of first wires; receiving a sum value corresponding to the plurality of input signals transmitted through a plurality of resistors from one of a plurality of second wires, and shifting the sum value by a nonlinear activation function to generate a shifted sum value; calculating a feedback based on the shifted sum value and a target value related to a corresponding input signal of the plurality of input signals, and generating a pulse number based on the corresponding input signal of the plurality of input signals and the feedbacks, wherein each of a value of the plurality of input signals and the feedbacks is higher than or equal to a threshold value; applying a voltage pulse to one of the plurality of resistors related to the corresponding input signal based on the pulse number; and modifying a value of the corresponding input signal of the plurality of input signals to be the same as the target value.
2. The method of claim 1, wherein shifting the sum value by the nonlinear activation function to generate the shifted sum value comprises: respectively shifting sum values from the plurality of second wires located in columns of an array by the nonlinear activation function to generate shifted sum values.
3. The method of claim 2, wherein calculating the feedback based on the shifted sum values and the target value comprises: calculating feedback values based on the shifted sum values and a plurality of target values, wherein each of the target values corresponds to one of the plurality of input signals.
4. The method of claim 3, further comprising: comparing each of values of the plurality of input signals with the threshold value, and comparing each of the feedbacks with the threshold value; and generating pulse numbers based on the plurality of input signals and the feedbacks if each of the input signals and the feedbacks is higher than or equal to the threshold value simultaneously.
5. The method of claim 4, wherein the feedbacks comprise backpropagation values.
6. The method of claim 5, wherein applying the voltage pulse to one of the plurality of resistors related to the corresponding input signal based on the pulse number comprises: correspondingly applying voltage pulses to the plurality of resistors, through one of the plurality of first wires and one of the plurality of second wires, based on the pulse numbers, so as to change resistances of the plurality of resistors.
7. The method of claim 1, wherein the nonlinear activation function comprises at least one of a sigmoid function and a rectified linear unit (ReLU) function.
8. A method, comprising: transmitting a plurality of input signals from a plurality of first wires through a plurality of resistors to a plurality of second wires; receiving a sum value of the input signals from one of the plurality of second wires; shifting the sum value by a nonlinear activation function to generate a shifted sum value; calculating a backpropagation value based on the shifted sum value and a target value related to a corresponding input signal of the plurality of input signals; generating a pulse number based on the corresponding input signal of the plurality of input signals and the backpropagation value; and applying a voltage pulse to one of the plurality of resistors related to the corresponding input signal based on the pulse number, in order to modify a value of the corresponding input signal in the plurality of input signals to be the same as the target value, wherein each of the value of the corresponding input signal and the backpropagation value is higher than or equal to a threshold value, the plurality of second wires are arranged across the plurality of first wires, and each of the plurality of resistors is coupled to one of the plurality of first wires and one of the plurality of second wires.
9. The method of claim 8, wherein the plurality of first wires and the plurality of second wires are arranged to form an array, wherein each of the plurality of resistors located at the same column of the array has a first terminal and a second terminal, the first terminals of the plurality of resistors are coupled to different wires of the plurality of first wires, and the second terminals of the plurality of resistor are coupled to the same wire of the plurality of second wires.
10. The method of claim 9, further comprising: respectively shifting sum values from the plurality of second wires located in columns of the array by the nonlinear activation function to generate shifted sum values.
11. The method of claim 10, further comprising: calculating backpropagation values based on the shifted sum values and a plurality of target values, wherein each of the plurality of target values corresponds to one of the plurality of input signals.
12. The method of claim 11, further comprising: comparing each of values of the plurality of input signals with the threshold value; comparing each of the backpropagation values with the threshold value; and generating pulse numbers based on the plurality of input signals and the backpropagation values if each of the plurality of input signals and the backpropagation values is higher than or equal to the threshold value.
13. The method of claim 12, further comprising: correspondingly applying voltage pulses to the plurality of resistors, through one of the plurality of first wires and one of the plurality of second wires, based on the pulse numbers, so as to change resistance of the plurality of resistors.
14. The method of claim 8, wherein the nonlinear activation function comprises at least one of a sigmoid function and a rectified linear unit (ReLU) function.
15. A method, comprising: obtaining first input signals transmitted through a plurality of first resistors of a first net to calculate first sum values; providing second signals related to a first sum values to a second net; obtaining second input signals transmitted through a plurality of second resistors to calculate second sum values; shifting the first sum values and the second sum values by a nonlinear activation function to generate first shifted sum values and second shifted sum values; calculating first feedbacks of the first net and second feedbacks of the second net based on the second shifted sum values and a plurality of target values related to a corresponding input signal of the first input signals; generating a plurality of first pulse numbers based on the first input signals and the first feedbacks; generating a plurality of second pulse numbers based on the second input signals and the second feedbacks; applying a first voltage pulse to one of the plurality of first resistors based on the plurality of first pulse numbers; and applying a second voltage pulse to one of the plurality of second resistors based on the plurality of second pulse numbers, in order to modify a value of the corresponding input signal of the first input signals to be the same as a corresponding target value of the plurality of target values, wherein each of the plurality of first resistors is disposed at one of areas formed between a plurality of first wires, and coupled to two of the plurality of first wires being across each other, and each of the plurality of second resistors is disposed at one of areas formed between a plurality of second wires, and coupled to two of the plurality of second wires being across each other.
16. The method of claim 15, further comprising: comparing each of values of the first input signals with a threshold value; comparing each of values of the first feedbacks with the threshold value; and generating the first pulse numbers based on the first input signals and the first feedbacks if each of values of the first input signals and the first feedbacks is higher than or equal to the threshold value.
17. The method of claim 16, further comprising: comparing each of values of the second input signals with the threshold value; comparing each of values of the second feedbacks with the threshold value; and generating the second pulse numbers based on the second input signals and the second feedbacks if each of values of the second input signals and the second feedbacks is higher than or equal to the threshold value.
18. The method of claim 17, further comprising: shifting the first sum values by the nonlinear activation function to generate the first shifted sum values; and shifting the second sum values by the nonlinear activation function to generate the second shifted sum values.
19. The method of claim 18, further comprising: calculating second backpropagation values based on the second shifted sum values and the target values; and calculating first backpropagation values based on the first shifted sum values and the second backpropagation values, wherein the first feedbacks comprise the first backpropagation values, and the second feedbacks comprise the second backpropagation values.
20. The method of claim 19, wherein the nonlinear activation function comprises at least one of a sigmoid function and a rectified linear unit (ReLU) function.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) Aspects of the present disclosure are best understood from the following detailed description when read with the accompanying figures. It is noted that, in accordance with the standard practice in the industry, various features are not drawn to scale. In fact, the dimensions of the various features may be arbitrarily increased or reduced for clarity of discussion.
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
DETAILED DESCRIPTION
(13) The following disclosure provides many different embodiments, or examples, for implementing different features of the provided subject matter. Specific examples of components and arrangements are described below to simplify the present disclosure. These are, of course, merely examples and are not intended to be limiting. For example, the formation of a first feature over or on a second feature in the description that follows may include embodiments in which the first and second features are formed in direct contact, and may also include embodiments in which additional features may be formed between the first and second features, such that the first and second features may not be in direct contact. In addition, the present disclosure may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed.
(14) Further, spatially relative terms, such as “beneath,” “below,” “lower,” “above,” “upper” and the like, may be used herein for ease of description to describe one element or feature's relationship to another element(s) or feature(s) as illustrated in the figures. The spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientation depicted in the figures. The apparatus may be otherwise oriented (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein may likewise be interpreted accordingly.
(15) Reference is now made to
(16) As illustratively shown in
(17) In some embodiments, the input neuron layer 110 and the hidden neuron layer 120 are two adjacent neuron layers, and input data are inputted from the input neuron layer 110 to the hidden neuron layer 120. The input data includes, for example, a symbol such as “8” or other handwritten numbers/characters, and the symbol is transformed into a binary number or other suitable digital type. Subsequently, the binary number is inputted into the neurons X.sub.1-X.sub.I of the input neuron layer 110. The input neuron layer 110 and the hidden neuron layer 120 are fully connected with each other, and two connected neurons in the input neuron layer 110 and the hidden neuron layer 120 have a weight W.sub.i,j. For instance, the neuron X.sub.1 in the input neuron layer 110 and the neuron H.sub.1 the hidden neuron layer 120 are connected to each other, and there is a weight W.sub.1,1 between the neuron X.sub.1 and the neuron H.sub.1. Each of the neurons H.sub.1-H.sub.J in the hidden neuron layer 120 receives products of every input data and the weight W.sub.i,j and the product is referred to as a weight sum in some embodiments.
(18) In various embodiments, the hidden neuron layer 120 and the output neuron layer 130 are two adjacent neuron layers, and the input data are inputted from the hidden neuron layer 120 to the output neuron layer 130. The hidden neuron layer 120 and the output neuron layer 130 are fully connected with each other, and two connected neurons in the hidden neuron layer 120 and the output neuron layer 130 have a weight W.sub.j,k. For instance, the neuron H.sub.2 in the hidden neuron layer 120 and the neuron O.sub.2 in the output neuron layer 130 are connected to each other, and there is a weight W.sub.2,2 between the neuron H.sub.2 and the neuron O.sub.2. The weight sum from each of the neurons H.sub.1-H.sub.J of the hidden neuron layer 120 is regarded as an input of the output neuron layer 130. Each of the neurons O.sub.1-O.sub.K in the output neuron layer 130 receives products of every weight sum and the weight W.sub.j,k.
(19) As illustratively shown in
(20) Reference is now made to
(21) In some embodiments, the perceptron network 100 in
(22) In some embodiments, the hardware neural network device in
(23) As illustratively shown in
(24) As illustratively shown in
(25) In various embodiments, the wires W1 and the wires W2 are arranged to cross each other for forming an array. Each of the resistors located at the same column of the array has a first terminal and a second terminal. For illustration, the resistors G.sub.11, G.sub.21, . . . , G.sub.I1 are located at the same column of the array, and each of the resistors G.sub.11, G.sub.21, . . . , G.sub.I1 has a upper terminal and a lower terminal. As illustratively shown in
(26) As illustratively shown in
(27) In some embodiments, the weight values are both positive and negative numbers in the perceptron network 100 of
(28) In some embodiments, the hardware neural network device in
(29) Reference is now made to
(30) As illustratively shown in
(31) In some embodiments, the input signals X.sub.1-X.sub.I are voltage signals, and the processor 210 provides the voltage signals X.sub.1-X.sub.I to input terminals of the wires W1. As illustratively shown in
(32) As discussed above, weight W.sub.i,j is generated based on the input data transmitted through the resistors G.sub.11-G.sub.IJ as illustratively shown in
(33) Correspondingly, the bias signal BS is a voltage signal in some embodiments, and the processor 210 provides the voltage signal BS to the input terminal of the wire L1. For illustration in
(34) In addition, the processor 210 provides the voltage signals X.sub.1-X.sub.I to the input terminals of the wires W1. For illustration in
(35) As illustratively shown in
(36)
(37) As shown in formula (1) and (2), f.sub.a is a nonlinear activation function, and X.sub.1 is the value of the input signal. S.sub.j.sup.H is the weighted sum before activation. b.sub.j is the bias value. W.sub.ij is the weight value. G.sub.ij is a conductance value of one of the resistors G.sub.11-G.sub.IJ in the hardware neural network device in
(38) Reference is now made to
(39) As illustratively shown in
(40) In some embodiments, the hardware neural network device in
(41) As illustratively shown in
(42) In various embodiments, the direction of each of the wires W3 is perpendicular to the direction of each of the wires W4. In various embodiments, the wires W3 are parallel to each other, and the wires W4 are parallel to each other. In some embodiments, each of the resistors M.sub.11-M.sub.JK is correspondingly coupled to one of the wires W3 and one of the wires W4. For illustration, one terminal of the resistor M.sub.11 is coupled to the upmost wire W3 in the corresponding array, and the other terminal of the resistor G.sub.11 is coupled to the leftmost wire W4 in the corresponding array, as shown in
(43) As illustratively shown in
(44) In some embodiments, the processor 220 is configured to provide weight sums through the wires W3. For illustration, the processor 220 provides weight sums H.sub.1-H.sub.J through the wires W3 to the additional array as shown in
(45) Reference is now made to both FIG.1 and
(46)
(47) As shown in formula (3) and (4), f.sub.a is a nonlinear activation function, and H.sub.j is the value of the input signal. S.sub.k.sup.0 is the weighted sum before activation. b.sub.k is the bias value. W.sub.jk is the weight value. M.sub.jk is a conductance value of the resistors in a hardware neural network device. The parameter G.sub.r in formula (4) will be described in the following discussions.
(48) As shown in formula (2) and (4), G.sub.r is a reference value given by:
G.sub.r=(G.sub.max−G.sub.min)/2 (5)
(49) As shown in formula (5), the conductance values of the resistors G.sub.11-G.sub.IJ in the hardware neural network device of
(50) As illustratively shown in
(51)
(52) As shown in formula (6) and (7), s is a parallel shifted value of the functions. Reference is now made to
(53)
(54) As illustratively shown in
(55)
(56) As shown in formula (8) and (9), O.sub.k.sup.BP is the backpropagation value of the output. T.sub.k is the target value of each output neuron as discussed above in
(57) In some embodiments, in operation 340, the processor 230 calculates a backpropagation value O.sub.k.sup.BP based on the difference between the target value T.sub.k and the output value O.sub.k as well as the weighted sum being calculated using derivative of activation, i.e., f′.sub.a(S.sub.k.sup.O). Substantially, the processor 220 calculates a backpropagation value H.sub.j.sup.BP based on the sum of the backpropagation value O.sub.k.sup.BP and the weight value W.sub.jk as well as the weighted sum being calculated using derivative of activation, i.e., f′.sub.a(S.sub.j.sup.H).
(58) In addition, the pulse numbers applied on the resistors G.sub.11-G.sub.IJ, G.sub.11-G.sub.JK are given by:
Δn.sub.ij=round(X.sub.i×ηH.sub.j.sup.BP) (10)
Δn.sub.jk=round(H.sub.j×ηO.sub.k.sup.BP) (11)
(59) As shown in formula (10) and (11), η is a learning rate that is a scaling factor to regulate training. Rounding is performed considering only an integer of the effective pulse number. Positive and negative Δn induce potentiation and depression of the device conductance, respectively.
(60) As illustratively shown in
(61)
(62) As shown above in formula (12) and (13), n.sub.P.sup.old is a cumulative number of potentiation pulse corresponding to the potentiation of the device conductance as discussed above, which is applied to the corresponding resistor, before the weight is updated. n.sub.D.sup.old is a cumulative number of depression pulse corresponding to the depression of the device conductance as discussed above, which is applied to the corresponding resistor, before the weight is updated.
(63) As illustratively shown in
(64) Reference is now made to
(65) Reference is now made to
(66) As illustratively shown in
(67) Reference is now made to
(68) According to the experiment results, if the input signal and the feedback are higher than a threshold value, the accuracy is improved. The threshold value is set to be compared with the input signal and the feedback, and the input signal and the feedback will be adopted if they are higher than the threshold value. As illustratively shown in
(69) Reference is now made to
(70) Correspondingly, according to the experiment results, if the input signal and the feedback are higher than a threshold value, the accuracy is improved. The threshold value is set to be compared with the input signal and the feedback, and the input signal and the feedback will be adopted if they are higher than the threshold value. As illustratively shown in
(71)
(72) In some embodiments, a truth table implemented by the calculating circuit 900 is shown below. For convenience of illustration, values of the input data X1, X0 shown in the below truth table are referred to as (X1, X0), the threshold values th1, th2 shown in the below truth table are referred to as (th1, th2), and values of the output data F(x1), F(x2) shown in the below truth table are referred to as (F(x1), F(x2)).
(73) TABLE-US-00001 x1 x0 th1 th2 F(x1) F(x2) 1 0 0 0 0 0 0 2 0 1 0 0 0 1 3 1 0 0 0 1 0 4 1 1 0 0 1 1 5 0 0 0 1 0 0 6 0 1 0 1 0 1 7 1 0 0 1 1 0 8 1 1 0 1 1 1 9 0 0 1 0 0 0 10 0 1 1 0 0 0 11 1 0 1 0 1 0 12 1 1 1 0 1 1 13 0 0 1 1 0 0 14 0 1 1 1 0 0 15 1 0 1 1 0 0 16 1 1 1 1 1 1
(74) For example, as illustrated in the above mentioned truth table, the input data X1, X0 in item 3 are (1, 0), and the threshold values th1, th2 set in item 3 are (0, 0). Because the bit value of the input data (1, 0) is larger than the bit value of the threshold values (0,0) in item 3, the output data F(x1), F(x2) in item 3 are also (1, 0). For another example, referring to item 10, the input data X1, X0 are (0, 1), and the threshold values set in item 10 are (1, 0). Because the bit value of the input data X1, X0 (0,1) is smaller than the bit value of the threshold values (1, 0) in item 10, the input data X1, X0 (0, 1) is blocked by the calculating circuit 900, such that the output data F(x1), F(x2) in item 10 are (0, 0). Alternatively stated, the input data X1, X0 (0, 1) having values that are smaller than the threshold values th1, th2 are filtered out by the calculating circuit 900 in some embodiments, in order to generate corresponding output data F(x1), F(x2). Other output data F(x1), F(x2) in the above truth table are calculated in the same manner. The rest of output data F(x1), F(x2) may be deduced by analogy, and thus detailed descriptions regarding the calculations are omitted herein.
(75) In some embodiments, the formula implemented in the calculating circuit 900 is given by:
F(x1)=x1x0+x1 bar(th1)+x1 bar(th2) (14)
F(x2)=x1x0+x0 bar(th1) (15)
(76)
(77) In some embodiments, a truth table implemented by the calculating circuit 900 is shown below. For convenience of illustration, values of the input data X1, X0 shown in the below truth table are referred to as (X1, X0), the shifted values s1, s2 shown in the below truth table are referred to as (s1, s2), and values of the output data F(x1), F(x2) shown in the below truth table are referred to as (F(x1), F(x2)).
(78) TABLE-US-00002 x1 x0 s1 s2 F(x1) F(x2) 1 0 0 0 0 0 0 2 0 1 0 0 0 1 3 1 0 0 0 1 0 4 1 1 0 0 1 1 5 0 0 0 1 0 0 6 0 1 0 1 0 0 7 1 0 0 1 0 1 8 1 1 0 1 1 0 9 0 0 1 0 0 0 10 0 1 1 0 0 0 11 1 0 1 0 0 0 12 1 1 1 0 0 1 13 0 0 1 1 0 0 14 0 1 1 1 0 0 15 1 0 1 1 0 0 16 1 1 1 1 0 0
(79) For example, as illustrated in the above-mentioned truth table, the input data X1, X0 in item 3 are (1, 0), and the shifted values s1, s2 set in item 3 are (0, 0) which indicates no shift. Accordingly, the input data X1, X0 are not shifted in item 3, and the output data F(x1), F(x2) in item 3 are therefore (1, 0) as same as the input data X1, X0. In item 10, the input data X1, X0 are (0, 1), and the shifted values s1, s2 set in item 10 are (1, 0). Because the bit value of the input data (0, 1) is smaller than the shifted values (1, 0) and is shifted therewith, the bit value of the input data (0, 1) is shifted more than the bit value of the input data (0, 1) itself. Accordingly, the output data F(x1), F(x2) in item 10 become (0, 0). Alternatively stated, the input data X1, X0 (0, 1) are shifted based on the shifted values s1, s2 by the calculating circuit 1000 in some embodiments, in order to generate corresponding output data F(x1), F(x2). Other output data F(x1), F(x2) in the above truth table are calculated in the same manner. The rest of output data F(x1), F(x2) may be deduced by analogy, and thus detailed descriptions regarding the calculations are omitted herein.
(80) In some embodiments, the formula of the calculating circuit 1000 is given by:
F(x1)=x1 bar(s1)bar(s2)+x1x0 bar(s1) (16)
F(x2)=x0 bar(s1)bar(s2)+x1x0 bar(s0+x1 bar(x0)bar(s2)s1 (17)
(81) Also disclosed is a device that includes a plurality of first wires, a plurality of second wires, a plurality of resistors, and a processor. The second wires are arranged across the first wires. Each of the resistors is coupled to one of the first wires and one of the second wires. A plurality of input signals are transmitted from the first wires through the resistors to the second wires. The processor is configured to receive a sum value of the input signals from one of the second wires, and shift the sum value by a nonlinear activation function to generate a shifted sum value. The processor is configured to calculate a backpropagation value based on the shifted sum value and a target value related to a corresponding input signal of the plurality of input signals, and generate a pulse number based on the corresponding input signal of the input signal and the backpropagation value. Each of a value of the corresponding input signal and the backpropagation value is higher than or equal to a threshold value. The processor is configured to apply a voltage pulse to one of the resistors related to the corresponding input signal based on the pulse number, in order to modify a value of the corresponding input signal in the plurality of input signals to be the same as the target value.
(82) In some embodiments, the plurality of first wires and the plurality of second wires are arranged to form an array, wherein each of the plurality of resistors located at the same column of the array has a first terminal and a second terminal, the first terminals of the plurality of resistors are coupled to different wires of the plurality of first wires, and the second terminals of the plurality of resistor are coupled to the same wire of the plurality of second wires.
(83) In various embodiments, the processor is configured to respectively shift the sum values from the plurality of second wires located in the columns of the array by the nonlinear activation function to generate shifted sum values.
(84) In some embodiments, the processor is configured to calculate backpropagation values based on the shifted sum values and a plurality of target values, wherein each of the plurality of target values corresponds to one of the plurality of input signals.
(85) In various embodiments, the processor is configured to compare each of the values of the plurality of input signals with the threshold value, and compare each of the backpropagation values with the threshold value, wherein the processor is configured to generate pulse numbers based on the plurality of input signals and the backpropagation values if each of the plurality of input signals and the backpropagation values is higher than or equal to the threshold value.
(86) In some embodiments, the processor is configured to correspondingly apply voltage pulses to the plurality of resistors, through one of the plurality of first wires and one of the plurality of second wires, based on the pulse numbers, so as to change resistance of the plurality of resistors.
(87) In various embodiments, the nonlinear activation function includes at least one of a sigmoid function and a rectified linear unit (ReLU) function.
(88) Also disclosed is a device that includes a first net, a second net, and a processor. The first net includes a plurality of first wires and a plurality of first resistors. The second net includes a plurality of second wires and a plurality of second resistors. The first wires are arranged to form a first array. Each of the plurality of first resistors is disposed at one of areas formed between the plurality of first wires, and coupled to two of the plurality of first wires being across each other. The second wires are arranged to form a second array. Each of the plurality of second resistors is disposed at one of areas formed between the second wires, and coupled to two of the plurality of second wires being across each other. The processor is configured to obtain first input signals transmitted through the plurality of first resistors to calculate first sum values, provide second signals related to the first sum values to the second net, and obtain second input signals transmitted through the plurality of second resistors to calculate second sum values. The processor is configured to shift the first sum values and the second sum values by a nonlinear activation function to generate first shifted sum values and second shifted sum values. The processor is configured to calculate first feedbacks of the first net and second feedbacks of the second net based on the second shifted sum values and a plurality of target values related to a corresponding input signal of the first input signals. The processor is configured to generate a plurality of first pulse numbers based on the first input signals and the first feedbacks, and generate a plurality of second pulse numbers based on the second input signals and the second feedbacks. The processor is configured to apply a first voltage pulse to one of the plurality of first resistors based on the plurality of first pulse numbers, and configured to apply a second voltage pulse to one of the plurality of second resistors based on the plurality of second pulse numbers, in order to modify a value of the corresponding input signal of the first input signals to be the same as a corresponding target value of the plurality of target values.
(89) In some embodiments, the processor is configured to compare each of values of the first input signals with a threshold value, compare each of values of the first feedbacks with the threshold value, and generate the first pulse numbers based on the first input signals and the first feedbacks if each of values of the first input signals and the first feedbacks is higher than or equal to the threshold value.
(90) In various embodiments, the processor is configured to compare each of values of the second input signals with the threshold value, compare each of values of the second feedbacks with the threshold value, and generate the second pulse numbers based on the second input signals and the second feedbacks if each of values of the second input signals and the second feedbacks is higher than or equal to the threshold value.
(91) In some embodiments, the processor is configured to shift the first sum values by the nonlinear activation function to generate the first shifted sum values, wherein the processor is configured to shift the second sum values by the nonlinear activation function to generate the second shifted sum values.
(92) In various embodiments, the first feedbacks include first backpropagation values, and the second feedbacks include second backpropagation values, wherein the processor is configured to calculate second backpropagation values based on the second shifted sum values and the target values, and calculate first backpropagation values based on the first shifted sum values and the second backpropagation values.
(93) In some embodiments, the nonlinear activation function includes at least one of a sigmoid function and a rectified linear unit (ReLU) function.
(94) Also disclosed is a method that includes: receiving a plurality of input signals by a plurality of first wires; receiving a sum value of the plurality of input signals transmitted through a plurality of resistors from one of a plurality of second wires, and shifting the sum value by a nonlinear activation function to generate a shifted sum value; calculating a feedback based on the shifted sum value and a target value related to a corresponding input signal of the plurality of input signals, and generating a pulse number based on the corresponding input signal of the plurality of input signals and the feedbacks, wherein each of a value of the plurality of input signals and the feedbacks is higher than or equal to a threshold value; applying a voltage pulse to one of the plurality of resistors related to the corresponding input signal based on the pulse number; and modifying a value of the corresponding input signal of the plurality of input signals to be the same as the target value.
(95) In some embodiments, shifting the sum value by the nonlinear activation function to generate the shifted sum value includes: respectively shifting the sum values from the plurality of second wires located in columns of an array by the nonlinear activation function to generate shifted sum values.
(96) In various embodiments, calculating the feedback based on the shifted sum value and the target value includes: calculating feedback values based on the shifted sum values and a plurality of target values, wherein each of the target values corresponds to one of the plurality of input signals.
(97) In some embodiments, the method further includes: comparing each of the values of the plurality of input signals with the threshold value, and comparing each of the feedbacks with the threshold value; and generating pulse numbers based on the plurality of input signals and the feedbacks if each of the input signals and the feedbacks is higher than or equal to the threshold value simultaneously.
(98) In various embodiments, the feedbacks include backpropagation values.
(99) In some embodiments, applying the voltage pulse to one of the plurality of resistors related to the corresponding input signal based on the pulse number includes: correspondingly applying voltage pulses to the plurality of resistors, through one of the plurality of first wires and one of the plurality of second wires, based on the pulse numbers, so as to change resistances of the plurality of resistors.
(100) In various embodiments, the nonlinear activation function includes at least one of a sigmoid function and a rectified linear unit (ReLU) function.
(101) The foregoing outlines features of several embodiments so that those skilled in the art may better understand the aspects of the present disclosure. Those skilled in the art should appreciate that they may readily use the present disclosure as a basis for designing or modifying other processes and structures for carrying out the same purposes and/or achieving the same advantages of the embodiments introduced herein. Those skilled in the art should also realize that such equivalent constructions do not depart from the spirit and scope of the present disclosure, and that they may make various changes, substitutions, and alterations herein without departing from the spirit and scope of the present disclosure.