ARITHMETIC LOGIC UNIT, MULTIPLY-ACCUMULATE OPERATION DEVICE, MULTIPLY-ACCUMULATE OPERATION SYSTEM, AND MULTIPLY-ACCUMULATE OPERATION METHOD
20210318853 · 2021-10-14
Inventors
- Takashi Morie (Fukuoka, JP)
- Ha karu Tamukoh (Fukuoka, JP)
- Quan Wang (Fukuoka, JP)
- Yasushi Fujinami (Tokyo, JP)
Cpc classification
G06F7/60
PHYSICS
G06G7/60
PHYSICS
International classification
Abstract
An arithmetic logic unit according to an embodiment of the present technology includes: a plurality of input lines; and a multiply-accumulate operation device. Pulse signals corresponding to input values are input to the plurality of input lines. The multiply-accumulate operation device includes a plurality of multiplication units that generates, on the basis of the pulse signals input to each of the plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values, and an output unit that outputs a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values generated by each of the plurality of multiplication units. A value of at least one of the input value or the weight value is limited.
Claims
1. An arithmetic logic unit, comprising: a plurality of input lines, pulse signals corresponding to input values being input to the plurality of input lines; and a multiply-accumulate operation device that includes a plurality of multiplication units that generates, on a basis of the pulse signals input to each of the plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values, and an output unit that outputs a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values generated by each of the plurality of multiplication units, wherein a value of at least one of the input value or the weight value is limited.
2. The arithmetic logic unit according to claim 1, wherein the value of the at least one of the input value or the weight value is limited to fall within a predetermined value range.
3. The arithmetic logic unit according to claim 2, wherein the predetermined value range includes a plurality of limit values, and the value of the at least one of the input value or the weight value is set to one of the plurality of limit values.
4. The arithmetic logic unit according to claim 3, wherein the plurality of limit values includes zero.
5. The arithmetic logic unit according to claim 3, wherein the plurality of limit values includes a positive limit value and a negative limit value that have absolute values equal to each other.
6. The arithmetic logic unit according to claim 1, wherein the weight value is limited by first processing of setting the weight value on a basis of a first value that is an absolute value of a value to be the weight value.
7. The arithmetic logic unit according to claim 6, wherein the first processing is processing of setting, where the first value is a first threshold value or less, the weight value to zero.
8. The arithmetic logic unit according to claim 6, wherein the first processing is processing of setting the weight value to zero at a first ratio in order from the smallest first value, the weight value being set for each of the plurality of multiplication units.
9. The arithmetic logic unit according to claim 1, wherein the input value is limited by second processing of setting the input value on a basis of a second value that is an absolute value of a value to be the input value.
10. The arithmetic logic unit according to claim 9, wherein the second processing is processing of setting, where the second value is a second threshold value or less, the input value to zero.
11. The arithmetic logic unit according to claim 9, wherein the second processing is processing of setting the input value to zero at a second ratio in order from the smallest second value, the input value being represented by the pulse signal input to each of the plurality of multiplication units.
12. The arithmetic logic unit according to claim 9, further comprising a limiting unit that executes, using an absolute value of the sum of the multiplication values represented by the multiply-accumulate signal as the second value, the second limitation processing on a basis of the multiply-accumulate signal.
13. The arithmetic logic unit according to claim 1, wherein the pulse signal is input to each of the plurality of input lines within a predetermined input period, and the output unit outputs a multiply-accumulate signal representing the sum of the multiplication values within a predetermined output period.
14. The arithmetic logic unit according to claim 1, wherein the input value is a value represented by a first input value and a second input value, and the plurality of input lines includes a plurality of pairs of the input lines, each of the pairs including a first input line and a second input line, a first pulse signal representing the first input value being input to the first input line, a second pulse signal representing the second input value being input to the second input line.
15. The arithmetic logic unit according to claim 1, wherein the pulse signal is a signal representing the input value using at least one of timing of a pulse or a pulse width.
16. A multiply-accumulate operation device, comprising: a plurality of multiplication units that generates, on a basis of the pulse signals input to each of a plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values; and an output unit that outputs a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values generated by each of the plurality of multiplication units, wherein a value of at least one of the input value or the weight value is limited.
17. A multiply-accumulate operation system, comprising: a plurality of input lines, pulse signals corresponding to input values being input to the plurality of input lines; a plurality of multiply-accumulate operation devices that includes a plurality of multiplication units that generates, on a basis of the pulse signals input to each of the plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values, and an output unit that outputs a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values generated by each of the plurality of multiplication units; and a network circuit configured by connecting the plurality of multiply-accumulate operation devices, wherein a value of at least one of the input value or the weight value is limited.
18. A multiply-accumulate operation method, comprising: inputting pulse signals corresponding to input values to a plurality of input lines; generating, on a basis of the pulse signals input to each of the plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values; outputting a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values; and limiting a value of at least one of the input value or the weight value.
19. An arithmetic logic unit, comprising: a plurality of input lines, pulse signals corresponding to input values being input to the plurality of input lines; a multiply-accumulate operation device that includes a plurality of multiplication units that generates, on a basis of the pulse signals input to each of the plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values, and an output unit that outputs a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values generated by each of the plurality of multiplication units; and a limitation processing unit that limits a value of at least one of the input value or the weight value before each of the plurality of multiplication units generates charges corresponding to the multiplication values.
20. A multiply-accumulate operation system, comprising: a plurality of input lines, pulse signals corresponding to input values being input to the plurality of input lines; a plurality of multiply-accumulate operation devices that includes a plurality of multiplication units that generates, on a basis of the pulse signals input to each of the plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values, and an output unit that outputs a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values generated by each of the plurality of multiplication units; a network circuit configured by connecting the plurality of multiply-accumulate operation devices; and a limitation processing unit that limits a value of at least one of the input value or the weight value before each of the plurality of multiplication units generates charges corresponding to the multiplication values, wherein the value of the at least one of the input value or the weight value is limited by the limitation processing unit via the network circuit.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073]
[0074]
[0075]
[0076]
[0077]
[0078]
[0079]
[0080]
MODE(S) FOR CARRYING OUT THE INVENTION
[0081] Hereinafter, embodiments according to the present technology will be described with reference to the drawings.
First Embodiment
Configuration of Arithmetic Logic Unit
[0082]
[0083] The arithmetic logic unit 100 includes a plurality of signal lines 1, a plurality of input units 2, and a plurality of analog circuits 3. Each of the signal lines 1 is a line that transmits an electrical signal of a predetermined system, and an electrical signal corresponding to a signal value is input thereto. As the electrical signal, for example, an analog signal representing a signal value using an analog amount such as the timing and width of the pulse is used. The directions in which electrical signals are transmitted are schematically illustrated in
[0084] For example, the plurality of signal lines 1 is connected to one analog circuit 3. The signal line 1 that transmits an electrical signal to the analog circuit 3 is an input signal line from which an electrical signal is input for the analog circuit 3 to which the signal line 1 is connected. Further, the signal line 1 that transmits an electrical signal output from the analog circuit 3 is an output signal line to which an electrical signal is output for the analog circuit 3 that outputs an electrical signal. In this embodiment, the input signal line corresponds to the input line.
[0085] Each of the plurality of input units 2 generates a plurality of electrical signals corresponding to input data 4. The input data 4 is, for example, data to be processed using a neural network or the like implemented by the arithmetic logic unit 100. Therefore, it can also be said that the respective signal values of the plurality of electrical signals corresponding to the input data 4 are input values to the arithmetic logic unit 100.
[0086] As the input data 4, for example, arbitrary data such as image data, audio data, and statistical data to be processed by the arithmetic logic unit 100 is used. For example, in the case where image data is used as the input data 4, an electrical signal having a signal value corresponding to the pixel value (RGB value, luminance value, etc.) of each of the pixels of the image data is generated. In addition, an electrical signal corresponding to the input data 4 may be appropriately generated in accordance with the type of the input data 4 and the content of the processing by the arithmetic logic unit 100.
[0087] The analog circuit 3 is a multiply-accumulate operation circuit of an analog system performing a multiply-accumulate operation on the basis of the electrical signal to be input. The multiply-accumulate operation is an operation of adding a plurality of multiplication values obtained by multiplying a plurality of input values (signal values) by weight values. Therefore, it can also be said that the multiply-accumulate operation is processing of calculating the sum (hereinafter, referred to as the multiply-accumulate result) of the respective multiplication values.
[0088] In the following, assumption is made that the total number of electrical signals input to one analog circuit 3 is N. Note that the number N of the electrical signals to be input to each of the analog circuits 3 is appropriately set for each of the circuits in accordance with, for example, the model, accuracy, and the like of operation processing.
[0089] In the analog circuit, for example, w.sub.i.Math.x.sub.i, which is a multiplication value of a signal value (input value) x.sub.i represented by an electrical signal input from the i-th input signal line and a weight value w.sub.i corresponding to the signal value x.sub.i, is calculated. Here, i is a natural number equal to or less than N (i=1, 2, . . . , N). The operation of the multiplication value is executed for each electrical signal (input signal line) and N multiplication values are calculated. The sum of the N multiplication values is calculated as a multiply-accumulate result (sum of the N multiplication values). Therefore, the multiply-accumulate result calculated by one analog circuit 3 is expressed by the following formula.
[0090] In this embodiment, the weight value w.sub.i whose possible values are limited in advance is used. The weight value w.sub.i is, for example, calculated in advance and set for the analog circuit 3 (the synapse circuit 8 described below). For example, the weight value w.sub.i whose value is limited is calculated using a computer or the like so that a neural network or the like mounted on the arithmetic logic unit 100 appropriately executes processing. As described above, in the arithmetic logic unit 100, the value of the weight value w.sub.i is limited. As described below, in this embodiment, the value of the weight value w.sub.i is limited so as to fall within a predetermined value range.
[0091] The signal value x.sub.i is, for example, a value represented by an electrical signal output from each of the input units 2 or a multiply-accumulate result output from each of the analog circuits 3. Therefore, it can be said that each of the input units 2 and the analog circuits 3 functions as a signal source that outputs the signal value x.sub.i. Note that the method of transmitting the signal value x.sub.i, and the like are not limited. For example, an arbitrary electrical signal for transmitting the signal value x.sub.i may be used so that the operation shown in (Math. 1) can be performed.
[0092] As shown in
[0093] The pair of electrical signals include, for example, a positive electrical signal representing a positive signal value x.sub.i.sup.+ and a negative electrical signal representing a negative signal value x.sub.i.sup.−. For example, the positive signal value x.sub.i.sup.+ and the negative signal value x.sub.i.sup.− are each a real number of zero or more, and a difference value (x.sub.i.sup.+−x.sub.i.sup.−) obtained by subtracting the negative signal value x.sub.i.sup.− from the positive signal value x.sub.i.sup.+ is the signal value x.sub.i. In another aspect, it can be said that one signal value x.sub.i is a value represented by the positive and negative signal values x.sub.i.sup.+ and x.sub.i.sup.−. In this embodiment, the positive signal value x.sub.i.sup.+ corresponds to the first input value, and the negative signal value x.sub.i.sup.− corresponds to the second input value.
[0094] For example, the analog circuit 3 outputs, as the positive electrical signal, an electrical signal representing a positive multiply-accumulate result (the positive signal value x.sub.i.sup.+) that is the total sum of positive multiplication values, and outputs, as the negative electrical signal, an electrical signal representing a negative multiply-accumulate result (the negative signal value x.sub.i.sup.−) that is the total sum of negative multiplication values.
[0095] A plurality of positive signal lines 1a that transmits the positive electrical signal and a plurality of negative signal lines 1b that transmits the negative electrical signal are connected to the output side of one analog circuit 3. The same positive electrical signal is input to the plurality of positive signal lines 1a. Further, the same negative electrical signal is input to the plurality of negative signal lines 1b. In
[0096] Further, a configuration in which a pair of electrical signals are output from each of the input units 2 (signal source) may be used. For example, the input unit 2 outputs, as the positive electrical signal, an electrical signal representing a signal value corresponding to the input data 4, and outputs, as the negative electrical signal, an electrical signal whose signal value is zero. For example, the input unit 2 can be configured as described above.
[0097] As described above, in this embodiment, a plurality of pairs of input signal lines 6 are used, each of the pairs including the positive input signal line 6a and the negative input signal line 6a, the positive electrical signal representing the positive signal value x.sub.i.sup.+ being input to the positive input signal line 6a, the negative electrical signal representing the negative signal value x.sub.i.sup.− being input to the negative input signal line 6a.
[0098] As shown in
[0099] For example, N electrical signals generated by N input units 2 are input to each of the analog circuits 3 provided in the layer of the first stage (the lowest layer). The multiply-accumulate result relating to the signal value x.sub.i of the input data is calculated by each of the analog circuits 3 in the first stage, and output to the analog circuit 3 provided in the next layer (second stage).
[0100] N.sub.1 electrical signals representing the multiply-accumulate results calculated in the first stage are input to the respective analog circuits 3 provided in the second layer (upper layer). Therefore, each of the multiply-accumulate results calculated in the first stage is the signal value x.sub.i (the positive and negative signal values x.sub.i.sup.+ and x.sub.i.sup.−) of the electrical signal when viewed from each of the analog circuits 3 in the second stage. The multiply-accumulate result relating to the signal value x.sub.i output from the first stage is calculated by each of the analog circuits 3 in the second stage, and output to the analog circuit 3 in the upper layer.
[0101] In this way, in the arithmetic logic unit 100, the multiply-accumulate result of the analog circuit 3 in the upper layer is calculated on the basis of the multiply-accumulate result calculated by the analog circuit 3 in the lower layer. Such processing is executed a plurality of times, and the processing result is output from the analog circuit 3 included in the top layer (the layer of the third stage in
[0102] Note that the method of connecting the analog circuits 3 to each other, and the like are not limited, and, for example, the plurality of analog circuits 3 may be appropriately connected to each other so that desired processing can be performed. For example, the present technology is applicable even in the case where the analog circuits 3 are connected to each other so as to constitute another structure different from the hierarchical structure.
[0103] In the above description, the configuration in which a multiply-accumulate result calculated in the lower layer is input to the upper layer as it is has been described. The present invention is not limited thereto. For example, conversion processing or the like may be executed on the multiply-accumulate result. For example, in the neural network model, processing such as performing non-linear conversion on the multiply-accumulate result of each of the analog circuits 3 using an activation function, and inputting the conversion result to the upper layer is executed.
[0104] In the arithmetic logic unit 100, for example, a function circuit 5 that performs non-linear transformation by an activation function on the electrical signal is used. The function circuit 5 is, for example, a circuit that is provided between a lower layer and an upper layer, appropriately converts a signal value of an electrical signal to be input, and outputs an electrical signal according to a result of the conversion. The function circuit 5 is provided for each of the signal lines 1, for example. The number, arrangement, and the like of the function circuits 5 are appropriately set in accordance with, for example, the mathematical model implemented in the arithmetic logic unit 100.
[0105] Note that in
[0106] As the activation function, for example, a ReLU function (ramp function) or the like is used. In the ReLU function, the signal value x.sub.i is output as it is in the case where, for example, the signal value xi is 0 or more, and 0 is output in other cases. As a result, it is possible to significantly improve the processing accuracy of the arithmetic logic unit 100.
[0107]
[0108]
[0109] In this embodiment, an electrical signal (pulse) is input to each of the plurality of input signal lines 6 within a predetermined input period T. The signal value x.sub.i is represented by the input timing of the pulse in this input period T. Therefore, for example, the pulse input at the same time as the beginning of the input period T represents the largest signal value x.sub.i.
[0110] Note that in
[0111] It can be said that the analog circuit 3 according to this embodiment is the analog circuit 3 of the TACT system. In this embodiment, it is possible to execute a time-axis analog multiply-accumulate operation using the analog circuit 3 of the TACT system.
[0112]
[0113] The analog circuits 3 each include a pair of output lines 7, a plurality of synapse circuits 8, and a neuron circuit 9. As shown in
[0114] The pair of output lines 7 are spaced apart from each other along the extension direction. The pair of output lines 7 include a positive output line 7a and a negative output line 7b. Each of the output lines 7a and 7b is connected to the neuron circuit 9 via the plurality of synapse circuits 8.
[0115] The synapse circuit 8 calculates the multiplication value (w.sub.i.Math.x.sub.i) of the signal value x.sub.i represented by the electrical signal and the weight value w.sub.i. The weight value w.sub.i is set in advance for the synapse circuit 8. Charges corresponding to multiplication values (w.sub.i.Math.x.sub.i.sup.+ and w.sub.i.Math.x.sub.i.sup.−) of the weight value w.sub.i and the positive and negative signal values x.sub.i.sup.+ and x.sub.i.sup.− input from the positive and negative input signal lines 6a and 6b are generated.
[0116] For example, in the case where a positive weight value w.sub.i.sup.+ is set, charges corresponding to w.sub.i.sup.+.Math.x.sub.i.sup.+ are output to the positive output line 7a, and charges corresponding to w.sub.i.sup.+.Math.x.sub.i.sup.− are output to the output line 7a. Further, for example, in the case where a negative weight value w.sub.i.sup.− is set, charges corresponding to w.sub.i.sup.−.Math.x.sub.i.sup.+ are output to the negative output line 7b, and charges corresponding to w.sub.i.sup.−.Math.x.sub.i.sup.− are output to the positive output line 7b.
[0117] Note that in the synapse circuit 8, charges of the same sign (e.g., positive charges) are output regardless of the positive and negative of the weight value w.sub.i as charges corresponding to the multiplication value. Therefore, multiplication with w.sub.i.sup.− can be regarded as multiplication with |w.sub.i.sup.−| that is the absolute value thereof.
[0118] Further, in the case where the weight value w.sub.i=0 is set, the multiplication values with the positive and negative signal values x.sub.i.sup.+ and x.sub.i.sup.− are both zero. In this case, charges are not output from the synapse circuit 8 to the positive output line 7a and the negative output line 7b.
[0119] As described above, in the analog circuit 3, charges corresponding to the multiplication value obtained by multiplying the signal value x.sub.i by the weight value w.sub.i are generated by the plurality of synapse circuits 8 on the basis of the electrical signal input to each of the plurality of input signal lines 6. Further, the generated charges are output to the positive and negative output lines 7a and 7b in accordance with the sign of the weight value w.sub.i. In this embodiment, the synapse circuit 8 corresponds to the multiplication unit.
[0120] The synapse circuit 8 is configured using, for example, a resistance element that generates a current from a voltage represented by and electrical signal, or a switch element or the like that switchably outputs the generated current to the respective output lines. For example, a circuit using a MOS (Metal Oxide Semiconductor) transistor or the like as a resistance element, a circuit using a flip-flop circuit or the like as a switch element, or the like may be configured. In addition, the specific configuration of the synapse circuit 8 is not limited.
[0121]
[0122] The accumulation unit 11 accumulates the charges output to the pair of output lines 7 by the plurality of synapse circuits 8. The accumulation unit 11 includes two capacitors 13a and 13b. The capacitor 13a is connected between the positive output line 7a and a GND. Further, the capacitor 13b is connected between the negative output line 7b and a GND.
[0123] Therefore, charges flowing in from the output lines 7a and 7b are respectively accumulated in the capacitors 13a and 13b. Note that in the accumulation unit 11, a switch or the like for discharging the charges accumulated in each of the capacitors 13 is appropriately provided.
[0124] The output unit 12 outputs a multiply-accumulate signal representing the sum of the multiplication values (w.sub.i.Math.x.sub.i) on the basis of charges accumulated in the accumulation unit 11. In this embodiment, as the multiply-accumulate signal, two signals, i.e., a positive multiply-accumulate signal and a negative multiply-accumulate signal respectively representing the positive and negative multiply-accumulate results, are generated.
[0125] When charges are accumulated in the capacitor 13, the potential of the side of the capacitor 13 connected to the output line 7 increases. By detecting this potential, it is possible to detect charges accumulated in the capacitor 13. For example, the output unit 12 detects the potential of the capacitor 13a to generate a positive multiply-accumulate signal, and detects the potential of the capacitor 13b to generate a negative multiply-accumulate signal. As described above, the neuron circuit 9 (the accumulation unit 11 and the output unit 12) outputs the multiply-accumulate signal representing the sum of multiplication values by accumulating charges corresponding to the multiplication value generated by each of the plurality of synapse circuits 8.
[0126] Further, the output unit outputs the multiply-accumulate signal (positive and negative multiply-accumulate signals) representing the sum of multiplication values within a predetermined output period. The predetermined output period is, for example, a period having a length similar to that of the input period T. The output period is a period following the input period, and is started at the end of the input period and ends when the period T has been elapsed, for example. In the following, the output period is referred to as the output period T having the same length as that of the input period T in some cases.
[0127] As described above, in this embodiment, an electrical signal of the TACT system is used. For example, when an electrical signal of the TACT system is input to the synapse circuit 8, charges are generated at a constant ratio continuously from the input timing of a pulse and output to the output line 7. As a result, charges are accumulated in the capacitor 13 at a constant ratio. For example, by detecting the timing when the potential of the capacitor 13 has exceeded a predetermined threshold value, it is possible to detect the total amount of charges output to the output line 7.
[0128] Thus, in the TACT system, charges are output at a rate (slope) corresponding to the respective weight values w, and the capacitor is charged until the charges exceed the threshold value. In this case, the entire multiply-accumulate result calculated by one analog circuit 3 can be calculated using the following formula as shown in Patent Literature 1, for example.
[0129] Here, θ.sup.+ and θ.sup.− respectively represent threshold values for detecting the potentials of the capacitors 13a and 13b. Further, β represents the total sum of the weight values w.sub.i set for the respective synapse circuits 8. β.sup.+ and β.sup.− respectively represent the total sum of the positive weight values w.sub.i.sup.+ and the total sum of the negative weight values |w.sub.i.sup.−|, and β=β.sup.+−β.sup.−. Further, T.sub.in represents the input period T (the output period T).
[0130] t.sub.υ.sup.+ and t.sub.υ.sup.− respectively represent timings when the potentials of the capacitors 13a and 13b have exceeded respective threshold values. In the output unit 12, an electrical signal of the TACT system whose pulse is started at the timing of t.sub.υ.sup.+ is generated as the positive multiply-accumulate signal. Further, an electrical signal of the TACT system whose pulse is started at the timing of t.sub.υ.sup.− is generated as the negative multiply-accumulate signal.
[0131] In general, β.sup.+, which is the total sum of the positive weight values w.sub.i.sup.+, and β.sup.−, which is the total sum of the negative weight values |w.sub.i.sup.−|, have different values. However, as shown in
[0132] For example, the threshold values θ.sup.+ and θ.sup.− for the capacitors 13a and 13b are set to the same value so that the scales of the multiply-accumulate results to be output are equal to each other. As a result, the (Math. 2) formula, which is a multiply-accumulate result calculated by the analog circuit 203, is modified as follows.
[0133] As shown in the (Math. 3) formula, the entire multiply-accumulate result can be calculated as a difference obtained by subtracting the timing t.sub.υ.sup.+ when the potential of the capacitor 13b has exceeded the threshold value from the timing t.sub.υ.sup.− when the potential of the capacitor 13b has exceeded the threshold value. Such an operation can be easily executed using a logical circuit or the like on the basis of, for example, a positive multiply-accumulate signal representing the timing t.sub.υ.sup.+ and a negative multiply-accumulate signal representing the timing t.sub.υ.sup.−.
[0134] In this embodiment, the positive signal value x.sub.i.sup.+ and the negative signal value x.sub.i.sup.−, i.e., the positive multiply-accumulate signal and the negative multiply-accumulate signal, are input from the analog circuit 3 in the lower layer to the analog circuit 3 in the upper layer. Therefore, the entire multiply-accumulate result shown in the (Math. 3) formula is not calculated between the layers, and the positive and negative multiply-accumulate signals are transmitted as they are. As a result, for example, the entire multiply-accumulate result does not need to be calculated for each of the analog circuits 3, making it possible to simplify the circuit configuration.
Operation of Analog Circuit
[0135] As described above, in a time-axis analog multiply-accumulate operation, information of the signal value x.sub.i is replaced with the time-axis-reference parameter (the timing of the pulse in the TACT system) and transmitted. Meanwhile, for example, in a multiply-accumulator or the like of a digital system, a method of transmitting the signal value x.sub.i as it is as a numerical value is used. Hereinafter, the operation of the analog circuit 3 that performs a time-axis analog multiply-accumulate operation will be described as compared with a multiply-accumulator that transmits the signal value x.sub.i as a numerical value as it is and performs a multiply-accumulate operation independently of the time axis.
[0136]
[0137] The multiply-accumulator 15 performs a multiply-accumulate operation on the basis of the input value x.sub.i transmitted as a numerical value, for example. The multiply-accumulator 15 is realized by, for example, a dedicated digital circuit, a general-purpose digital processor, or the like. Further, the multiply-accumulator 15 can also be regarded as a functional block that performs a multiply-accumulate operation configured by a program. In
[0138] Further, the weight value w.sub.i to be multiplied by the input value x.sub.i is set for the multiply-accumulator 15. In
[0139] In a multiply-accumulate operation by the multiply-accumulator 15, an output value y=Σw.sub.i.Math.x.sub.i+b obtained by adding the biasing term b to the sum (see the (Math. 1) formula) of multiplication values of the input value x.sub.i and the weight value w.sub.i is output. Thus, in the multiply-accumulator 15, one output value y is calculated on the basis of N input values x.sub.i. Note that the total sum represented by the symbol Σ is the total sum for the subscript i=(1, 2, . . . , N).
[0140] As described above, N pairs of the input signal lines 6 are connected to the analog circuit 3, each of the pairs including the positive and negative input signal lines 6a and 6b. For example, the i-th input value x.sub.i is represented by each electrical signal (e.g., positive and negative multiply-accumulate signals) input to the i-th pair of input signal lines 6. Specifically, as described with reference to
[0141] In the TACT system, t.sub.i.sup.+ and t.sub.i.sup.− represent values satisfying the relationship of x.sub.i=(t.sub.i.sup.−−t.sub.i.sup.+)/T.sub.in. Thus, this relationship allows t.sub.i.sup.+ and t.sub.i.sup.− to be converted into x.sub.i. N sets of such (t.sub.i.sup.+, t.sub.i.sup.−) are input to the analog circuit 3. This corresponds to N input values x.sub.i being input.
[0142] N weight values w.sub.i multiplied by N (t.sub.i.sup.+, t.sub.i.sup.−) are set for the analog circuit 3. Further, the bias term b is set for the analog circuit 3. The weight value w.sub.i and the bias term b set for the analog circuit 3 are similar to the weight value w.sub.i and the bias term set for the multiply-accumulator 15.
[0143] In the time-axis analog multiply-accumulate operation by the analog circuit 3, charges corresponding to the multiplication value of each (t.sub.i.sup.+, t.sub.i.sup.−) and the weight value w.sub.i are appropriately accumulated, and a positive multiply-accumulate signal (electrical signal of the timing t.sub.υ.sup.+) and a negative multiply-accumulate signal (electrical signal of the timing t.sub.υ.sup.−) are output. Thus, in the analog circuit 3, a pair of outputs (t.sub.υ.sup.+, t.sub.υ.sup.−) are calculated from N pairs of inputs (t.sub.i.sup.+, t.sub.i.sup.−).
[0144] In the case where the bias term b is introduced, the relationship between the pair of outputs (t.sub.υ.sup.+, t.sub.υ.sup.−) calculated by the analog circuit 3 and the output value y calculated by the multiply-accumulator 15 is expressed as follows.
[0145] For example, by using the (Math. 4) formula, it is possible to calculate the entire multiply-accumulate result by the analog circuit 3 from the output (t.sub.υ.sup.+, t.sub.υ.sup.−) of the analog circuit 3. Note that in the analog circuit 3 provided in the lower layer, for example, the entire multiply-accumulate result or the like is not calculated, and the output (t.sub.υ.sup.+, t.sub.υ.sup.−) is used as it is as an input to the analog circuit 3 in a subsequent stage.
[0146] In a configuration in which the output (t.sub.υ.sup.+, t.sub.υ.sup.−) of the analog circuit 3 is input directly to the subsequent stage, as shown in the (Math. 4) formula, information relating to a multiply-accumulate result (output value y) is transmitted by the difference value t.sub.υ.sup.−−t.sub.υ.sup.+) of the output (t.sub.υ.sup.+, t.sub.υ.sup.−). For example, focusing on the difference value t.sub.υ.sup.−−t.sub.υ.sup.+), the (Math. 4) formula is rewritten as follows.
[0147] As shown in the (Math. 5) formula, the difference value t.sub.υ.sup.−−t.sub.υ.sup.+), which is information represented by the output of the analog circuit 3, is multiplied by 1/β.sub.0 each time passing through the analog circuit 3. Therefore, for example, it can be said that the larger the total sum of the weight values w.sub.i set for each of the analog circuits 3, the smaller the difference value (t.sub.υ.sup.−−t.sub.υ.sup.+). This will be specifically described below.
[0148]
[0149] In Part A of
[0150] In Part B of
[0151] The output (t.sub.υ.sup.(1)+, t.sub.υ.sup.(1)−) of the first stage is input to the analog circuit 3b in the second stage as it is. That is, it can be said that the value obtained by multiplying the original multiply-accumulate result by 1/β.sub.0.sup.(1) is input to the analog circuit 3b in the second stage. A time-axis analog operation is executed on the basis of the value multiplied by 1/β.sub.0.sup.(1). Therefore, a value (t.sub.υ.sup.(2)−−t.sub.υ.sup.(2)+)/T.sub.in relating to the multiply-accumulate result represented by the output (t.sub.υ.sup.(2)+, t.sub.υ.sup.(2)−) of the analog circuit 3b in the second stage is the value obtained by multiplying the original multiply-accumulate result (y.sup.(2)) by 1/(β.sub.0.sup.(1).Math.β.sub.0.sup.(2)). Note that in the analog circuit 3 in the second stage, b/β.sub.0.sup.(1) is used as the bias value.
[0152] As described above, the value representing the present operation result becomes smaller by passing through the analog circuit 3. That is, each time passing through one analog circuit 3, the difference value (t.sub.υ.sup.−−t.sub.υ.sup.+) is multiplied by 1/β.sub.0 and the value relating to the multiply-accumulate result is reduced in accordance with the total sum β.sub.0 of weight values set for the analog circuit 3. For this reason, in the operation performed through the plurality of analog circuits 3, for example, there is a possibility that the final operation result is small.
[0153]
[0154] The input layer 30 includes a convolution layer 33 (Conv1), a ReLU function unit 34a, and a pooling unit 35. The convolution layer 33 is a layer that executes convolution processing on image data in units of a target range (5×5). For example, a multiply-accumulate operation is performed on 28×28 image data by shifting the target range of 5×5 by one pixel. Hereinafter, the operation in the target range of 5×5 will be referred to as the unit operation.
[0155] In the example shown in
[0156] In the convolution layer 33, one unit operation is executed by one analog circuit 3. Therefore, 25 pairs of the input signal lines 6 are connected to one analog circuit 3. That is, the convolution layer 33 is provided with 24×24×30 analog circuits 3 for executing a multiply-accumulate operation on 5×5 data.
[0157] Note that the data for one pixel is input to the analog circuit 3 via, for example, the positive and negative input signal lines 6a and 6b. Therefore, 25 pairs of the input signal lines 6 are connected to the analog circuit 3. Further, a multiply-accumulate result is output from the analog circuit 3 via a pair of output signal lines 10a and 10b (see
[0158] The ReLU function unit 34a is a circuit for applying a ReLU function to the outputs of the 24×24×30 analog circuits 3. For example, the multiply-accumulate result is output as it is in the case where the multiply-accumulate result of the analog circuit 3 is positive, and 0 is output in the case where the multiply-accumulate result of the analog circuit 3 is negative.
[0159] The pooling unit 35 is a circuit that reduces the 24×24×30 outputs. For example, the vertical and horizontal operation results are reduced by half from the result of 24×24 unit operations. As a result, 12×12×30=4, 320 multiply-accumulate results are output from the input layer 30 to the intermediate layer 31 in the subsequent stage.
[0160] The intermediate layer 31 includes a first FC layer 36 (FC1: Full Connection 1) and a ReLU function unit 34b. The first FC layer 36 is provided with 100 analog circuits 3. To each of the analog circuits 3, 4,320 multiply-accumulate results output from the input layer 30 are input. The ReLU function unit 34b applies the ReLU function to the 100 multiply-accumulate results output from the first FC layer 36.
[0161] The output layer 32 includes a second FC layer 37 (FC2) and a SoftMax unit 38. The second FC layer 37 is provided with 10 analog circuits 3. To each of the analog circuits 3, 100 multiply-accumulate results output from the intermediate layer 31 are input. The SoftMax unit 38 converts 10 multiply-accumulate results output from the second FC layer 37 into values for output (probabilistic values, etc.) using a predetermined conversion function (SoftMax function, etc.). The 10 results output from the SoftMax unit 38 are the output results (e.g., the result of recognizing 10 numbers) of the arithmetic logic unit 100.
[0162]
[0163] In
[0164] In this case, the total sum Σ|w.sub.i| of the weight value w.sub.i is equal to the total number of the weight value w.sub.i to be set, i.e., the number of inputs. Thus, β.sub.0 in the analog circuit 3 is the number obtained by adding the bias term b to the number of inputs. Regarding each bias term b as 1, for example, β.sub.0.sup.(1)=25+1=26 in the analog circuit 3a included in the convolution layer 33. Further, β.sub.0.sup.(2)=4,320+1=4,321 in the analog circuit 3b included in the first FC layer 36. Further, β.sub.0.sup.(3)=100+1=101 in the analog circuit 3c included in the second FC layer 37.
[0165] For example, in the input layer 30, the analog circuit 3a outputs (t.sub.υ.sup.(1)+, t.sub.υ.sup.(1)−). The difference value (t.sub.υ.sup.(1)−−t.sub.υ.sup.(1)+)/T.sub.in of this output is the value obtained by multiplying the original multiply-accumulate result (y.sup.(1)) by 1/26. The output of the analog circuit 3a is input to the analog circuit 3b of the intermediate layer 31 as it is via the ReLU function unit 34a and the pooling unit 35.
[0166] In the intermediate layer 31, the analog circuit 3b outputs (t.sub.υ.sup.(2)+, t.sub.υ.sup.(2)−) on the basis of the operation result obtained by being multiplied by 1/26. The difference value (t.sub.υ.sup.(2)−−t.sub.υ.sup.(2)+)/T.sub.in of this output is the value obtained by multiplying the original multiply-accumulate result (y.sup.(2)) by 1/(26×4,321). The output of the analog circuit 3b is input to the analog circuit 3d of the output layer 32 via the ReLU function unit 34b.
[0167] In the output layer 32, the analog circuit 3d outputs (t.sub.υ.sup.(3)+, t.sub.υ.sup.(3)−) on the basis of the operation result obtained by being multiplied by 1/(26×4,321). The difference value (t.sub.υ.sup.(3)−−t.sub.υ.sup.(3)+)/T.sub.in of this output is the value obtained by multiplying the original multiply-accumulate result (y.sup.(3)) by 1/(26×4,321×101). The output of the analog circuit 3c is input to the SoftMax unit 38, and the operation result of the arithmetic logic unit 100 is output.
[0168]
[0169] The arithmetic logic unit 100 is capable of comparing the magnitude of the multiply-accumulate result, or the like by detecting, for example, the difference value (t.sub.υ.sup.(n)−−t.sub.υ.sup.(n)+) output from each of the analog circuits 3. Therefore, it can be said that the smaller the width of the distribution of the difference value, the more difficult it is to compare the individual multiply-accumulate result, for example.
[0170] As shown in
[0171]
[0172] Further, in
[0173] In the example shown in
[0174] Meanwhile, in the case where the analog circuits 3 are connected in series and a time-axis analog multiply-accumulate operation is performed, an operation result is reduced by the action of 1/β.sub.0 when an electrical signal passes through the analog circuit 3. As a result, it is difficult to detect the final operation result in some cases.
Setting of Weight Value
[0175] In the present disclosure, the value of the weight value w.sub.i set for each of the analog circuits 3 (the synapse circuit 8) is limited to fall within a predetermined value range. Here, the predetermined value range is, for example, a range of possible values of the weight value w.sub.i set in advance. That is, it can be said that the weight value w.sub.i whose value is limited in advance is set for each of the analog circuits 3. By performing a time-axis analog multiply-accumulate operation using the weight value w.sub.i with the limited value range, a multiply-accumulate operation method according to this embodiment is executed.
[0176] Further, the predetermined value range includes a plurality of limit values. That is, the possible values of the weight value w.sub.i are limited by discrete limit values. Therefore, the weight value w.sub.i is set to one of the plurality of limit values. By limiting the weight value w.sub.i discretely in this way, it is possible to reduce, for example, the above-mentioned β.sub.0 or the like.
[0177]
[0178] First, a pre-quantization weight v.sub.i is calculated using a computer or the like (Step101). For example, a computer model such as a neural network implemented in the arithmetic logic unit 100 is constructed. In the computer model, nodes corresponding to the analog circuits 3 included in the arithmetic logic unit 100 are provided. Further, a weight corresponding to the weight value w.sub.i of the synapse circuit 8 is set for each node.
[0179] By appropriately learning the computer model, a weight (strength of synaptic connection) corresponding to the target processing is calculated. That is, the same number of weights as the number of the weight values w.sub.i used in the arithmetic logic unit 100 are calculated. Note that the computer model is configured such that, for example, each weight is calculated as a value using a floating point representation. The weight (i.e., a weight that is not quantized by positive values) represented by this floating point representation is used as the pre-quantization weight v.sub.i.
[0180] The pre-quantization weight v.sub.i is represented by an arbitrary real number including positive and negative ones, for example. Further, for example, the pre-quantization weight v.sub.i may be calculated within a predetermined range such as −α≤v.sub.i≤+α. Alternatively, the pre-quantization weight v may be calculated in a normalized range such as −1≤v.sub.i≤+1. In addition, the method of calculating the pre-quantization weight v.sub.i is not limited. In this embodiment, the pre-quantization weight v.sub.i corresponds to the value to be the weight value.
[0181] The weight limitation processing of setting the weight value w.sub.i on the basis of the absolute value of the pre-quantization weight v.sub.i is executed (Step102). In this embodiment, the absolute value of the pre-quantization weight v.sub.i corresponds to the first value that is the absolute value of the value to be the weight value. Further, the weight limitation processing corresponds to the first processing.
[0182] In
[0183] The weight limitation processing is executed on N pre-quantization weights v.sub.i (weight values w.sub.i) set for one analog circuit 3. That is, the processing of setting the weight value w.sub.i to zero at the first ratio in order from the smallest absolute value of the pre-quantization weight v.sub.i is executed, the weight value w.sub.i being set for each of the plurality of synapse circuits 8 included in the analog circuit 3. Note that the first ratio is appropriately set in accordance with the processing accuracy or the like necessary for the arithmetic logic unit 100.
[0184] In the weight limitation processing, for example, the absolute values of N pre-quantization weights v.sub.i are calculated, and the pre-quantization weights v.sub.i whose number corresponds to the first ratio are substituted with zero in order from the smallest absolute value. For example, in the case where the first ratio is set to 1/2, the N/2 pre-quantization weights v.sub.i are set to zero from the smallest absolute value. In this case, the N/2 pre-quantization weights v.sub.i having large absolute values are maintained at the values at the time of calculation. Further, for example, in the case where the first ratio is set to 3/4, the N×3/4 pre-quantization weights v.sub.i are set to zero from the smallest absolute value. In this case, the N/4 pre-quantization weights v.sub.i having large absolute values are maintained at the values at the time of calculation.
[0185] The processing of binarizing the pre-quantization weight v.sub.i is executed, and the weight value w.sub.i is calculated (Step103). The binarization processing is processing of calculating two values on the basis of, for example, the value of the pre-quantization weight v.sub.i. In this embodiment, the positive limit value and negative limit value having equal absolute values are calculated by the binarization processing. These positive and negative limit values are set as the weight value w.sub.i.
[0186] In this embodiment, for example, binarization processing of setting one of −1 (negative limit value) and +1 (positive limit value) as the corresponding weight value w.sub.i is executed in accordance with the sign of the pre-quantization weight v.sub.i. Note that zero is calculated as the corresponding weight value w.sub.i for the pre-quantization weight v.sub.i whose value is zero.
[0187] For example, in the case where the pre-quantization weight v.sub.i is negative (v.sub.i<0), −1 is set as the corresponding weight value w.sub.i. Further, in the case where the pre-quantization weight v.sub.i is positive (v.sub.i>0), +1 is set as the corresponding weight value w.sub.i. Each of the calculated weight values w.sub.i is recorded as weight value data.
[0188] The weight value w.sub.i is set for the analog circuit 3 (each of the synapse circuits 8) on the basis of the weight value data (Step104). For example, using a wire or the like for setting the weight value w.sub.i provided in the analog circuit 3, the weight value w.sub.i stored in the weight value data is set for each of the synapse circuits 8. Further, for example, the analog circuit 3 or the like designed on the basis of the calculated weight value w.sub.i may be used. In addition, the method of setting the weight value w.sub.i for the analog circuit 3, and the like are not limited.
[0189] Thus, in the processing shown in
[0190]
[0191] Hereinafter, the operation of the analog circuit 3b using the weight value w.sub.i that has been made sparse will be described. Further, in the example shown in
[0192] As described above, the analog circuit 3b included in the first FC layer 36 is a 4,320-input circuit. That is, 4,320 weight values w.sub.i are set for the analog circuit 3. Therefore, in the processing shown in
[0193] For example, in the case where the ratio of setting the weight value w.sub.i to zero, i.e., the first ratio is 1/2(50%), the 4,320/2=2,160 weight values w.sub.i are set to zero. Further, 2,160 weight values w.sub.i are set to ±1. Therefore, β.sub.0.sup.(2) in the analog circuit 3b satisfies the relationship of β.sub.0.sup.(2)=4,320/2+1=2,161. Therefore, the difference value (t.sub.υ.sup.(2)−−t.sub.υ.sup.(2)+)/T.sub.in of the output (t.sub.υ.sup.(2)+, t.sub.υ.sup.(2)−) of the analog circuit 3b is a value obtained by multiplying the original multiply-accumulate result (y.sup.(2)) by 1/(26×2,161).
[0194] Further, in the case where the first ratio is 3/4 (75%), 4,320×3/4=3,240 weight values w.sub.i are set to zero. Further, 1,080 weight values w.sub.i are set to ±1. Therefore, β.sub.0.sup.(2) in the analog circuit 3b satisfies the relationship of β.sub.0.sup.(2)=4,320/4+1=1,081. Therefore, the difference value (t.sub.υ.sup.(2)−−t.sub.υ.sup.(2)+)/T.sub.in of the output (t.sub.υ.sup.(2)+, t.sub.υ.sup.(2)−) of the analog circuit 3b is a value obtained by multiplying the original multiply-accumulate result (y.sup.(2)) by 1/(26×1,081).
[0195] Thus, by performing sparse processing of setting the weight value w.sub.i to zero at the first ratio (50% or 75%), the value of β.sub.0.sup.(2) is reduced. As a result, the value representing the multiply-accumulate result output from the analog circuit 3b, i.e., the difference value (t.sub.υ.sup.(1)−−t.sub.υ.sup.(1)+)/T.sub.in of the output can be increased as compared with the case without performing sparse processing. By making the weight sparse, the individual output difference value increases, which expands the distribution of the difference values. This alleviates the problem of being difficult to compare the multiply-accumulate result described with reference to
[0196]
[0197] The white data points represent a graph in the case where the first ratio is set to 50%, and the gray data points represent a graph in the case where the first ratio is set to 75%. Further, in
[0198] For example, the distribution widths ±3σ of the difference value of the convolution layer 33 (Conv1) disposed in the first stage are substantially the same values between the three graphs. The distribution width of the difference value of the first FC layer 36 (FC1) disposed in the second stage increases as the first ratio increases. That is, the more the weight value w.sub.i of zero is set, the value of the second stage increases. Further, the distribution width of the difference value of the second FC layer 37 (FC2) disposed in the third stage increases as the first ratio increases, similarly to the result of the second stage.
[0199] Thus, by making the weight value w.sub.i of the intermediate analog circuit 3b sparse, it is possible to increase the operation result output from the analog circuit 3c in the subsequent stage. As a result, for example, it is possible to detect the final operation result with high accuracy, and appropriately execute, for example, the recognition processing by the arithmetic logic unit 100.
[0200]
[0201] In
[0202] In the case where the weight value w.sub.i is randomly set to zero (patterns A and B), the standard deviation σ of the difference value (t.sub.υ.sup.−−t.sub.υ.sup.+) is substantially unchanged. Thus, in the method of randomly thinning the weight value w.sub.i, the distribution of the difference value is not expanded enough, and the operation result is not so much expected to increase.
[0203] Further, the standard deviation σ of the difference value is 1.67 times in the case where 50% from the smallest absolute value are set to zero (pattern C), and the standard deviation o of the difference value is 2.41 times in the case where 75% are set to zero (pattern D). Thus, by limiting the weight value w.sub.i with reference to the absolute value of the pre-quantization weight v.sub.i, the distribution of the difference value can be sufficiently enlarged, and the operation result can be effectively increased.
[0204]
[0205] The change rate of the standard deviation of the difference value in each of the patterns is normalized using the change rate of the standard deviation of the multiply-accumulate result y. The normalized change rate of the standard deviation of the difference value was 2.06 (to 2) in the pattern C and 3.95 (to 4) in the pattern D. Thus, the normalized change rate matches the ratio of the weight value wi that has been made sparse (the first ratio).
[0206] In the following, another method of making the weight value w.sub.i sparse, i.e., limiting the value range of the weight value w.sub.i values, will be described.
[0207] As described in Step102 of
[0208] For example, as the weight limitation processing, the processing of setting the weight value w.sub.i to zero is executed when the absolute value of the pre-quantization weight v.sub.i is a first threshold value d or less. As a result, it is possible to directly evaluate the magnitude of the pre-quantization weight v.sub.i.
[0209] The first threshold value d is set with reference to, for example, the average value ave=(Σ|v.sub.i|)/N of the absolute values of the pre-quantization weights v.sub.i. Here, N represents the number of the pre-quantization weights v.sub.i and Σ represents the total sum of the absolute values of the N pre-quantization weights v.sub.i. For example, in the case where 70% of the average value ave of the absolute values is set as the first threshold value d, the first threshold value d is expressed as d=0.7×(Σ|v.sub.i|)/N. It goes without saying that the first threshold value d may be calculated using another ratio, such as 80% and 40% of ave.
[0210] In the weight setting processing, threshold determination is performed on the basis of the first threshold value d, and zero is calculated as the weight value w.sub.i corresponding to the pre-quantization weight v.sub.i having an absolute value smaller than the first threshold value d. Further, ±1 are calculated in accordance with the sign of the pre-quantization weight v.sub.i as the weight value w.sub.i corresponding to the pre-quantization weight v.sub.i having an absolute value larger than the first threshold value d. That is, the weight value w.sub.i is calculated using the following formula.
[0211] This makes it possible to set the weight value w.sub.i having a sufficiently small pre-quantization weight v.sub.i to zero, and thin the weight value w.sub.i with less impact on the operation. The calculated weight value w.sub.i is recorded as the weight value data 39 and set for the analog circuit 3 (individual synapse circuit).
[0212]
[0213] In the case where the first threshold value d is set to 70% of ave, approximately 70% of the weight values w.sub.i are set to 0. Further, the remaining 30% of the weight values w.sub.i are set to ±1. Thus, by the sparse processing of setting 70% of the weight values w.sub.i to zero, approximately 70% of components of the sum of the multiplication values w.sub.i.Math.x.sub.i of the input values x.sub.i and the weight values w.sub.i are reduced. As a result, a multiply-accumulate result corresponding to substantially 30 inputs is output from, for example, a 100-input analog circuit 3.
[0214]
[0215] In the case where the input value x.sub.i is a value (2.sup.K) with predetermined bit precision K, assumption is made that 2.sup.L weight values w.sub.i, which are not zero, are set for the analog circuit 3, and the absolute value is set to 1, for example. In this case, there is a possibility that the output value y of the size of 2.sup.K×2.sup.L is output from the analog circuit 3 that performs a time-axis analog multiply-accumulate operation. That is, in order to accurately express the output value y, precision equivalent to K+L bits is necessary.
[0216] Meanwhile, assumption is made that the temporal resolution that can be expressed by the pulse timing (or pulse width) in the input period T is K bits. In this case, in order to obtain the temporal resolution corresponding to K+L bits in an output period T′, the necessary length of the output period T′ is 2.sup.L times the input period T. For example, in the case where there are approximately 100 weight values w.sub.i, which are not zero, L≈7, the output period T′ satisfies the relationship of T′=T×2.sup.L≈100T, and there is a possibility that the output period T′ is significantly longer.
[0217] In another aspect, in the case where the output period T′ having the same length as the input period T is set (T=T′), the temporal resolution for accurately representing the output value y output from the analog circuit 3 needs to be 1/100 of the temporal resolution of the input period T, and there is a possibility that the detection accuracy is lowered.
[0218] For example, assumption is made that an electrical signal represented by the input value x.sub.i with an information amount of 8 bits (2.sup.8) is input to the 100-input analog circuit 3. At this time, in the case where the weight values w.sub.i of the analog circuit 3 are all −1 or +1, the multiply-accumulate result (output value y) by the analog circuit 3 is approximately 15 bits. In this case, as shown in the upper side of
[0219] Meanwhile, for example, in the case where sparse processing of limiting 70% of the weight values w.sub.i to 0 is performed as shown in
[0220] As described above, by making 70% of the weight values w.sub.i sparse, the length of time that can be used for, for example, expressing the unit output (output with a value of 1) is approximately four times. That is, the output ratio due to the sparse processing is increased to approximately four times. As a result, it is possible to detect a multiply-accumulate result with sufficiently high accuracy. As a result, it is possible to appropriately execute various types of processing using a time-axis analog multiply-accumulate operation.
[0221] As described above, in the arithmetic logic unit 100 according to this embodiment, an electrical signal corresponding to the input value x.sub.i is input from the plurality of input signal lines 6, and charges corresponding to the multiplication value of the input value x.sub.i and the weight value w.sub.i are generated on the basis of the electrical signal. The generated charges are accumulated and a multiply-accumulate signal representing the sum of multiplication values is output. At this time, the value of the weight value w.sub.i is limited. By limiting the weight value w.sub.i, for example, it is possible to adjust the sum of multiplication values. As a result, it is possible to detect an operation result with high accuracy in the circuit of the analog system performing a multiply-accumulate operation.
Second Embodiment
[0222] An arithmetic logic unit 200 according to the present technology will be described. In the following description, description of the configurations and effects similar to those in the arithmetic logic unit 100 described in the above-mentioned embodiment will be omitted or simplified.
[0223] In this embodiment, possible values of the signal value (input value) of the electrical signal input to each of the signal lines 1 are limited when a time-axis analog multiply-accumulate operation is performed. Thus, the value of the signal value is limited to fall within a predetermined value range.
[0224]
[0225] The signal limiting circuit 204 is a circuit that limits the value range of the signal value. The signal limiting circuit 204 is provided on, for example, a signal line (the positive and negative input signal lines 6a and 6b/the positive and negative output signal lines 10a and 10b) connecting the analog circuits 203 in the preceding stage and the subsequent stage. The value of the signal value transmitted in this signal line 1 is limited by the signal limiting circuit 204.
[0226] In the example shown in
[0227] As shown in
[0228] Further, the signal output from the signal limiting circuit 204 is input to the analog circuit 203 in a subsequent stage. Therefore, when viewed from the analog circuit 203 in the subsequent stage, the signal output from the signal limiting circuit 204 is the input signal, and the value represented by the input signal is the input value. That is, the signal limiting circuit 204 is a circuit that limits the input value input to the analog circuit 203 in the subsequent stage.
[0229] Hereinafter, the signal output from the signal limiting circuit 204 will be referred to as the subsequent-stage input signal, and the value represented by the subsequent-stage input signal will be referred to as the subsequent-stage input value x.sub.j Therefore, it can be said that the multiply-accumulate result s.sub.j input to the signal limiting circuit 204 is the value to be the subsequent-stage input value x.sub.j. In this embodiment, the subsequent-stage input value x.sub.j is an example of the input value. Further, the signal limiting circuit 204 corresponds to the control unit.
[0230] The signal limiting circuit 204 executes the signal limitation processing of setting the subsequent-stage input value x.sub.j on the basis of the absolute value of the multiply-accumulate result s.sub.j. As described above, the multiply-accumulate result s.sub.j is represented using a pair of positive and negative multiply-accumulate signals. In the signal limitation processing, the absolute value of the multiply-accumulate result s.sub.j is referred to from the positive and negative multiply-accumulate signals, and the value of the subsequent-stage input value x.sub.j is set on the basis of the absolute value thereof.
[0231] As described above, the signal limiting circuit 204 executes the signal limitation processing on the basis of the multiply-accumulate signal output from the output unit of the neuron circuit 209. In this embodiment, the absolute value of the multiply-accumulate result s.sub.j (the absolute value of the sum of multiplication values) corresponds to the second value, and the signal limitation processing corresponds to the second processing.
[0232] As an example of the signal limitation processing, processing of setting the subsequent-stage input values x.sub.j having the number defined by the second ratio to zero is executed in order from the smallest absolute value of the multiply-accumulate result s.sub.j, of the multiply-accumulate results s.sub.j output from M analog circuits 203. That is, of the M subsequent-stage input values x.sub.j, those having smaller absolute values of the original values (multiply-accumulate result s.sub.j) are set to zero at the second ratio (e.g., 70% or 50%). As a result, it is possible to make the subsequent-stage input value x.sub.j having a smaller number sparse.
[0233] Note that the M subsequent-stage input signals (subsequent-stage input values x.sub.j) are input to each of the plurality of synapse circuits 208 provided in the analog circuit 203 in the subsequent stage. Therefore, it can be also said that the above-mentioned signal limitation processing is processing of setting the subsequent-stage input value x.sub.j at the second ratio in order from the smallest absolute value of the multiply-accumulate result s.sub.j to zero, the subsequent-stage input value x.sub.j being represented by the subsequent-stage input signal input to each of the plurality of synapse circuits 208.
[0234] In the signal limiting circuit 204, for example, the difference value |t.sub.υ.sup.−−t.sub.υ.sup.+| of the timing represented by the positive and negative multiply-accumulate signals is calculated as the absolute value of the multiply-accumulate result s.sub.j. Specifically, a pulse signal (electrical signal) or the like of the TACT system representing the difference value by a pulse timing or the like is generated.
[0235] The timings of the pulse signals generated by the respective signal limiting circuits 204 are compared to each other, and pulse signals having the number corresponding to the second ratio are set to zero in order from the smallest difference value. For example, the wire of the target pulse signal is switched to OFF. Alternatively, a signal representing zero is output instead. As a result, it is possible to set the subsequent-stage input value x.sub.j to zero at the second ratio.
[0236] Note that the signal limiting circuit 204 is appropriately configured by using, for example, a logical circuit that calculates the above-mentioned difference value, a counter circuit that compares and counts timings, a switch circuit that switches ON/OFF of the wire, and the like. The specific configuration of the signal limiting circuit 204 is not limited.
[0237] Further, the processing of setting the subsequent-stage input value x.sub.j to zero when the absolute value of the multiply-accumulate result s.sub.j is a second threshold value d or less may be executed as another example of the signal limitation processing. For example, the signal limiting circuit 204 generates a pulse signal that represents the difference value |t.sub.υ.sup.−−t.sub.υ.sup.+| (absolute value of the multiply-accumulate result s.sub.j) of the timing, and threshold value processing using the second threshold value d is executed on the pulse timing. As a result, for example, in the case where it is determined that the difference value is the threshold value or less, the wire of the pulse signal is switched to OFF. For example, such processing is performed.
[0238] Thus, by appropriately configuring the signal limiting circuit 204, it is possible to implement desired signal limitation processing. As a result, it is possible to appropriately make the subsequent-stage input value x.sub.j input from the intermediate layer to the upper layer or the like in the subsequent stage sparse.
[0239] Note that as the subsequent-stage input value x.sub.j that is not set to zero, for example, the multiply-accumulate result s.sub.j is used as it is. That is, the positive and negative multiply-accumulate signals are output as the subsequent-stage input signals as they are. Alternatively, the subsequent-stage input value x.sub.j may be binarized to ±1 depending on the positive or negative sign of the multiply-accumulate result s.sub.j. These subsequent-stage input values x.sub.j are substantial input values to the analog circuit 203 included in the upper layer.
[0240] As described above, the number of inputs is substantially reduced in the analog circuit 203 included in the upper layer. That is, since the number of input values that are zero is increased among the multiplication values of the input values and weight values, the number of multiplication values that are zero increases (see (Math. 1), etc.). As a result, it is possible to reduce the multiply-accumulate result calculated by the respective analog circuits 203 in the upper layer.
[0241] As a result, it is possible to improve the accuracy for expressing the multiply-accumulate result.
[0242] Alternatively, it is possible to increase the magnitude of the difference value corresponding to the multiply-accumulate result. As a result, it is possible to detect an operation result or the like by the arithmetic logic unit 200 with high accuracy. As a result, it is possible to appropriately execute various types of processing using a time-axis analog multiply-accumulate operation.
Other Embodiments
[0243] The present technology is not limited to the embodiments described above, and various other embodiments can be realized.
[0244] In the above, the arithmetic logic unit 100 for which a weight value having a limited value range and the arithmetic logic unit 200 in which an input value having a limited value range is used has been described. The present technology is not limited thereto. An arithmetic logic unit for which a weight value having a limited value range is set and in which an input value having a limited value range is used may be configured. That is, both the weight value and the input value may be made sparse.
[0245] For example, both the weight value and the input value can be made sparse by setting a weight value or the like having a limited value range for the arithmetic logic unit 200 described with reference to
[0246] In the above, the value ranges of the weight value and the input value have been limited using a plurality of limit values (±1, 0, and the like). The present technology is not limited thereto. For example, the value ranges of the weight value and the input value may be appropriately set so that the multiply-accumulate result calculated by the analog circuit is made small.
[0247] Five values, such as −1, −0.5, 0, +0.5, and +1, may be used as the plurality of limit values. For example, determination processing of setting the input value and the weight value to the respective limit values on the basis of the magnitude of the value that is the basis of the input value and the weight value may be executed. By setting the value ranges of the input value and the weight value in detail in this manner, it is possible to improve the processing accuracy by the arithmetic logic unit. It goes without saying that non-normalized discrete values such as ±3, ±2, ±1, and 0 may be used as the limit values. In addition, the method of setting the limit value is not limited.
[0248] Further, for example, the values of the weight value and the input value may be limited to fall within a predetermined range. For example, with reference to the absolute value of the value (pre-quantization weight or multiply-accumulate result) that is the basis of the weight value and the input value, processing of limiting the value having a smaller original value to fall within the range of −0.1 to +0.1 may be executed. As described above, even in the case where the weight value and the input value are limited to the consecutive value ranges, it is possible to reduce the multiply-accumulate result and the like, and improve the detection accuracy. For example, such processing may be executed.
[0249] In the above-mentioned embodiment, a time-axis analog multiply-accumulate operation using an electrical signal of the TACT system has been described. The system of the electrical signal is not limited. For example, an electrical signal of an arbitrary system capable of executing a time-axis analog multiply-accumulate operation may be used.
[0250] For example, an electrical signal of a pulse width modulation system (PWM) may be used as an electrical signal. The electrical signal of the PWM system is a signal representing the input value using a pulse width. Further, the pulse width of the electrical signal is typically set to fall within a predetermined input period. Thus, the accuracy of the input value represented by the electrical signal decreases with the increase in the input value. For example, even in the case where an electrical signal of a PWM system is used, the multiply-accumulate result and the like can be reduced by the making the above-mentioned weight value and input value sparse. As a result, it is possible to detect an operation result with high accuracy.
[0251] The configurations of the arithmetic logic unit, analog circuit, synapse circuit, neuron circuit, and the like, the method of limiting the weight value and input value, and the like described with reference to the drawings are merely one embodiment, and can be arbitrarily modified without departing from the essence of the present technology. That is, any other arbitrary configuration, method, and the like for carrying out the present technology may be employed.
[0252] A circuit that makes the weight value sparse (hereinafter, referred to as a weight limiting circuit) may be provided. The weight limiting circuit limits the value of the weight value set for the respective synapse circuits (multiplication units) of the analog circuit (multiply-accumulate operation device). The sparse processing by the weight limiting circuit is typically executed on a plurality of synapse circuits included in one analog circuit. The weight limiting circuit executes processing of limiting, for example, a plurality of pre-quantization weights v.sub.i calculated corresponding to the respective synapse circuits so as to be the weight values w.sub.i included in a predetermined value range.
[0253] For example, the weight limiting circuit calculates the absolute value of the input pre-quantization weight v.sub.i, selects a predetermined number of weights in order from the smallest absolute value, and substitutes zero to the quantized weight value w.sub.i of the selected weight for outputting. Alternatively, the weight limiting circuit calculates the absolute value of the input pre-quantization weight v.sub.i, and substitutes zero to the quantized weight value w.sub.i of the weight having an absolute value smaller than the threshold value d for outputting. The weight value w.sub.i output from the weight limiting circuit is set for the respective synapse circuits.
[0254] The specific configuration of the weight limiting circuit is not limited, and can be realized by, for example, appropriately combining a comparator, a logic element, a storage element, and the like. Further, the weight limiting circuit may be provided for each analog circuit, or may be configured as a common circuit for a plurality of analog circuits. In any case, as the weight limiting circuit, a circuit that makes the input weight (pre-quantization weight vi) sparse and is capable of setting the obtained weight for each of the synapse circuits is used.
[0255] Further, in
[0256] Further, as described with reference to
[0257] As described above, a value of at least one of the input value or the weight value is limited by the signal limiting circuit or the weight limiting circuit (limitation processing unit) via the network circuit. Thus, for example, by using the signal limiting circuit, the input value that has been made sparse is used in the actual operation even in the case where the input value that is not made sparse is input. Alternatively, by using the weight limiting circuit, a weight value that is appropriately made sparse can be set even in the case where the weight that has not been made sparse in advance is input. As a result, it is possible to realize an arithmetic logic unit with high accuracy of detecting an operation result and high versatility.
[0258] In the present disclosure, “same”, “equal”, “perpendicular”, and the like are concepts including “substantially the same”, “substantially equal”, “substantially perpendicular”, and the like. For example, the states included in a predetermined range (e.g., ±10%) with reference to “completely the same”, “completely equal”, “completely perpendicular”, and the like are also included.
[0259] Out of the feature parts according to the present technology described above, at least two feature parts can be combined. That is, the various feature parts described in the respective embodiments may be arbitrarily combined without distinguishing from each other in the respective embodiments. It should be noted that the effects described above are merely illustrative and are not, and may have an additive effect.
[0260] It should be noted that the present technology may also take the following configurations. [0261] (1) An arithmetic logic unit, including:
[0262] a plurality of input lines, pulse signals corresponding to input values being input to the plurality of input lines; and
[0263] a multiply-accumulate operation device that includes
[0264] a plurality of multiplication units that generates, on a basis of the pulse signals input to each of the plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values, and
[0265] an output unit that outputs a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values generated by each of the plurality of multiplication units, in which
[0266] a value of at least one of the input value or the weight value is limited. [0267] (2) The arithmetic logic unit according to (1), in which
[0268] the value of the at least one of the input value or the weight value is limited to fall within a predetermined value range. [0269] (3) The arithmetic logic unit according to (2), in which
[0270] the predetermined value range includes a plurality of limit values, and
[0271] the value of the at least one of the input value or the weight value is set to one of the plurality of limit values. [0272] (4) The arithmetic logic unit according to (3), in which
[0273] the plurality of limit values includes zero. [0274] (5) The arithmetic logic unit according to (3) or (4), in which
[0275] the plurality of limit values includes a positive limit value and a negative limit value that have absolute values equal to each other. [0276] (6) The arithmetic logic unit according to any one of (1) to (5), in which
[0277] the weight value is limited by first processing of setting the weight value on a basis of a first value that is an absolute value of a value to be the weight value. [0278] (7) The arithmetic logic unit according to (6), in which
[0279] the first processing is processing of setting, where the first value is a first threshold value or less, the weight value to zero. [0280] (8) The arithmetic logic unit according to (6), in which
[0281] the first processing is processing of setting the weight value to zero at a first ratio in order from the smallest first value, the weight value being set for each of the plurality of multiplication units. [0282] (9) The arithmetic logic unit according to any one of (1) to (8), in which
[0283] the input value is limited by second processing of setting the input value on a basis of a second value that is an absolute value of a value to be the input value. [0284] (10) The arithmetic logic unit according to (9), in which
[0285] the second processing is processing of setting, where the second value is a second threshold value or less, the input value to zero. [0286] (11) The arithmetic logic unit according to (9), in which
[0287] the second processing is processing of setting the input value to zero at a second ratio in order from the smallest second value, the input value being represented by the pulse signal input to each of the plurality of multiplication units. [0288] (12) The arithmetic logic unit according to any one of (9) to (11), further including
[0289] a limiting unit that executes, using an absolute value of the sum of the multiplication values represented by the multiply-accumulate signal as the second value, the second limitation processing on a basis of the multiply-accumulate signal. [0290] (13) The arithmetic logic unit according to any one of (1) to (12), in which
[0291] the pulse signal is input to each of the plurality of input lines within a predetermined input period, and
[0292] the output unit outputs a multiply-accumulate signal representing the sum of the multiplication values within a predetermined output period. [0293] (14) The arithmetic logic unit according to any one of (1) to (13), in which
[0294] the input value is a value represented by a first input value and a second input value, and
[0295] the plurality of input lines includes a plurality of pairs of the input lines, each of the pairs including a first input line and a second input line, a first pulse signal representing the first input value being input to the first input line, a second pulse signal representing the second input value being input to the second input line. [0296] (15) The arithmetic logic unit according to any one of (1) to (14), in which
[0297] the pulse signal is a signal representing the input value using at least one of timing of a pulse or a pulse width. [0298] (16) A multiply-accumulate operation device, including:
[0299] a plurality of multiplication units that generates, on a basis of the pulse signals input to each of a plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values; and
[0300] an output unit that outputs a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values generated by each of the plurality of multiplication units, in which
[0301] a value of at least one of the input value or the weight value is limited. [0302] (17) A multiply-accumulate operation system, including:
[0303] a plurality of input lines, pulse signals corresponding to input values being input to the plurality of input lines;
[0304] a plurality of multiply-accumulate operation devices that includes
[0305] a plurality of multiplication units that generates, on a basis of the pulse signals input to each of the plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values, and
[0306] an output unit that outputs a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values generated by each of the plurality of multiplication units; and
[0307] a network circuit configured by connecting the plurality of multiply-accumulate operation devices, in which
[0308] a value of at least one of the input value or the weight value is limited. [0309] (18) A multiply-accumulate operation method, including:
[0310] inputting pulse signals corresponding to input values to a plurality of input lines;
[0311] generating, on a basis of the pulse signals input to each of the plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values;
[0312] outputting a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values; and
[0313] limiting a value of at least one of the input value or the weight value. [0314] (19) An arithmetic logic unit, including:
[0315] a plurality of input lines, pulse signals corresponding to input values being input to the plurality of input lines;
[0316] a multiply-accumulate operation device that includes
[0317] a plurality of multiplication units that generates, on a basis of the pulse signals input to each of the plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values, and
[0318] an output unit that outputs a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values generated by each of the plurality of multiplication units; and
[0319] a limitation processing unit that limits a value of at least one of the input value or the weight value before each of the plurality of multiplication units generates charges corresponding to the multiplication values. [0320] (20) A multiply-accumulate operation system, including:
[0321] a plurality of input lines, pulse signals corresponding to input values being input to the plurality of input lines;
[0322] a plurality of multiply-accumulate operation devices that includes
[0323] a plurality of multiplication units that generates, on a basis of the pulse signals input to each of the plurality of input lines, charges corresponding to multiplication values obtained by multiplying the input values by weight values, and
[0324] an output unit that outputs a multiply-accumulate signal representing a sum of the multiplication values by accumulating the charges corresponding to the multiplication values generated by each of the plurality of multiplication units;
[0325] a network circuit configured by connecting the plurality of multiply-accumulate operation devices; and
[0326] a limitation processing unit that limits a value of at least one of the input value or the weight value before each of the plurality of multiplication units generates charges corresponding to the multiplication values, in which
[0327] the value of the at least one of the input value or the weight value is limited by the limitation processing unit via the network circuit.
REFERENCE SIGNS LIST
[0328] 1, 1a, 1b signal line
[0329] 3, 3a to 3c, 203 analog circuit
[0330] 6, 6a, 6b input signal line
[0331] 8, 208 synapse circuit
[0332] 9, 209 neuron circuit
[0333] 10, 10a, 10b output signal line
[0334] 11 accumulation unit
[0335] 12 output unit
[0336] 39 weight value data
[0337] 100, 200 multiply-accumulate operation device
[0338] 204 signal limiting circuit