In software-defined neural networks (NN), the weight update is computed precisely through mathematical equations, and the value of the weight update is then stored in digital memories. In hardware neural networks (HNNs), the weight update is directly computed and stored in synapses according to the effective number of pulses that one synapse receives during weight update. The weight state of an RRAM-based (Resistive Random Access Memory, RRAM) synapse has limited precision and is bounded. Furthermore, the weight update is asymmetric and nonlinear.
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.
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.
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.
Reference is now made to
As illustratively shown in
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 X1-XI 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 Wi,j. For instance, the neuron X1 in the input neuron layer 110 and the neuron H1 the hidden neuron layer 120 are connected to each other, and there is a weight W1,1 between the neuron X1 and the neuron H1. Each of the neurons H1-HJ in the hidden neuron layer 120 receives products of every input data and the weight Wi,j, and the product is referred to as a weight sum in some embodiments.
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 Wj,k. For instance, the neuron H2 in the hidden neuron layer 120 and the neuron O2 in the output neuron layer 130 are connected to each other, and there is a weight W2,2 between the neuron H2 and the neuron O2. The weight sum from each of the neurons H1-HJ of the hidden neuron layer 120 is regarded as an input of the output neuron layer 130. Each of the neurons O1-OK in the output neuron layer 130 receives products of every weight sum and the weight Wj,k.
As illustratively shown in
Reference is now made to
In some embodiments, the perceptron network 100 in
In some embodiments, the hardware neural network device in
As illustratively shown in
As illustratively shown in
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 G11, G21, . . . , GI1 are located at the same column of the array, and each of the resistors G11, G21, . . . , GI1 has a upper terminal and a lower terminal. As illustratively shown in
As illustratively shown in
In some embodiments, the weight values are both positive and negative numbers in the perceptron network 100 of
In some embodiments, the hardware neural network device in
Reference is now made to
As illustratively shown in
In some embodiments, the input signals X1-XI are voltage signals, and the processor 210 provides the voltage signals X1-XI to input terminals of the wires W1. As illustratively shown in
As discussed above, weight Wi,j is generated based on the input data transmitted through the resistors G11-GIJ as illustratively shown in
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
In addition, the processor 210 provides the voltage signals X1-XI to the input terminals of the wires W1. For illustration in
As illustratively shown in
As shown in formula (1) and (2), fa is a nonlinear activation function, and Xi is the value of the input signal. SJH is the weighted sum before activation. bj is the bias value. Wij is the weight value. Gij is a conductance value of one of the resistors G11-GIJ in the hardware neural network device in
Reference is now made to
As illustratively shown in
In some embodiments, the hardware neural network device in
As illustratively shown in
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 M11-MJK is correspondingly coupled to one of the wires W3 and one of the wires W4. For illustration, one terminal of the resistor M11 is coupled to the upmost wire W3 in the corresponding array, and the other terminal of the resistor G11 is coupled to the leftmost wire W4 in the corresponding array, as shown in
As illustratively shown in
In some embodiments, the processor 220 is configured to provide weight sums through the wires W3. For illustration, the processor 220 provides weight sums H1-HJ through the wires W3 to the additional array as shown in
Reference is now made to both
As shown in formula (3) and (4), fa is a nonlinear activation function, and Hj is the value of the input signal. Sk0 is the weighted sum before activation. bk is the bias value. Wjk is the weight value. Mjk is a conductance value of the resistors in a hardware neural network device. The parameter Gr in formula (4) will be described in the following discussions.
As shown in formula (2) and (4), Gr is a reference value given by:
G
r=(Gmax−Gmin)/2 (5)
As shown in formula (5), the conductance values of the resistors G11-GIJ in the hardware neural network device of
As illustratively shown in
As shown in formula (6) and (7), s is a parallel shifted value of the functions. Reference is now made to
As illustratively shown in
As shown in formula (8) and (9), OkBP is the backpropagation value of the output. Tk is the target value of each output neuron as discussed above in
In some embodiments, in operation 340, the processor 230 calculates a backpropagation value OkBP based on the difference between the target value Tk and the output value Ok as well as the weighted sum being calculated using derivative of activation, i.e., fa′(SkO). Substantially, the processor 220 calculates a backpropagation value HjBP based on the sum of the backpropagation value OkBP and the weight value Wjk as well as the weighted sum being calculated using derivative of activation, i.e., fa′(SjH).
In addition, the pulse numbers applied on the resistors G11-GIJ, G11-GJK are given by:
Δnij=round(Xi×ηHjBP) (10)
Δnjk=round(Hj×ηOkBP) (11)
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.
As illustratively shown in
As shown above in formula (12) and (13), nPold 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. nDold 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.
As illustratively shown in
Reference is now made to
Reference is now made to
As illustratively shown in
Reference is now made to
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
Reference is now made to
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
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)).
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 thl, 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.
In some embodiments, the formula implemented in the calculating circuit 900 is given by:
F(x1)=x1x0+x1bar(th1)+x1bar(th2) (14)
F(x2)=1x0+x0bar(th1) (15)
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)).
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.
In some embodiments, the formula of the calculating circuit 1000 is given by:
F(x1)=x1bar(s1)bar(s2)+x1x0bar(s1) (16)
F(x2)=x0bar(s1)bar(s2)+x1x0bar(s1+x1bar(x0)bar(s2)s1 (17)
Also disclosed is a device that includes first wires, second wires, 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. 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 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 input signals to be the same as the target value.
Also disclosed is a device that includes a first net, a second net, and a processor. The first net includes first wires and first resistors. The second net includes second wires and second resistors. The first wires are arranged to form a first array. Each of the first resistors is disposed at one of areas formed between the first wires, and coupled to two of the first wires being across each other. The second wires are arranged to form a second array. Each of the second resistors is disposed at one of areas formed between the second wires, and coupled to two of the second wires being across each other. The processor is configured to obtain first input signals transmitted through the 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 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 target values related to a corresponding input signal of the first input signals. The processor is configured to generate first pulse numbers based on the first input signals and the first feedbacks, and generate 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 first resistors based on the first pulse numbers, and configured to apply a second voltage pulse to one of the second resistors based on the 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 target values.
Also disclosed is a device. The device includes first wires, second wires, resistors and a processor. The first wires are configured to receive input signals. The resistors configured to transmit the input signals to one of the second wires to generate a sum value. The processor is configured to shift the sum value by a nonlinear activation function to generate a shifted sum value, calculate a feedback based on the shifted sum value and a target value related to a corresponding input signal of the input signals, generate a pulse number based on the corresponding input signal and the feedback, apply a voltage pulse to one of the resistors related to the corresponding input signal based on the pulse number, and modify a value of the corresponding input signal to be the same as the target value.
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.
The present application is a divisional application of U.S. application Ser. No. 16/162,582, filed on Oct. 17, 2018, which claims priority to U.S. Provisional Application Ser. No. 62/592,772, filed Nov. 30, 2017, which is herein incorporated by reference.
Number | Date | Country | |
---|---|---|---|
62592772 | Nov 2017 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 16162582 | Oct 2018 | US |
Child | 17875262 | US |