JP2020135175A - Neural network circuit - Google Patents

Neural network circuit Download PDF

Info

Publication number
JP2020135175A
JP2020135175A JP2019025269A JP2019025269A JP2020135175A JP 2020135175 A JP2020135175 A JP 2020135175A JP 2019025269 A JP2019025269 A JP 2019025269A JP 2019025269 A JP2019025269 A JP 2019025269A JP 2020135175 A JP2020135175 A JP 2020135175A
Authority
JP
Japan
Prior art keywords
input data
multiplier
sum
adder
control unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2019025269A
Other languages
Japanese (ja)
Other versions
JP7241563B2 (en
Inventor
拓 今野
Hiroshi Konno
拓 今野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2019025269A priority Critical patent/JP7241563B2/en
Publication of JP2020135175A publication Critical patent/JP2020135175A/en
Application granted granted Critical
Publication of JP7241563B2 publication Critical patent/JP7241563B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Complex Calculations (AREA)

Abstract

To provide technology that enables the composition of a neural network circuit to be changed in a shorter time than the reconfiguration function of an FPGA does.SOLUTION: A neural network circuit 20 comprises: a computation circuit 800 for performing arithmetic processing on input data and outputting output data that is the result of the arithmetic processing; and an input data control unit 200 for controlling the supply of input data to the computation circuit 800. The computation circuit 800 includes a storage unit 700 for storing a weight parameter and a selection parameter, a plurality of multipliers 300, 301 and 302, each calculating the product of input data supplied by the input data control unit 200 and the weight parameter stored by the storage unit 700, an accumulator 500 for calculating the sum of products calculated by each of the plurality of multipliers, and a selection unit 400 for feeding the sum calculated by the accumulator 500 back to the accumulator 500 in accordance with the selection parameter stored by the storage unit 700.SELECTED DRAWING: Figure 2

Description

本発明は、ニューラルネットワーク回路に関する。 The present invention relates to a neural network circuit.

ニューラルネットワークは、一般的に、積和演算回路を用いて構成される。また、ニューラルネットワークは、学習又は推論する対象(以下、学習又は推論対象)に応じて異なった構成となるため、学習又は推論対象を変更する場合には、ニューラルネットワークの構成の変更に伴って、ニューラルネットワーク回路の構成を変更する必要がある。そこで、従来では、ニューラルネットワークの学習又は推論対象を変更する際に、FPGA(field-programmable gate array)のリコンフィグレーション機能を利用し、FPGA内の論理回路を書き換える方法が用いられている(例えば、特許文献1参照)。なお、FPGAのリコンフィグレーション機能とは、FPGAに変更後の設計データを書き込むことで、例えば、FPGAが備えている複数のロジックセル間の配線の接続を変更することにより、FPGAの論理回路を書き換える機能を意味する。 Neural networks are generally constructed using a multiply-accumulate circuit. Further, since the neural network has a different configuration depending on the object to be learned or inferred (hereinafter, the object to be learned or inferred), when the object to be learned or inferred is changed, the configuration of the neural network is changed. It is necessary to change the configuration of the neural network circuit. Therefore, conventionally, when changing the learning or inference target of the neural network, a method of rewriting the logic circuit in the FPGA by using the reconfiguration function of the FPGA (field-programmable gate array) has been used (for example). , Patent Document 1). The FPGA reconfiguration function is to write the changed design data to the FPGA. For example, by changing the wiring connection between a plurality of logic cells provided in the FPGA, the logic circuit of the FPGA can be changed. It means the function to rewrite.

特開2018−132830号公報JP-A-2018-132830

従来のリコンフィグレーション機能を利用してFPGAの論理回路を書き換える手法では、FPGAのリコンフィグレーション機能を動作させるのに時間を要するため、ニューラルネットワークの学習又は推論対象を変更する際に、新たな学習又は推論対象に対応したニューラルネットワーク回路の構成を構築しなおすまでに時間を要するという問題がある。
この発明は、上記のような問題点を解決するためになされたものであり、FPGAのリコンフィグレーション機能よりも、ニューラルネットワーク回路の構成を短時間で変更することができる技術を提供することを目的とする。
In the method of rewriting the logic circuit of FPGA using the conventional reconfiguration function, it takes time to operate the reconfiguration function of FPGA, so when learning the neural network or changing the inference target, a new method is used. There is a problem that it takes time to reconstruct the configuration of the neural network circuit corresponding to the learning or inference target.
The present invention has been made to solve the above-mentioned problems, and provides a technique capable of changing the configuration of a neural network circuit in a short time rather than the reconfiguration function of FPGA. The purpose.

この発明に係るニューラルネットワーク回路は、入力データに対して演算処理を行い、当該演算処理の結果である出力データを出力する演算回路と、演算回路への入力データの供給を制御する入力データ制御部とを備え、演算回路は、重みパラメータ及び選択パラメータを格納する格納部と、それぞれが、入力データ制御部が供給した入力データと、格納部が格納する重みパラメータとの積を算出する複数の乗算器と、複数の乗算器がそれぞれ算出した積の和を算出する加算器と、格納部が格納する選択パラメータに応じて、加算器が算出した和を加算器にフィードバックする選択部と、を備えている。 The neural network circuit according to the present invention is an arithmetic circuit that performs arithmetic processing on input data and outputs output data that is the result of the arithmetic processing, and an input data control unit that controls supply of input data to the arithmetic circuit. The arithmetic circuit includes a storage unit that stores weight parameters and selection parameters, and a plurality of multiplications that calculate the product of the input data supplied by the input data control unit and the weight parameters stored in each storage unit. It is provided with a device, an adder that calculates the sum of products calculated by a plurality of multipliers, and a selection unit that feeds back the sum calculated by the adder to the adder according to the selection parameters stored in the storage unit. ing.

FPGAのリコンフィグレーション機能よりも、ニューラルネットワーク回路の構成を短時間で変更することができる。 The configuration of the neural network circuit can be changed in a shorter time than the reconfiguration function of FPGA.

実施の形態1に係るニューラルネットワーク回路を含む学習・推論システムの構成を示すブロック図である。It is a block diagram which shows the structure of the learning / inference system including the neural network circuit which concerns on Embodiment 1. FIG. 実施の形態1に係るニューラルネットワーク回路の構成を示すブロック図である。It is a block diagram which shows the structure of the neural network circuit which concerns on Embodiment 1. FIG. 実施の形態1に係るニューラルネットワーク回路による第1の演算処理方法を示すフローチャートである。It is a flowchart which shows the 1st arithmetic processing method by the neural network circuit which concerns on Embodiment 1. 実施の形態1に係るニューラルネットワーク回路の動作の第1の具体例を説明するための図である。It is a figure for demonstrating 1st specific example of operation of the neural network circuit which concerns on Embodiment 1. FIG. 実施の形態1に係るニューラルネットワーク回路による第2の演算処理方法を示すフローチャートである。It is a flowchart which shows the 2nd arithmetic processing method by the neural network circuit which concerns on Embodiment 1. 実施の形態1に係るニューラルネットワーク回路の動作の第2の具体例を説明するための図である。It is a figure for demonstrating the 2nd specific example of the operation of the neural network circuit which concerns on Embodiment 1. FIG. 実施の形態2に係るニューラルネットワーク回路の構成を示すブロック図である。It is a block diagram which shows the structure of the neural network circuit which concerns on Embodiment 2. 実施の形態2に係るニューラルネットワーク回路による演算処理方法を示すフローチャートである。It is a flowchart which shows the arithmetic processing method by the neural network circuit which concerns on Embodiment 2. 実施の形態2に係るニューラルネットワーク回路の動作の具体例を説明するための図である。It is a figure for demonstrating a specific example of operation of the neural network circuit which concerns on Embodiment 2. FIG.

以下、この発明をより詳細に説明するため、この発明を実施するための形態について、添付の図面に従って説明する。
実施の形態1.
図1は、実施の形態1に係るニューラルネットワーク回路20を含む学習・推論システム1の構成を示すブロック図である。図1が示すように、学習・推論システム1は、情報入力部10、ニューラルネットワーク回路20、制御部30、及び学習・推論結果出力部40を備えている。
Hereinafter, in order to explain the present invention in more detail, a mode for carrying out the present invention will be described with reference to the accompanying drawings.
Embodiment 1.
FIG. 1 is a block diagram showing a configuration of a learning / inference system 1 including a neural network circuit 20 according to a first embodiment. As shown in FIG. 1, the learning / inference system 1 includes an information input unit 10, a neural network circuit 20, a control unit 30, and a learning / inference result output unit 40.

情報入力部10は、ユーザによる入力により、ニューラルネットワーク回路20が学習又は推論を行う対象である入力データを取得する。情報入力部10は、入力データを、制御部30を介してニューラルネットワーク回路20に出力する。情報入力部10の例として、カメラ、マイク又はキーボード等が挙げられる。情報入力部10が入力する入力データの例として、画像データ、音声データ、又は文字列データ等が挙げられる。
ニューラルネットワーク回路20は、情報入力部10から取得した入力データを参照して、学習処理及び推論処理を行う。ニューラルネットワーク回路20は、当該学習処理及び推論処理の結果である出力データを制御部30に出力する。ニューラルネットワーク回路20の詳細な説明は後述する。
The information input unit 10 acquires input data to be learned or inferred by the neural network circuit 20 by input by the user. The information input unit 10 outputs the input data to the neural network circuit 20 via the control unit 30. Examples of the information input unit 10 include a camera, a microphone, a keyboard, and the like. Examples of the input data input by the information input unit 10 include image data, audio data, character string data, and the like.
The neural network circuit 20 performs learning processing and inference processing with reference to the input data acquired from the information input unit 10. The neural network circuit 20 outputs output data as a result of the learning process and the inference process to the control unit 30. A detailed description of the neural network circuit 20 will be described later.

制御部30は、情報入力部10から取得した入力データを参照して、学習処理及び推論処理に用いられる重みパラメータ及び選択パラメータを設定又は更新する。次に、制御部30は、当該入力データ、重みパラメータ及び選択パラメータをニューラルネットワーク回路20に出力し、ニューラルネットワーク回路20から出力データを取得する。次に、制御部30は、当該出力データを参照して、ニューラルネットワーク回路20が学習処理及び推論処理に用いた重みパラメータ及び選択パラメータを設定又は更新する。以上の工程により、制御部30は、ニューラルネットワーク回路20による学習処理及び推論処理を制御する。なお、制御部30は、ニューラルネットワーク回路20から取得した出力データを参照して、重みパラメータを更新した後に、当該出力データをニューラルネットワーク回路20に戻してもよい。その場合、ニューラルネットワーク回路20は、当該出力データを用いて、再度、学習処理及び推論処理を行ってもよい。また、制御部30は、ニューラルネットワーク回路20から取得した出力データを、学習・推論結果出力部40による出力に適した形態に変換し、変換後のデータを学習・推論結果出力部40に出力する。当該変換後のデータの例として、画像データ、音声データ又は文字データ等が挙げられる。制御部30の例として、CPUが挙げられる。
学習・推論結果出力部40は、制御部30から取得した変換後のデータを、画像、音声又は文字等の形態として出力する。学習・推論結果出力部40の例として、ディスプレイ、LED又はスピーカ等が挙げられる。
The control unit 30 sets or updates the weight parameter and the selection parameter used in the learning process and the inference process with reference to the input data acquired from the information input unit 10. Next, the control unit 30 outputs the input data, the weight parameter, and the selection parameter to the neural network circuit 20, and acquires the output data from the neural network circuit 20. Next, the control unit 30 sets or updates the weight parameter and the selection parameter used by the neural network circuit 20 for the learning process and the inference process with reference to the output data. Through the above steps, the control unit 30 controls the learning process and the inference process by the neural network circuit 20. The control unit 30 may refer to the output data acquired from the neural network circuit 20 to update the weight parameter, and then return the output data to the neural network circuit 20. In that case, the neural network circuit 20 may perform learning processing and inference processing again using the output data. Further, the control unit 30 converts the output data acquired from the neural network circuit 20 into a form suitable for output by the learning / inference result output unit 40, and outputs the converted data to the learning / inference result output unit 40. .. Examples of the converted data include image data, voice data, character data, and the like. An example of the control unit 30 is a CPU.
The learning / inference result output unit 40 outputs the converted data acquired from the control unit 30 in the form of an image, voice, characters, or the like. Examples of the learning / inference result output unit 40 include a display, an LED, a speaker, and the like.

図2は、実施の形態1に係るニューラルネットワーク回路20の構成を示すブロック図である。図2が示すように、ニューラルネットワーク回路20は、入力データ制御部200、バッファ210、第1の演算回路800、及び第1の演算回路800と同様の構成を有する第2の演算回路900を備えている。なお、実施の形態1では、ニューラルネットワーク回路20が2つの演算回路を備えている構成について説明するが、ニューラルネットワーク回路20が備える演算回路の数は、これに限定されず、1以上の任意の数であり得る。 FIG. 2 is a block diagram showing a configuration of the neural network circuit 20 according to the first embodiment. As shown in FIG. 2, the neural network circuit 20 includes an input data control unit 200, a buffer 210, a first arithmetic circuit 800, and a second arithmetic circuit 900 having the same configuration as the first arithmetic circuit 800. ing. In the first embodiment, the configuration in which the neural network circuit 20 includes two arithmetic circuits will be described, but the number of arithmetic circuits included in the neural network circuit 20 is not limited to this, and any one or more of them can be used. It can be a number.

バッファ210は、制御部30から入力データを取得し、当該入力データを一時的に蓄積する。バッファ210は、蓄積した入力データの一部又は全部を入力データ制御部200に出力する。
入力データ制御部200は、バッファ210から複数の入力データを取得し、第1の演算回路800及び第2の演算回路900への各入力データの供給を制御する。入力データ制御部200が入力データの供給を制御する方法の詳細については後述する。また、入力データ制御部200は、後述する格納部700からの重みパラメータ及び選択パラメータの出力を制御することにより、第1の演算回路800及び第2の演算回路900による各演算処理をさらに制御する。
The buffer 210 acquires input data from the control unit 30 and temporarily stores the input data. The buffer 210 outputs a part or all of the accumulated input data to the input data control unit 200.
The input data control unit 200 acquires a plurality of input data from the buffer 210 and controls the supply of each input data to the first arithmetic circuit 800 and the second arithmetic circuit 900. The details of the method in which the input data control unit 200 controls the supply of the input data will be described later. Further, the input data control unit 200 further controls each arithmetic processing by the first arithmetic circuit 800 and the second arithmetic circuit 900 by controlling the output of the weight parameter and the selection parameter from the storage unit 700, which will be described later. ..

第1の演算回路800は、乗算器300、乗算器301、乗算器302、選択部400、加算器500、出力部600、及び格納部700を備えている。なお、本実施形態では、第1の演算回路800及び第2の演算回路900が、それぞれ、3つの乗算器を備えている構成について説明する。しかし、第1の演算回路800及び第2の演算回路900は、それぞれ、複数の乗算器を備えていればよく、第1の演算回路800が備えている乗算器の数と、第2の演算回路900が備えている乗算器の数とは、異なっていてもよく、当該構成に限定されない。 The first arithmetic circuit 800 includes a multiplier 300, a multiplier 301, a multiplier 302, a selection unit 400, an adder 500, an output unit 600, and a storage unit 700. In this embodiment, the configuration in which the first arithmetic circuit 800 and the second arithmetic circuit 900 each include three multipliers will be described. However, each of the first arithmetic circuit 800 and the second arithmetic circuit 900 may include a plurality of multipliers, and the number of multipliers included in the first arithmetic circuit 800 and the second arithmetic The number of multipliers included in the circuit 900 may be different and is not limited to the configuration.

格納部700は、制御部30が出力した重みパラメータ及び選択パラメータを格納する。また、格納部700は、入力データ制御部200の命令に基づいて、格納している重みパラメータを乗算器300、乗算器301、又は乗算器302に出力する。なお、重みパラメータは、出力される乗算器毎に存在し、それらの重みパラメータは、互いに同じ値でもよく、異なる値でもよい。また、格納部700は、入力データ制御部200の命令に基づいて、格納している選択パラメータを選択部400に出力する。なお、本実施形態では、入力データ制御部200が格納部700からの重みパラメータ及び選択パラメータの出力を制御する構成について説明するが、制御部30が格納部700からの重みパラメータ及び選択パラメータの出力を制御してもよい。 The storage unit 700 stores the weight parameter and the selection parameter output by the control unit 30. Further, the storage unit 700 outputs the stored weight parameter to the multiplier 300, the multiplier 301, or the multiplier 302 based on the instruction of the input data control unit 200. Note that the weight parameters exist for each output multiplier, and the weight parameters may have the same value or different values from each other. Further, the storage unit 700 outputs the stored selection parameter to the selection unit 400 based on the instruction of the input data control unit 200. In this embodiment, the configuration in which the input data control unit 200 controls the output of the weight parameter and the selection parameter from the storage unit 700 will be described, but the control unit 30 outputs the weight parameter and the selection parameter from the storage unit 700. May be controlled.

乗算器300、乗算器301、及び乗算器302は、それぞれ、入力データ制御部200が供給した入力データと、格納部700が出力した重みパラメータとの積を算出する。乗算器300、乗算器301、及び乗算器302は、それぞれ、算出した積を加算器500に出力する。
加算器500は、乗算器300、乗算器301、及び乗算器302がそれぞれ算出した積の和を算出する。加算器500は、算出した和を、後述する選択部400の動作に応じて、選択部400又は出力部600に出力する。
The multiplier 300, the multiplier 301, and the multiplier 302 each calculate the product of the input data supplied by the input data control unit 200 and the weight parameter output by the storage unit 700. The multiplier 300, the multiplier 301, and the multiplier 302 each output the calculated product to the adder 500.
The adder 500 calculates the sum of the products calculated by the multiplier 300, the multiplier 301, and the multiplier 302, respectively. The adder 500 outputs the calculated sum to the selection unit 400 or the output unit 600 according to the operation of the selection unit 400 described later.

選択部400は、格納部700が出力した選択パラメータに応じて、加算器500が算出した和を加算器500にフィードバックする。
例えば、選択部400は、選択パラメータが、加算器500が算出した和である第1の和を加算器500にフィードバックするように指示する値である場合、当該第1の和を加算器500にフィードバックする。次に、加算器500は、選択部400がフィードバックした第1の和と、当該第1の和を算出した後に算出した和である第2の和とを加算し、当該加算結果である第3の和を、出力部600に出力する。一方で、選択部400は、選択パラメータが、当該第1の和を加算器500にフィードバックしないように指示する値である場合、0値を加算器500に出力する。その場合、加算器500は、算出した和をそのまま出力部600に出力する。つまり、加算器500の出力先は、算出した和が選択部400からフィードバックされた場合、及び、選択部400から0値を取得した場合、出力部600であり、それ以外の場合、選択部400である。
出力部600は、加算器500から取得した和を出力データとして制御部30に出力する。
The selection unit 400 feeds back the sum calculated by the adder 500 to the adder 500 according to the selection parameter output by the storage unit 700.
For example, when the selection parameter is a value instructing the adder 500 to feed back the first sum, which is the sum calculated by the adder 500, the selection unit 400 gives the first sum to the adder 500. provide feedback. Next, the adder 500 adds the first sum fed back by the selection unit 400 and the second sum calculated after calculating the first sum, and the third sum is the addition result. Is output to the output unit 600. On the other hand, when the selection parameter is a value instructing the adder 500 not to feed back the first sum, the selection unit 400 outputs a 0 value to the adder 500. In that case, the adder 500 outputs the calculated sum as it is to the output unit 600. That is, the output destination of the adder 500 is the output unit 600 when the calculated sum is fed back from the selection unit 400 and when a 0 value is acquired from the selection unit 400, and in other cases, the selection unit 400. Is.
The output unit 600 outputs the sum acquired from the adder 500 to the control unit 30 as output data.

第2の演算回路900は、乗算器310、乗算器311、乗算器312、選択部410、加算器510、出力部610、及び格納部710を備えている。乗算器310、乗算器311、乗算器312、選択部410、加算器510、出力部610、及び格納部710は、それぞれ、上述の乗算器310、乗算器311、乗算器312、選択部400、加算器500、出力部600及び格納部700と同様の機能を有している。 The second arithmetic circuit 900 includes a multiplier 310, a multiplier 311, a multiplier 312, a selection unit 410, an adder 510, an output unit 610, and a storage unit 710. The multiplier 310, the multiplier 311 and the multiplier 312, the selection unit 410, the adder 510, the output unit 610, and the storage unit 710 are the above-mentioned multiplier 310, the multiplier 311 and the multiplier 312, the selection unit 400, respectively. It has the same functions as the adder 500, the output unit 600, and the storage unit 700.

より詳細には、乗算器310は、入力データ制御部200が乗算器300に供給した入力データと同一の入力データと、乗算器300が用いた重みパラメータとは別の重みパラメータとの積を算出する。乗算器311は、入力データ制御部200が乗算器301に供給した入力データと同一の入力データと、乗算器301が用いた重みパラメータとは別の重みパラメータとの積を算出する。乗算器312は、入力データ制御部200が乗算器302に供給した入力データと同一の入力データと、乗算器302が用いた重みパラメータとは別の重みパラメータとの積を算出する。 More specifically, the multiplier 310 calculates the product of the same input data as the input data supplied by the input data control unit 200 to the multiplier 300 and a weight parameter different from the weight parameter used by the multiplier 300. To do. The multiplier 311 calculates the product of the same input data as the input data supplied by the input data control unit 200 to the multiplier 301 and a weight parameter different from the weight parameter used by the multiplier 301. The multiplier 312 calculates the product of the same input data as the input data supplied by the input data control unit 200 to the multiplier 302 and a weight parameter different from the weight parameter used by the multiplier 302.

加算器510は、乗算器310、乗算器311、及び乗算器312がそれぞれ算出した積の和を算出し、選択部410は、格納部710が出力した選択パラメータに応じて、加算器510が算出した和を加算器510にフィードバックする。出力部610は、加算器510から取得した和を出力データとして制御部30に出力する。以上の構成により、ニューラルネットワーク回路20は、第1の演算回路800が算出した出力データと、第2の演算回路900が算出した出力データとの2つの出力データを出力する。上述の通り、ニューラルネットワーク回路20が備える演算回路の数は、2つに限定されず、任意の数であり得る。そのため、本実施形態に係るニューラルネットワーク回路20は、備えている演算回路の数と同一の数の出力データを出力し得る。 The adder 510 calculates the sum of the products calculated by the multiplier 310, the multiplier 311 and the multiplier 312, respectively, and the selection unit 410 calculates the sum of the products calculated by the adder 510 according to the selection parameters output by the storage unit 710. The sum is fed back to the adder 510. The output unit 610 outputs the sum acquired from the adder 510 to the control unit 30 as output data. With the above configuration, the neural network circuit 20 outputs two output data, that is, the output data calculated by the first arithmetic circuit 800 and the output data calculated by the second arithmetic circuit 900. As described above, the number of arithmetic circuits included in the neural network circuit 20 is not limited to two and can be any number. Therefore, the neural network circuit 20 according to the present embodiment can output the same number of output data as the number of arithmetic circuits provided.

次に、実施の形態1に係るニューラルネットワーク回路20の動作について図面を参照して説明する。なお、ニューラルネットワーク回路20は、制御部30から、入力データと、重みパラメータ及び選択パラメータとを取得した時点から、当該動作を開始する。また、第1の演算回路800の動作と、第2の演算回路900の動作とは同じであるため、ニューラルネットワーク回路20が備えている演算回路の動作の説明に関しては、第1の演算回路800の動作についてのみ説明する。 Next, the operation of the neural network circuit 20 according to the first embodiment will be described with reference to the drawings. The neural network circuit 20 starts the operation from the time when the input data, the weight parameter, and the selection parameter are acquired from the control unit 30. Further, since the operation of the first arithmetic circuit 800 and the operation of the second arithmetic circuit 900 are the same, the operation of the arithmetic circuit included in the neural network circuit 20 will be described with respect to the operation of the first arithmetic circuit 800. Only the operation of is described.

まず、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数以下である場合における、ニューラルネットワーク回路20の動作について説明する。図3は、当該場合における、実施の形態1に係るニューラルネットワーク回路20による演算処理方法を示すフローチャートである。また、本願明細書において、用語「同時」は、厳密に同じ時刻でなくてもよく、実質的に同じ時刻を含むものとする。 First, when the number of input data used by the neural network circuit 20 to calculate one output data is equal to or less than the number of multipliers included in the first arithmetic circuit 800 and the second arithmetic circuit 900, respectively. , The operation of the neural network circuit 20 will be described. FIG. 3 is a flowchart showing a calculation processing method by the neural network circuit 20 according to the first embodiment in this case. Further, in the present specification, the term "simultaneous" does not have to be exactly the same time, and includes substantially the same time.

図3が示すように、入力データ制御部200は、乗算器300、乗算器301、及び乗算器302に各入力データを供給する(ステップST1)。また、入力データ制御部200は、格納部700が乗算器300、乗算器301、及び乗算器302にそれぞれ重みパラメータを出力するように格納部700に命令する。また、入力データ制御部200は、格納部700が選択部400に選択パラメータを出力するように格納部700に命令する。 As shown in FIG. 3, the input data control unit 200 supplies each input data to the multiplier 300, the multiplier 301, and the multiplier 302 (step ST1). Further, the input data control unit 200 instructs the storage unit 700 to output the weight parameters to the multiplier 300, the multiplier 301, and the multiplier 302, respectively, by the storage unit 700. Further, the input data control unit 200 instructs the storage unit 700 to output the selection parameter to the selection unit 400 by the storage unit 700.

乗算器300、乗算器301、及び乗算器302は、それぞれ、入力データ制御部200が供給した入力データと、格納部700から取得した重みパラメータとの積を算出する(ステップST2)。乗算器300、乗算器301、及び乗算器302は、算出した各積を加算器500に出力する。 The multiplier 300, the multiplier 301, and the multiplier 302 each calculate the product of the input data supplied by the input data control unit 200 and the weight parameter acquired from the storage unit 700 (step ST2). The multiplier 300, the multiplier 301, and the multiplier 302 output each calculated product to the adder 500.

加算器500は、乗算器300、乗算器301、及び乗算器302がそれぞれ算出した積の和を算出する(ステップST3)。
選択部400は、格納部700から取得した選択パラメータに基づき、加算器500に0値を出力する(ステップST4)。次に、加算器500は、ステップST3で算出した和をそのまま出力部600に出力する。
出力部600は、加算器500から取得した和を出力データとして制御部30に出力する(ステップST5)。
The adder 500 calculates the sum of the products calculated by the multiplier 300, the multiplier 301, and the multiplier 302, respectively (step ST3).
The selection unit 400 outputs a 0 value to the adder 500 based on the selection parameter acquired from the storage unit 700 (step ST4). Next, the adder 500 outputs the sum calculated in step ST3 to the output unit 600 as it is.
The output unit 600 outputs the sum acquired from the adder 500 as output data to the control unit 30 (step ST5).

次に、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数以下である場合における、ニューラルネットワーク回路20の動作の具体例について説明する。図4は、当該具体例を説明するための図である。図4では、同一の行に記載されている各ブロックは、ニューラルネットワーク回路20が備えている何れかの構成が処理する各データを示し、同一の列に記載されている各データは、ニューラルネットワーク回路20が備えている何れかの構成が同時に処理する各データを示している。なお、図4において網掛けされたブロックは、当該ブロックに対応するニューラルネットワーク回路20の構成が処理を行わないことを示しているか、又は、当該ブロックに対応するニューラルネットワーク回路20の構成が処理を行っても処理結果を別の構成に出力しないことを示す。また、以下の具体例では、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が3であり、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数が3である場合の例を説明するが、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数は、第1の演算回路800又は第2の演算回路900がそれぞれ備えている乗算器の数以下であればよく、当該例に限定されない。 Next, when the number of input data used by the neural network circuit 20 to calculate one output data is equal to or less than the number of multipliers included in the first arithmetic circuit 800 and the second arithmetic circuit 900, respectively. A specific example of the operation of the neural network circuit 20 will be described. FIG. 4 is a diagram for explaining the specific example. In FIG. 4, each block described in the same row indicates each data processed by any configuration provided in the neural network circuit 20, and each data described in the same column is a neural network. Each data that any configuration provided in the circuit 20 processes simultaneously is shown. The shaded blocks in FIG. 4 indicate that the configuration of the neural network circuit 20 corresponding to the block does not perform processing, or the configuration of the neural network circuit 20 corresponding to the block performs processing. Indicates that the processing result is not output to another configuration even if it is executed. Further, in the following specific example, the number of input data used by the neural network circuit 20 to calculate one output data is 3, and the first arithmetic circuit 800 and the second arithmetic circuit 900 are provided, respectively. An example in which the number of multipliers is three will be described, but the number of input data used by the neural network circuit 20 to calculate one output data is the first arithmetic circuit 800 or the second arithmetic circuit 900. It is not limited to this example as long as it is less than or equal to the number of multipliers provided in each.

まず、図4のAの列が示すように、入力データ制御部200は、上述のステップST1において、同時に、乗算器300に入力データD11を供給し、乗算器301に入力データD12を供給し、乗算器302に入力データD13を供給する。また、入力データ制御部200は、格納部700が乗算器300に重みパラメータM11を出力し、乗算器301に重みパラメータM12を出力し、乗算器302に重みパラメータM13を出力するように、これらの入力データの供給と同時に格納部700に命令する。そして、これらの工程の後に、乗算器300は、上述のステップST2において、入力データD11と重みパラメータM11との積を算出し、乗算器301は、入力データD12と重みパラメータM12との積を算出し、乗算器302は、入力データD13と重みパラメータM13との積を算出する。 First, as shown by the column A in FIG. 4, the input data control unit 200 simultaneously supplies the input data D11 to the multiplier 300 and the input data D12 to the multiplier 301 in the above step ST1. Input data D13 is supplied to the multiplier 302. Further, the input data control unit 200 outputs the weight parameter M11 to the multiplier 300, the weight parameter M12 to the multiplier 301, and the weight parameter M13 to the multiplier 302 so that the storage unit 700 outputs the weight parameter M11 to the multiplier 300. At the same time as supplying the input data, the storage unit 700 is instructed. Then, after these steps, the multiplier 300 calculates the product of the input data D11 and the weight parameter M11 in step ST2 described above, and the multiplier 301 calculates the product of the input data D12 and the weight parameter M12. Then, the multiplier 302 calculates the product of the input data D13 and the weight parameter M13.

次に、図4のBの列が示すように、加算器500は、上述のステップST3において、乗算器300が算出した積であるD11×M11と、乗算器301が算出した積であるD12×M12と、乗算器302が算出した積であるD13×M13との和を算出する。加算器500による当該和の算出の次に、又は、当該和の算出と並行して、選択部400は、上述のステップST4において、選択パラメータに基づき加算器500に0値を出力する。次に、加算器500は、算出した和であるD11×M11+D12×M12+D13×M13をそのまま出力部600に出力し、出力部600は、上述のステップST5において、当該和を出力データとして制御部30に出力する。
加算器500による上記工程の実行と並行して、入力データ制御部200は、上述のステップST1において、同時に、乗算器300に入力データD21を供給し、乗算器301に入力データD22を供給し、及び乗算器302に入力データD23を供給する。また、入力データ制御部200は、これらの入力データの供給と同時に、格納部700が乗算器300に重みパラメータM21を出力し、乗算器301に重みパラメータM22を出力し、乗算器302に重みパラメータM23を出力するように、格納部700に命令する。次に、乗算器300は、上述のステップST2において、入力データD21と重みパラメータM21との積を算出し、乗算器301は、入力データD22と重みパラメータM22との積を算出し、乗算器302は、入力データD23と重みパラメータM23との積を算出する。
Next, as shown in the column B of FIG. 4, the adder 500 is a product of D11 × M11 calculated by the multiplier 300 and D12 × which is the product calculated by the multiplier 301 in the above step ST3. The sum of M12 and D13 × M13, which is the product calculated by the multiplier 302, is calculated. Following the calculation of the sum by the adder 500, or in parallel with the calculation of the sum, the selection unit 400 outputs a 0 value to the adder 500 based on the selection parameter in step ST4 described above. Next, the adder 500 outputs the calculated sum D11 × M11 + D12 × M12 + D13 × M13 as it is to the output unit 600, and the output unit 600 outputs the sum to the control unit 30 as output data in the above step ST5. Output.
In parallel with the execution of the above step by the adder 500, the input data control unit 200 simultaneously supplies the input data D21 to the multiplier 300 and the input data D22 to the multiplier 301 in the step ST1 described above. And the input data D23 is supplied to the multiplier 302. Further, in the input data control unit 200, at the same time as supplying these input data, the storage unit 700 outputs the weight parameter M21 to the multiplier 300, outputs the weight parameter M22 to the multiplier 301, and outputs the weight parameter M22 to the multiplier 302. Instruct the storage unit 700 to output M23. Next, the multiplier 300 calculates the product of the input data D21 and the weight parameter M21 in step ST2 described above, and the multiplier 301 calculates the product of the input data D22 and the weight parameter M22, and the multiplier 302 Calculates the product of the input data D23 and the weight parameter M23.

次に、図4のCの列が示すように、加算器500は、上述のステップST3において、乗算器300が算出した積であるD21×M21と、乗算器301が算出した積であるD22×M22と、乗算器302が算出した積であるD23×M23との和を算出する。加算器500による当該和の算出の次に、又は当該和の算出と並行して、選択部400は、上述のステップST4において、格納部700から取得した選択パラメータに基づき、加算器500に0値を出力する。次に、加算器500は、算出した和であるD21×M21+D22×M22+D23×M23をそのまま出力部600に出力し、出力部600は、上述のステップST5において、当該和を出力データとして制御部30に出力する。
加算器500による上記工程の実行と並行して、入力データ制御部200は、上述のステップST1において、同時に、乗算器300に入力データD31を供給し、乗算器301に入力データD32を供給し、及び乗算器302に入力データD33を供給する。また、入力データ制御部200は、これらの入力データの供給と同時に、格納部700が乗算器300に重みパラメータM31を出力し、乗算器301に重みパラメータM32を出力し、乗算器302に重みパラメータM33を出力するように、格納部700に命令する。次に、乗算器300は、上述のステップST2において、入力データD31とM31との積を算出し、乗算器301は、入力データD32とM32との積を算出し、乗算器302は、入力データD33とM33との積を算出する。
Next, as shown by the column C in FIG. 4, the adder 500 is a product of D21 × M21 calculated by the multiplier 300 and D22 × which is the product calculated by the multiplier 301 in the above step ST3. The sum of M22 and D23 × M23, which is the product calculated by the multiplier 302, is calculated. Following the calculation of the sum by the adder 500, or in parallel with the calculation of the sum, the selection unit 400 sets the adder 500 to a 0 value based on the selection parameter acquired from the storage unit 700 in step ST4 described above. Is output. Next, the adder 500 outputs the calculated sum D21 × M21 + D22 × M22 + D23 × M23 as it is to the output unit 600, and the output unit 600 outputs the sum to the control unit 30 as output data in the above step ST5. Output.
In parallel with the execution of the above step by the adder 500, the input data control unit 200 simultaneously supplies the input data D31 to the multiplier 300 and the input data D32 to the multiplier 301 in the above step ST1. And the input data D33 is supplied to the multiplier 302. Further, in the input data control unit 200, at the same time as supplying these input data, the storage unit 700 outputs the weight parameter M31 to the multiplier 300, outputs the weight parameter M32 to the multiplier 301, and outputs the weight parameter M32 to the multiplier 302. Instruct the storage unit 700 to output M33. Next, the multiplier 300 calculates the product of the input data D31 and M31 in step ST2 described above, the multiplier 301 calculates the product of the input data D32 and M32, and the multiplier 302 calculates the input data. The product of D33 and M33 is calculated.

以上のように、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数以下である場合、上記の具体例のように、選択部400は、加算器500が算出した和を加算器500にフィードバックせずに、加算器500は、当該和を出力部600に出力する。 As described above, the number of input data used by the neural network circuit 20 to calculate one output data is less than or equal to the number of multipliers provided in the first arithmetic circuit 800 and the second arithmetic circuit 900, respectively. In some cases, as in the specific example above, the selection unit 400 does not feed back the sum calculated by the adder 500 to the adder 500, and the adder 500 outputs the sum to the output unit 600.

次に、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数よりも多い場合における、ニューラルネットワーク回路20の動作について説明する。図5は、当該場合における、実施の形態1に係るニューラルネットワーク回路20による演算処理方法を示すフローチャートである。 Next, when the number of input data used by the neural network circuit 20 to calculate one output data is larger than the number of multipliers provided by the first arithmetic circuit 800 and the second arithmetic circuit 900, respectively. The operation of the neural network circuit 20 in the above will be described. FIG. 5 is a flowchart showing a calculation processing method by the neural network circuit 20 according to the first embodiment in this case.

入力データ制御部200は、第1の入力データを、第1の乗算器である乗算器300に供給し、第2の入力データを、第2の乗算器である乗算器301に供給する(ステップST10)。また、入力データ制御部200は、格納部700が乗算器300及び乗算器301にそれぞれ重みパラメータを出力するように格納部700に命令する。 The input data control unit 200 supplies the first input data to the multiplier 300, which is the first multiplier, and supplies the second input data to the multiplier 301, which is the second multiplier (step). ST10). Further, the input data control unit 200 instructs the storage unit 700 to output the weight parameter to the multiplier 300 and the multiplier 301, respectively.

乗算器300は、入力データ制御部200から取得した第1の入力データと、格納部700から取得した重みパラメータとの積である第1の積を算出し、乗算器301は、入力データ制御部200から取得した第2の入力データと、格納部700から取得した重みパラメータとの積である第2の積を算出する(ステップST11)。乗算器300は、算出した第1の積を加算器500に出力し、乗算器301は、算出した第2の積を加算器500に出力する。 The multiplier 300 calculates the first product, which is the product of the first input data acquired from the input data control unit 200 and the weight parameter acquired from the storage unit 700, and the multiplier 301 is the input data control unit. The second product, which is the product of the second input data acquired from 200 and the weight parameter acquired from the storage unit 700, is calculated (step ST11). The multiplier 300 outputs the calculated first product to the adder 500, and the multiplier 301 outputs the calculated second product to the adder 500.

加算器500は、乗算器300が算出した第1の積と、乗算器301が算出した第2の積との和である第1の和を算出する(ステップST12)。加算器500は、算出した第1の和を選択部400に出力する。 The adder 500 calculates a first sum, which is the sum of the first product calculated by the multiplier 300 and the second product calculated by the multiplier 301 (step ST12). The adder 500 outputs the calculated first sum to the selection unit 400.

入力データ制御部200は、第3の入力データを、乗算器300に供給し、第4の入力データを、乗算器301に供給する(ステップST13)。また、入力データ制御部200は、格納部700が乗算器300及び乗算器301にそれぞれ重みパラメータを出力するように格納部700に命令する。なお、当該重みパラメータは、ステップST10及びステップST11における重みパラメータとは別の重みパラメータであり、値が異なっていてもよく、同一であってもよい。また、入力データ制御部200は、格納部700が選択部400に選択パラメータを出力するように格納部700に命令する。 The input data control unit 200 supplies the third input data to the multiplier 300, and supplies the fourth input data to the multiplier 301 (step ST13). Further, the input data control unit 200 instructs the storage unit 700 to output the weight parameter to the multiplier 300 and the multiplier 301, respectively. The weight parameter is a weight parameter different from the weight parameter in step ST10 and step ST11, and the values may be different or the same. Further, the input data control unit 200 instructs the storage unit 700 to output the selection parameter to the selection unit 400 by the storage unit 700.

乗算器300は、入力データ制御部200から取得した第3の入力データと、格納部700から取得した重みパラメータとの積である第3の積を算出し、乗算器301は、入力データ制御部200から取得した第4の入力データと、格納部700から取得した重みパラメータとの積である第4の積を算出する(ステップST14)。乗算器300は、算出した第3の積を加算器500に出力し、乗算器301は、算出した第4の積を加算器500に出力する。 The multiplier 300 calculates a third product, which is the product of the third input data acquired from the input data control unit 200 and the weight parameter acquired from the storage unit 700, and the multiplier 301 is the input data control unit. The fourth product, which is the product of the fourth input data acquired from 200 and the weight parameter acquired from the storage unit 700, is calculated (step ST14). The multiplier 300 outputs the calculated third product to the adder 500, and the multiplier 301 outputs the calculated fourth product to the adder 500.

加算器500は、乗算器300が算出した第3の積と、乗算器301が算出した第4の積との和である第2の和を算出する(ステップST15)。
選択部400は、格納部700から取得した選択パラメータに基づき、加算器500から取得した第1の和を加算器500にフィードバックする(ステップST16)。
加算器500は、選択部400がフィードバックした第1の和と、算出した第2の和との和である第3の和を算出する(ステップST17)。加算器500は、算出した第3の和を出力部600に出力する。
出力部600は、加算器500から取得した第3の和を出力データとして制御部30に出力する(ステップST18)。
The adder 500 calculates a second sum, which is the sum of the third product calculated by the multiplier 300 and the fourth product calculated by the multiplier 301 (step ST15).
The selection unit 400 feeds back the first sum acquired from the adder 500 to the adder 500 based on the selection parameter acquired from the storage unit 700 (step ST16).
The adder 500 calculates a third sum, which is the sum of the first sum fed back by the selection unit 400 and the calculated second sum (step ST17). The adder 500 outputs the calculated third sum to the output unit 600.
The output unit 600 outputs the third sum acquired from the adder 500 to the control unit 30 as output data (step ST18).

次に、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数よりも多い場合における、ニューラルネットワーク回路20の動作の具体例について説明する。図6は、当該具体例を説明するための図である。図6では、同一の行に記載されている各ブロックは、ニューラルネットワーク回路20が備えている何れかの構成が処理する各データを示し、同一の列に記載されている各データは、ニューラルネットワーク回路20が備えている何れかの構成が同時に処理する各データを示している。なお、図6において網掛けされたブロックは、当該ブロックに対応するニューラルネットワーク回路20の構成が処理を行わないことを示しているか、又は、当該ブロックに対応するニューラルネットワーク回路20の構成が処理を行っても処理結果を別の構成に出力しないことを示す。また、以下の具体例では、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が4であり、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数が3である場合の例を説明するが、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数は、第1の演算回路800又は第2の演算回路900がそれぞれ備えている乗算器の数よりも多ければよく、当該例に限定されない。 Next, when the number of input data used by the neural network circuit 20 to calculate one output data is larger than the number of multipliers provided by the first arithmetic circuit 800 and the second arithmetic circuit 900, respectively. A specific example of the operation of the neural network circuit 20 will be described. FIG. 6 is a diagram for explaining the specific example. In FIG. 6, each block described in the same row indicates each data processed by any configuration provided in the neural network circuit 20, and each data described in the same column is a neural network. Each data that any configuration provided in the circuit 20 processes simultaneously is shown. The shaded blocks in FIG. 6 indicate that the configuration of the neural network circuit 20 corresponding to the block does not perform processing, or the configuration of the neural network circuit 20 corresponding to the block performs processing. Indicates that the processing result is not output to another configuration even if it is executed. Further, in the following specific example, the number of input data used by the neural network circuit 20 to calculate one output data is 4, and the first arithmetic circuit 800 and the second arithmetic circuit 900 are provided, respectively. An example in which the number of multipliers is three will be described, but the number of input data used by the neural network circuit 20 to calculate one output data is the first arithmetic circuit 800 or the second arithmetic circuit 900. Is not limited to this example, as long as it is larger than the number of multipliers provided by each.

図6のDの列が示すように、入力データ制御部200は、上述のステップST10において、同時に、乗算器300に入力データD11(第1の入力データ)を供給し、乗算器301に入力データD12(第2の入力データ)を供給する。また、入力データ制御部200は、これらの入力データの供給と同時に、格納部700が乗算器300に重みパラメータM11を出力し、乗算器301に重みパラメータM12を出力するように、格納部700に命令する。そして、上記の各工程の後に、乗算器300は、上述のステップST11において、入力データD11と重みパラメータM11との積(第1の積)を算出し、乗算器301は、入力データD12と重みパラメータM12との積(第2の積)を算出する。 As shown by the column D in FIG. 6, the input data control unit 200 simultaneously supplies the input data D11 (first input data) to the multiplier 300 in the above step ST10, and inputs the input data to the multiplier 301. D12 (second input data) is supplied. Further, the input data control unit 200 outputs the weight parameter M11 to the multiplier 300 and outputs the weight parameter M12 to the multiplier 301 at the same time as the supply of these input data to the storage unit 700. Command. Then, after each of the above steps, the multiplier 300 calculates the product (first product) of the input data D11 and the weight parameter M11 in the above step ST11, and the multiplier 301 calculates the product (first product) of the input data D12 and the weight. The product with the parameter M12 (second product) is calculated.

図6のEの列が示すように、加算器500は、上述のステップST12において、乗算器300が算出した積であるD11×M11と、乗算器301が算出した積であるD12×M12との和(第1の和)を算出する。加算器500による当該和の算出の次に、又は、当該和の算出と並行して、入力データ制御部200は、上述のステップST13において、乗算器300に入力データD13(第3の入力データ)を供給し、乗算器301に入力データD14(第4の入力データ)を供給する。また、入力データ制御部200は、格納部700が乗算器300に重みパラメータM13を出力し、乗算器301に重みパラメータM14を出力するように、これらの入力データの供給と同時に格納部700に命令する。次に、乗算器300は、上述のステップST14において、入力データD13と重みパラメータM13との積(第3の積)を算出し、乗算器301は、入力データD14と重みパラメータM14との積(第4の積)を算出する。 As shown by the column E in FIG. 6, the adder 500 is a product of D11 × M11 calculated by the multiplier 300 and D12 × M12 calculated by the multiplier 301 in the above step ST12. Calculate the sum (first sum). Next to the calculation of the sum by the adder 500, or in parallel with the calculation of the sum, the input data control unit 200 sends the input data D13 (third input data) to the multiplier 300 in the above step ST13. Is supplied, and the input data D14 (fourth input data) is supplied to the multiplier 301. Further, the input data control unit 200 instructs the storage unit 700 at the same time as supplying these input data so that the storage unit 700 outputs the weight parameter M13 to the multiplier 300 and outputs the weight parameter M14 to the multiplier 301. To do. Next, the multiplier 300 calculates the product (third product) of the input data D13 and the weight parameter M13 in the above step ST14, and the multiplier 301 calculates the product of the input data D14 and the weight parameter M14 (the product of the input data D14 and the weight parameter M14). The fourth product) is calculated.

図6のFの列が示すように、加算器500は、上述のステップST15において、乗算器300が算出した積であるD13×M13と、乗算器301が算出した積であるD14×M14との和(第2の和)を算出する。加算器500による当該和の算出の次に、又は、当該和の算出と並行して、選択部400は、上述のステップST16において、格納部700から取得した選択パラメータに基づき、加算器500が算出した和であるD11×M11+D12×M12を加算器500に出力する。そして、加算器500は、上述のステップST17において、選択部400から取得した第1の和D11×M11+D12×M12と、算出した第2の和D13×M13+D14×M14との和(第3の和)を算出する。次に、加算器500は、算出した第3の和であるD11×M11+D12×M12+D13×M13+D14×M14をそのまま出力部600に出力し、出力部600は、上述のステップST18において、当該第3の和を出力データとして制御部30に出力する。一方で、入力データ制御部200は、上述のステップST10の工程に戻り、乗算器300に入力データD21(第1の入力データ)を供給し、乗算器301に入力データD22(第2の入力データ)を供給する。また、入力データ制御部200は、格納部700が乗算器300に重みパラメータM21を出力し、乗算器301に重みパラメータM22を出力するように、これらの入力データの供給と同時に、格納部700に命令する。なお、図6のGの列及びHの列に関する構成は、Eの列及びFの列に関する構成と同様のため、説明を省略する。 As shown in the column F of FIG. 6, the adder 500 is a product of D13 × M13 calculated by the multiplier 300 and D14 × M14 calculated by the multiplier 301 in the above step ST15. Calculate the sum (second sum). Next to or in parallel with the calculation of the sum by the adder 500, the selection unit 400 calculates the sum by the adder 500 based on the selection parameters acquired from the storage unit 700 in step ST16 described above. The sum of D11 × M11 + D12 × M12 is output to the adder 500. Then, the adder 500 is the sum of the first sum D11 × M11 + D12 × M12 acquired from the selection unit 400 and the calculated second sum D13 × M13 + D14 × M14 in the above step ST17 (third sum). Is calculated. Next, the adder 500 outputs the calculated third sum D11 × M11 + D12 × M12 + D13 × M13 + D14 × M14 as it is to the output unit 600, and the output unit 600 outputs the calculated third sum as it is in the above step ST18. Is output to the control unit 30 as output data. On the other hand, the input data control unit 200 returns to the step of step ST10 described above, supplies the input data D21 (first input data) to the multiplier 300, and inputs the input data D22 (second input data) to the multiplier 301. ) Is supplied. Further, the input data control unit 200 supplies the input data to the storage unit 700 at the same time as the storage unit 700 outputs the weight parameter M21 to the multiplier 300 and outputs the weight parameter M22 to the multiplier 301. Command. Since the configuration of the G column and the H column in FIG. 6 is the same as the configuration of the E column and the F column, the description thereof will be omitted.

以上のように、上記の具体例では、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数よりも多い。その場合、選択部400が、加算器500が算出した和を加算器500にフィードバックすることにより、加算器500は、それぞれ異なる時刻に算出した2つの和同士を加算する。上記の具体例では、入力データ制御部200がステップST10において第1の演算回路が備えている複数の乗算器のうちの第1の乗算器300及び第2の乗算器301に入力データを供給し、第1の乗算器300及び第2の乗算器301がそれぞれステップST11で第1の積及び第2の積を算出する構成を説明したが、当該構成に限定されない。入力データ制御部200は、第1の演算回路が備えている複数の乗算器のうちの一部又は全ての乗算器に供給し得る。また、当該複数の乗算器のうちの一部又は全ての乗算器は、それぞれ、入力データ制御部200が供給した入力データと、格納部700が格納する重みパラメータとの積を算出し得る。 As described above, in the above specific example, the first arithmetic circuit 800 and the second arithmetic circuit 900 each have the number of input data used by the neural network circuit 20 to calculate one output data. More than the number of multipliers. In that case, the selection unit 400 feeds back the sum calculated by the adder 500 to the adder 500, so that the adder 500 adds the two sums calculated at different times. In the above specific example, the input data control unit 200 supplies input data to the first multiplier 300 and the second multiplier 301 among the plurality of multipliers provided in the first arithmetic circuit in step ST10. , The configuration in which the first multiplier 300 and the second multiplier 301 calculate the first product and the second product in step ST11, respectively, has been described, but the configuration is not limited to this. The input data control unit 200 may supply some or all of the plurality of multipliers included in the first arithmetic circuit. Further, some or all of the plurality of multipliers can calculate the product of the input data supplied by the input data control unit 200 and the weight parameter stored in the storage unit 700, respectively.

以上の、実施の形態1に係るニューラルネットワーク回路20の動作の説明において、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数以下である場合における、ニューラルネットワーク回路20の動作と、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数よりも多い場合における、ニューラルネットワーク回路20の動作とについて説明した。このように、ニューラルネットワーク回路20の動作は、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数と、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数とによって異なる。これを一般化すると、入力データ制御部200は、入力データ制御部200が各乗算器に同時に供給する入力データの数をmとし、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数をnとして、一時的にバッファ210にm個のデータを蓄積し、バッファ210から、ceil(m/ceil(m/n))個ずつ入力データを取得し、n個の乗算器のうちのceil(m/ceil(m/n))個の乗算器に、ceil(m/ceil(m/n))個ずつ入力データを供給する。なお、「ceil(m/ceil(m/n))」における「ceil()」は、引数に対して小数点第一位を切り上げる関数を示す。 In the above description of the operation of the neural network circuit 20 according to the first embodiment, the number of input data used by the neural network circuit 20 to calculate one output data is the first arithmetic circuit 800 and the second arithmetic circuit 800. The first operation is the operation of the neural network circuit 20 and the number of input data used by the neural network circuit 20 to calculate one output data when the number of multipliers is equal to or less than the number of multipliers provided in each of the arithmetic circuits 900. The operation of the neural network circuit 20 when the number of multipliers included in the arithmetic circuit 800 and the second arithmetic circuit 900 is larger than the number of multipliers is described. As described above, the operation of the neural network circuit 20 includes the number of input data used by the neural network circuit 20 to calculate one output data, and the first arithmetic circuit 800 and the second arithmetic circuit 900, respectively. It depends on the number of multipliers you have. To generalize this, the input data control unit 200 has m as the number of input data that the input data control unit 200 simultaneously supplies to each multiplier, and the first arithmetic circuit 800 and the second arithmetic circuit 900 respectively include. Assuming that the number of multipliers is n, m data are temporarily stored in the buffer 210, input data is acquired from the buffer 210 by ceil (m / ceil (m / n)), and n data are acquired. Input data is supplied to ceil (m / ceil (m / n)) multipliers among the multipliers by ceil (m / ceil (m / n)). Note that "ceil ()" in "ceil (m / ceil (m / n))" indicates a function that rounds up the first decimal place for the argument.

以上のように、実施の形態1に係るニューラルネットワーク回路20は、入力データに対して演算処理を行い、当該演算処理の結果である出力データを出力する第1の演算回路800と、演算回路への入力データの供給を制御する入力データ制御部200とを備え、第1の演算回路800は、重みパラメータ及び選択パラメータを格納する格納部700と、それぞれが、入力データ制御部200が供給した入力データと、格納部700が格納する重みパラメータとの積を算出する複数の乗算器の乗算器300、乗算器301及び乗算器302と、複数の乗算器がそれぞれ算出した積の和を算出する加算器500と、格納部700が格納する選択パラメータに応じて、加算器500が算出した和を加算器500にフィードバックする選択部400と、を備えている。 As described above, the neural network circuit 20 according to the first embodiment performs arithmetic processing on the input data, and outputs the output data as a result of the arithmetic processing to the first arithmetic circuit 800 and the arithmetic circuit. The first arithmetic circuit 800 includes a storage unit 700 for storing weight parameters and selection parameters, and an input data control unit 200 for controlling the supply of input data of the first arithmetic circuit 800. Adder that calculates the sum of the products calculated by the multipliers 300, 301 and 302 of the plurality of multipliers that calculate the product of the data and the weight parameters stored in the storage unit 700, and the multipliers that are calculated by the plurality of multipliers. It includes a device 500 and a selection unit 400 that feeds back the sum calculated by the adder 500 to the adder 500 according to the selection parameters stored in the storage unit 700.

上記の構成によれば、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数以下である場合、入力データ制御部200が複数の乗算器への各入力データの供給を制御することにより、入力データの数と同一の数の乗算器が入力データを並列に処理することができる。また、上記の構成によれば、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路及び第2の演算回路がそれぞれ備えている乗算器の数よりも多い場合、入力データ制御部200が入力データを分割して、分割された入力データをそれぞれ異なるタイミングで複数の乗算器に供給することにより入力データの時分割を行い、複数の乗算器と、加算器500とが、分割された入力データを順に処理し、選択部400が、加算器500が過去に処理した入力データを当該加算器500にフィードバックする。これにより、入力データの時分割処理を行うことができる。このような入力データ制御部200による複数の乗算器への入力データの供給の制御と、選択部400による加算器500へのフィードバックとにより、ニューラルネットワークの学習又は推論対象を変更する際に、FPGAのリコンフィグレーション機能のようには論理回路を書き換えずに、ニューラルネットワーク回路の構成を変更することができる。よって、FPGAのリコンフィグレーション機能よりも、ニューラルネットワーク回路の構成を短時間で変更することができる。 According to the above configuration, the number of input data used by the neural network circuit 20 to calculate one output data is the number of multipliers included in the first arithmetic circuit 800 and the second arithmetic circuit 900, respectively. In the following cases, the input data control unit 200 controls the supply of each input data to the plurality of multipliers, so that the same number of multipliers as the number of input data can process the input data in parallel. .. Further, according to the above configuration, the number of input data used by the neural network circuit 20 to calculate one output data is the number of adders included in the first arithmetic circuit and the second arithmetic circuit, respectively. If there are more than, the input data control unit 200 divides the input data and supplies the divided input data to a plurality of multiplyers at different timings to perform time division of the input data. , The adder 500 processes the divided input data in order, and the selection unit 400 feeds back the input data processed by the adder 500 in the past to the adder 500. Thereby, the time division processing of the input data can be performed. When the learning or inference target of the neural network is changed by the control of the supply of input data to a plurality of multipliers by the input data control unit 200 and the feedback to the adder 500 by the selection unit 400, the FPGA It is possible to change the configuration of the neural network circuit without rewriting the logic circuit like the reconfiguration function of. Therefore, the configuration of the neural network circuit can be changed in a shorter time than the reconfiguration function of the FPGA.

また、上記の構成によれば、上述の通り、入力データを並列に処理することができるため、演算処理に要する時間を抑制することができる。また、上記の構成によれば、上述の通り、入力データの時分割処理を行うことができるため、並列に処理を行う乗算器の数を制限し、回路規模を縮小した状態でも演算処理を行うことができる。これにより、ニューラルネットワーク回路の演算処理時間と回路規模とのバランスを動的に変更することができる。よって、学習又は推論対象を変更しても、変更後の学習又は推論対象に最適なニューラルネットワーク回路を、時間を要することなく構築できる。 Further, according to the above configuration, as described above, the input data can be processed in parallel, so that the time required for the arithmetic processing can be suppressed. Further, according to the above configuration, as described above, time division processing of input data can be performed, so that the number of multipliers to be processed in parallel is limited, and arithmetic processing is performed even in a state where the circuit scale is reduced. be able to. As a result, the balance between the arithmetic processing time of the neural network circuit and the circuit scale can be dynamically changed. Therefore, even if the learning or inference target is changed, the optimum neural network circuit for the changed learning or inference target can be constructed without requiring time.

また、実施の形態1に係るニューラルネットワーク回路20は、入力データ制御部200は、複数の乗算器のうちの一部又は全ての乗算器に入力データを供給し、複数の乗算器のうちの一部又は全ての乗算器は、それぞれ、入力データ制御部200が供給した入力データと、格納部700が格納する重みパラメータとの積を算出し、加算器500は、複数の乗算器のうちの一部又は全ての乗算器がそれぞれ入力データを用いて算出した積の和である第1の和を算出し、入力データ制御部200は、複数の乗算器のうちの一部又は全ての乗算器に入力データとは別の入力データを供給し、複数の乗算器のうちの一部又は全ての乗算器は、それぞれ、入力データ制御部200が供給した別の入力データと、格納部700が格納する重みパラメータとの積を算出し、加算器500は、複数の乗算器のうちの一部又は全ての乗算器がそれぞれ別の入力データを用いて算出した積の和である第2の和を算出し、選択部400は、選択パラメータに応じて、加算器500が算出した第1の和を加算器500にフィードバックし、加算器500は、選択部400がフィードバックした第1の和と、算出した第2の和との和である第3の和を算出する。 Further, in the neural network circuit 20 according to the first embodiment, the input data control unit 200 supplies input data to some or all of the plurality of multipliers, and one of the plurality of multipliers. Each unit or all multipliers calculate the product of the input data supplied by the input data control unit 200 and the weight parameter stored in the storage unit 700, and the adder 500 is one of a plurality of multipliers. The first sum, which is the sum of the products calculated by each unit or all the multipliers using the input data, is calculated, and the input data control unit 200 applies to some or all the multipliers among the plurality of multipliers. Input data different from the input data is supplied, and some or all of the plurality of multipliers store the other input data supplied by the input data control unit 200 and the storage unit 700, respectively. The product with the weight parameter is calculated, and the adder 500 calculates a second sum, which is the sum of the products calculated by some or all of the plurality of multipliers using different input data. Then, the selection unit 400 feeds back the first sum calculated by the adder 500 to the adder 500 according to the selection parameter, and the adder 500 calculates the first sum calculated by the selection unit 400. The third sum, which is the sum with the second sum, is calculated.

上記の構成によれば、実施の形態1に係るニューラルネットワーク回路は、入力データ制御部200が入力データを分割して、分割された入力データを複数の乗算器のうちの一部又は全ての乗算器にそれぞれ供給し、複数の乗算器のうちの一部又は全ての乗算器と、加算器500とが、分割された入力データを順に処理し、選択部400が、加算器500が過去に処理したデータを当該加算器500にフィードバックする。加算器500は、現行の処理済みのデータと、選択部400がフィードバックしたデータとを加算する。これにより、入力データの時分割処理を行うことができる。 According to the above configuration, in the neural network circuit according to the first embodiment, the input data control unit 200 divides the input data, and the divided input data is multiplied by a part or all of the plurality of multipliers. A part or all of the multipliers and the adder 500 process the divided input data in order, and the selection unit 400 and the adder 500 process in the past. The data is fed back to the adder 500. The adder 500 adds the currently processed data and the data fed back by the selection unit 400. Thereby, the time division processing of the input data can be performed.

また、実施の形態1に係るニューラルネットワーク回路20は、入力データ制御部200は、第1の入力データを、複数の乗算器のうちの第1の乗算器300に供給し、第2の入力データを、複数の乗算器のうちの第2の乗算器301に供給し、第1の乗算器300は、入力データ制御部200が供給した第1の入力データと、格納部700が格納する重みパラメータとの積である第1の積を算出し、第2の乗算器301は、入力データ制御部200が供給した第2の入力データと、格納部700が格納する重みパラメータとの積である第2の積を算出し、加算器500は、第1の積と第2の積との和である第1の和を算出し、入力データ制御部200は、第3の入力データを、複数の乗算器のうちの第1の乗算器300に供給し、第4の入力データを、複数の乗算器のうちの第2の乗算器301に供給し、第1の乗算器300は、入力データ制御部200が供給した第3の入力データと、格納部700が格納する重みパラメータとの積である第3の積を算出し、第2の乗算器301は、入力データ制御部200が供給した第4の入力データと、格納部700が格納する重みパラメータとの積である第4の積を算出し、加算器500は、第3の積と第4の積との和である第2の和を算出し、選択部400は、選択パラメータに応じて、加算器500が算出した第1の和を加算器500にフィードバックし、加算器500は、選択部400がフィードバックした第1の和と、算出した第2の和との和である第3の和を算出する。 Further, in the neural network circuit 20 according to the first embodiment, the input data control unit 200 supplies the first input data to the first multiplier 300 among the plurality of multipliers, and the second input data. Is supplied to the second multiplier 301 of the plurality of multipliers, and the first multiplier 300 supplies the first input data supplied by the input data control unit 200 and the weight parameter stored in the storage unit 700. The first product, which is the product of, is calculated, and the second multiplier 301 is the product of the second input data supplied by the input data control unit 200 and the weight parameter stored in the storage unit 700. The product of 2 is calculated, the adder 500 calculates the first sum, which is the sum of the first product and the second product, and the input data control unit 200 uses a plurality of third input data. The first multiplier 300 of the multipliers is supplied, the fourth input data is supplied to the second multiplier 301 of the plurality of multipliers, and the first multiplier 300 controls the input data. The third product, which is the product of the third input data supplied by the unit 200 and the weight parameter stored in the storage unit 700, is calculated, and the second multiplier 301 is the second multiplier supplied by the input data control unit 200. The fourth product, which is the product of the input data of 4 and the weight parameter stored in the storage unit 700, is calculated, and the multiplier 500 is the second sum, which is the sum of the third product and the fourth product. The selection unit 400 feeds back the first sum calculated by the multiplier 500 to the multiplier 500 according to the selection parameter, and the multiplier 500 feeds back the first sum calculated by the selection unit 400. The third sum, which is the sum of the calculated second sum, is calculated.

上記の構成によれば、実施の形態1に係るニューラルネットワーク回路は、入力データ制御部200が第1の入力データ、第2の入力データ、第3の入力データ及び第4の入力データの複数の入力データを分割して、分割された入力データを第1の乗算器300及び第2の乗算器301にそれぞれ供給し、第1の乗算器300及び第2の乗算器301と、加算器500とが、分割された入力データを順に処理し、選択部400が、加算器500が過去に処理したデータを当該加算器500にフィードバックする。加算器500は、現行の処理済みのデータと、選択部400がフィードバックしたデータとを加算する。これにより、入力データの時分割処理を行うことができる。 According to the above configuration, in the neural network circuit according to the first embodiment, the input data control unit 200 has a plurality of first input data, second input data, third input data, and fourth input data. The input data is divided and the divided input data is supplied to the first multiplier 300 and the second multiplier 301, respectively, and the first multiplier 300, the second multiplier 301, and the adder 500 are used. However, the divided input data is processed in order, and the selection unit 400 feeds back the data processed by the adder 500 in the past to the adder 500. The adder 500 adds the currently processed data and the data fed back by the selection unit 400. Thereby, the time division processing of the input data can be performed.

また、実施の形態1に係るニューラルネットワーク回路20は、入力データ制御部200は、入力データの数をmとし、複数の乗算器の数をnとして、複数の乗算器のうちのceil(m/ceil(m/n))個の乗算器にceil(m/ceil(m/n))個ずつ入力データを供給する。
上記の構成によれば、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数以下である場合に、上述のように、入力データを並列に処理することができる。また、ニューラルネットワーク回路20が1つの出力データを算出するために用いる入力データの数が、第1の演算回路800及び第2の演算回路900がそれぞれ備えている乗算器の数よりも多い場合に、入力データの時分割処理を行うことができる。
Further, in the neural network circuit 20 according to the first embodiment, the input data control unit 200 sets the number of input data to m and the number of a plurality of multipliers to n, and ceil (m / m / m /) among the plurality of multipliers. Input data is supplied to ceil (m / n)) multipliers by ceil (m / ceil (m / n)).
According to the above configuration, the number of input data used by the neural network circuit 20 to calculate one output data is the number of multipliers included in the first arithmetic circuit 800 and the second arithmetic circuit 900, respectively. In the following cases, the input data can be processed in parallel as described above. Further, when the number of input data used by the neural network circuit 20 to calculate one output data is larger than the number of multipliers provided in the first arithmetic circuit 800 and the second arithmetic circuit 900, respectively. , Input data can be time-divided.

実施の形態2.
実施の形態1では、第1の演算回路800が入力データに対して演算処理を行い、演算処理の結果として出力データを出力する構成について説明した。また、実施の形態1では、説明を省略したが、第2の演算回路900も第1の演算回路800と同様に入力データに対して演算処理を行い、演算処理の結果として出力データを出力する。つまり、実施の形態1では、第1の演算回路800及び第2の演算回路900は、それぞれ独立に、入力データに対して演算処理を行い、演算処理の結果として出力データを出力する。一方、実施の形態2では、第1の演算回路800の加算器501が、第2の演算回路901の加算器511が算出した和を、さらに用いて演算処理を行うことができる構成について説明する。
Embodiment 2.
In the first embodiment, a configuration has been described in which the first arithmetic circuit 800 performs arithmetic processing on input data and outputs output data as a result of the arithmetic processing. Further, although the description is omitted in the first embodiment, the second arithmetic circuit 900 also performs arithmetic processing on the input data in the same manner as the first arithmetic circuit 800, and outputs the output data as the result of the arithmetic processing. .. That is, in the first embodiment, the first arithmetic circuit 800 and the second arithmetic circuit 900 independently perform arithmetic processing on the input data and output output data as a result of the arithmetic processing. On the other hand, in the second embodiment, a configuration will be described in which the adder 501 of the first arithmetic circuit 800 can further perform arithmetic processing using the sum calculated by the adder 511 of the second arithmetic circuit 901. ..

以下で、実施の形態2について図面を参照して説明する。なお、実施の形態1で説明した構成と同様の機能を有する構成については同一の符号を付し、その説明を省略する。
図7は、実施の形態2に係るニューラルネットワーク回路21の構成を示すブロック図である。図7が示すように、実施の形態2に係るニューラルネットワーク回路21が実施の形態1に係るニューラルネットワーク回路20と異なる点は、入力データ制御部201が、乗算器300、乗算器301、乗算器302、乗算器310、乗算器311及び乗算器312にそれぞれ個別に接続している点である。これにより、入力データ制御部201は、乗算器300に供給する入力データと、乗算器310に供給する入力データとを同一のものとすることも、異なるものとすることもできる。また、入力データ制御部201は、乗算器301に供給する入力データと、乗算器311に供給する入力データとを異ならせることができる。また、入力データ制御部201は、乗算器302に供給する入力データと、乗算器312に供給する入力データとを異ならせることができる。
The second embodiment will be described below with reference to the drawings. The same reference numerals are given to the configurations having the same functions as those described in the first embodiment, and the description thereof will be omitted.
FIG. 7 is a block diagram showing a configuration of the neural network circuit 21 according to the second embodiment. As shown in FIG. 7, the difference between the neural network circuit 21 according to the second embodiment and the neural network circuit 20 according to the first embodiment is that the input data control unit 201 has a multiplier 300, a multiplier 301, and a multiplier. The point is that they are individually connected to 302, the multiplier 310, the multiplier 311 and the multiplier 312, respectively. As a result, the input data control unit 201 may make the input data supplied to the multiplier 300 and the input data supplied to the multiplier 310 the same or different. Further, the input data control unit 201 can make the input data supplied to the multiplier 301 different from the input data supplied to the multiplier 311. Further, the input data control unit 201 can make the input data supplied to the multiplier 302 different from the input data supplied to the multiplier 312.

さらに、実施の形態2に係るニューラルネットワーク回路21が実施の形態1に係るニューラルネットワーク回路20と異なる点は、第2の演算回路901の加算器511の出力側が、第1の演算回路801の選択部401に接続されている点である。これにより、加算器511は、算出した和を選択部401に出力する。選択部401は、格納部700から取得した選択パラメータに応じて、加算器511が算出した和を加算器501に出力する。加算器501は、算出した和と、選択部401から取得した和との和を算出し、当該和を出力部600に出力する。 Further, the difference between the neural network circuit 21 according to the second embodiment and the neural network circuit 20 according to the first embodiment is that the output side of the adder 511 of the second arithmetic circuit 901 selects the first arithmetic circuit 801. It is a point connected to the unit 401. As a result, the adder 511 outputs the calculated sum to the selection unit 401. The selection unit 401 outputs the sum calculated by the adder 511 to the adder 501 according to the selection parameter acquired from the storage unit 700. The adder 501 calculates the sum of the calculated sum and the sum obtained from the selection unit 401, and outputs the sum to the output unit 600.

次に、実施の形態2に係るニューラルネットワーク回路21による演算処理方法について図面を参照して説明する。図8は、実施の形態2に係るニューラルネットワーク回路21による演算処理方法を示すフローチャートである。なお、実施の形態2に係るニューラルネットワーク回路21による演算処理方法のステップST20からステップST22は、それぞれ、実施の形態1に係る演算処理方法のステップST1からステップST3と同様である。そのため、ステップST20からステップST22についての説明については省略する。 Next, the arithmetic processing method by the neural network circuit 21 according to the second embodiment will be described with reference to the drawings. FIG. 8 is a flowchart showing a calculation processing method by the neural network circuit 21 according to the second embodiment. Note that steps ST20 to ST22 of the arithmetic processing method by the neural network circuit 21 according to the second embodiment are the same as steps ST1 to ST3 of the arithmetic processing method according to the first embodiment, respectively. Therefore, the description of steps ST20 to ST22 will be omitted.

また、ステップST21及びステップST22の各工程は、第1の演算回路801と第2の演算回路901とで、並行して行われるものとする。また、以下で説明する演算処理方法は、入力データ制御部201が、乗算器300及び乗算器310にそれぞれ異なる入力データを供給し、乗算器301及び乗算器311にそれぞれ異なる入力データを供給し、乗算器302及び乗算器312にそれぞれ異なる入力データを供給し、出力部600のみが出力データを出力する場合の例である。 Further, it is assumed that each step of step ST21 and step ST22 is performed in parallel by the first arithmetic circuit 801 and the second arithmetic circuit 901. Further, in the arithmetic processing method described below, the input data control unit 201 supplies different input data to the multiplier 300 and the multiplier 310, and supplies different input data to the multiplier 301 and the multiplier 311. This is an example in which different input data is supplied to the multiplier 302 and the multiplier 312, and only the output unit 600 outputs the output data.

まず、ステップST22の工程の後に、加算器511は、ステップST22で算出した和を、第1の演算回路801の選択部401に出力する。次に、第1の演算回路801の選択部401は、格納部700から取得した選択パラメータに基づき、第2の演算回路901の加算器511がステップST22で算出した和を、第1の演算回路801の加算器501に出力する(ステップST23)。 First, after the step of step ST22, the adder 511 outputs the sum calculated in step ST22 to the selection unit 401 of the first arithmetic circuit 801. Next, the selection unit 401 of the first calculation circuit 801 calculates the sum calculated by the adder 511 of the second calculation circuit 901 in step ST22 based on the selection parameters acquired from the storage unit 700, in the first calculation circuit. Output to the adder 501 of 801 (step ST23).

次に、第1の演算回路801の加算器501は、ステップST22で算出した和と、加算器511が算出した和との和を算出する(ステップST24)。加算器501は、算出した当該和を出力部600に出力する。
次に、出力部600は、加算器501がステップST24で算出した和を出力データとして制御部30に出力する(ステップST25)。
Next, the adder 501 of the first arithmetic circuit 801 calculates the sum of the sum calculated in step ST22 and the sum calculated by the adder 511 (step ST24). The adder 501 outputs the calculated sum to the output unit 600.
Next, the output unit 600 outputs the sum calculated by the adder 501 in step ST24 to the control unit 30 as output data (step ST25).

なお、実施の形態2に係るニューラルネットワーク回路21の第1の演算回路801及び第2の演算回路901のいずれか又は両方は、上記のステップST20からステップST22の代わりに、実施形態1で説明したステップST10からステップST17を行ってもよい。第2の演算回路901が、実施形態1で説明したステップST10からステップST17を行った場合、ステップST17で加算器511が算出した第3の和が、ステップST23で、第2の演算回路901の加算器511がステップST22で算出した和の代わりに用いられる。 In addition, either or both of the first arithmetic circuit 801 and the second arithmetic circuit 901 of the neural network circuit 21 according to the second embodiment has been described in the first embodiment instead of the above steps ST20 to ST22. Steps ST10 to ST17 may be performed. When the second arithmetic circuit 901 performs step ST17 from step ST10 described in the first embodiment, the third sum calculated by the adder 511 in step ST17 is the sum of the second arithmetic circuit 901 in step ST23. The adder 511 is used in place of the sum calculated in step ST22.

また、上記の演算処理方法の説明では、入力データ制御部201が、乗算器300及び乗算器310にそれぞれ異なる入力データを供給し、乗算器301及び乗算器311にそれぞれ異なる入力データを供給し、乗算器302及び乗算器312にそれぞれ異なる入力データを供給し、出力部600が出力データを出力する場合の例について説明した。一方で、入力データ制御部201が、乗算器300及び乗算器310にそれぞれ同一の入力データを供給し、乗算器301及び乗算器311にそれぞれ同一の入力データを供給し、乗算器302及び乗算器312にそれぞれ同一の入力データを供給し、出力部600及び出力部610がそれぞれ出力データを出力する場合、実施の形態1に係る演算処理方法と同様の方法を行うことができる。より詳細には、上述のステップST23の代わりに、第1の演算回路801の選択部401は、格納部700から取得した選択パラメータに基づき、第2の演算回路901の加算器511がステップST22で算出した和の代わりに、ゼロ値を第1の演算回路801の加算器501に出力する。次に、ステップST24及びステップST25の代わりに、出力部600は、加算器501が算出した和をそのまま出力データとして制御部30に出力し、出力部610は、加算器511がステップST22で算出した和をそのまま出力データとして制御部30に出力する。 Further, in the above description of the arithmetic processing method, the input data control unit 201 supplies different input data to the multiplier 300 and the multiplier 310, and supplies different input data to the multiplier 301 and the multiplier 311. An example in which different input data is supplied to the multiplier 302 and the multiplier 312 and the output unit 600 outputs the output data has been described. On the other hand, the input data control unit 201 supplies the same input data to the multiplier 300 and the multiplier 310, respectively, supplies the same input data to the multiplier 301 and the multiplier 311, respectively, and supplies the multiplier 302 and the multiplier. When the same input data is supplied to the 312 and the output unit 600 and the output unit 610 output the output data, the same method as the arithmetic processing method according to the first embodiment can be performed. More specifically, instead of step ST23 described above, the selection unit 401 of the first calculation circuit 801 is based on the selection parameter acquired from the storage unit 700, and the adder 511 of the second calculation circuit 901 is set in step ST22. Instead of the calculated sum, the zero value is output to the adder 501 of the first arithmetic circuit 801. Next, instead of step ST24 and step ST25, the output unit 600 outputs the sum calculated by the adder 501 as output data to the control unit 30 as it is, and the output unit 610 is calculated by the adder 511 in step ST22. The sum is output to the control unit 30 as output data as it is.

次に、実施の形態2に係るニューラルネットワーク回路21の動作の具体例について説明する。図9は、当該具体例を説明するための図である。図9では、同一の行に記載されている各ブロックは、ニューラルネットワーク回路21が備えている何れかの構成が処理する各データを示し、同一の列に記載されている各データは、ニューラルネットワーク回路21が備えている何れかの構成が同時に処理する各データを示している。なお、図9において網掛けされたブロックは、当該ブロックに対応するニューラルネットワーク回路20の構成が処理を行わないことを示しているか、又は、当該ブロックに対応するニューラルネットワーク回路20の構成が処理を行っても処理結果を別の構成に出力しないことを示す。 Next, a specific example of the operation of the neural network circuit 21 according to the second embodiment will be described. FIG. 9 is a diagram for explaining the specific example. In FIG. 9, each block described in the same row represents each data processed by any configuration provided in the neural network circuit 21, and each data described in the same column is a neural network. Each data that any configuration provided in the circuit 21 processes at the same time is shown. The shaded blocks in FIG. 9 indicate that the configuration of the neural network circuit 20 corresponding to the block does not perform processing, or the configuration of the neural network circuit 20 corresponding to the block performs processing. Indicates that the processing result is not output to another configuration even if it is executed.

図9のIの列が示すように、入力データ制御部201は、上述のステップST20において、同時に、乗算器310に入力データD14を供給し、乗算器311に入力データD15を供給し、乗算器312に入力データD16を供給する。また、入力データ制御部201は、これらの入力データの供給と同時に、格納部710が乗算器310に重みパラメータM14を出力し、乗算器311に重みパラメータM15を出力し、乗算器312に重みパラメータM16を出力するように、格納部700に命令する。そして、これらの工程の後に、乗算器310は、上述のステップST21において、入力データD14と重みパラメータM14との積を算出し、乗算器301は、入力データD15と重みパラメータM15との積を算出し、乗算器302は、入力データD16と重みパラメータM16との積を算出する。 As shown by the column I in FIG. 9, the input data control unit 201 simultaneously supplies the input data D14 to the multiplier 310 and the input data D15 to the multiplier 311 in step ST20 described above, and the multiplier Input data D16 is supplied to 312. Further, in the input data control unit 201, at the same time as supplying these input data, the storage unit 710 outputs the weight parameter M14 to the multiplier 310, outputs the weight parameter M15 to the multiplier 311, and outputs the weight parameter M15 to the multiplier 312. Instruct the storage unit 700 to output M16. Then, after these steps, the multiplier 310 calculates the product of the input data D14 and the weight parameter M14 in step ST21 described above, and the multiplier 301 calculates the product of the input data D15 and the weight parameter M15. Then, the multiplier 302 calculates the product of the input data D16 and the weight parameter M16.

次に、図9のJの列が示すように、加算器511は、上述のステップST22において、乗算器310が算出した積であるD14×M14と、乗算器301が算出した積であるD15×M15と、乗算器302が算出した積であるD16×M16との和を算出する。次に、第1の演算回路801の選択部401は、上述のステップST23において、格納部700から取得した選択パラメータに基づき、第2の演算回路901の加算器511がステップST22で算出した和であるD14×M14+D15×M15+D16×M16を、第1の演算回路801の加算器501に出力する。一方、入力データ制御部201は、上述のステップST20において、同時に、乗算器300に入力データD11を供給し、乗算器301に入力データD12を供給し、及び乗算器302に入力データD13を供給する。入力データ制御部201は、上述のステップST20において、これらの入力データの供給と同時に、乗算器310に入力データD24を供給し、乗算器311に入力データD25を供給し、及び乗算器312に入力データD26を供給する。また、入力データ制御部201は、格納部700が乗算器300に重みパラメータM11を出力し、乗算器301に重みパラメータM12を出力し、乗算器302に重みパラメータM13を出力するように、これらの入力データの供給と同時に、格納部700に命令する。また、入力データ制御部201は、格納部710が乗算器310に重みパラメータM24を出力し、乗算器311に重みパラメータM25を出力し、乗算器302に重みパラメータM26を出力するように、これらの入力データの供給と同時に、格納部700に命令する。次に、乗算器300は、上述のステップST21において、入力データD11と重みパラメータM11との積を算出し、乗算器301は、入力データD12と重みパラメータM12との積を算出し、乗算器302は、入力データD13と重みパラメータM13との積を算出する。また、乗算器310は、上述のステップST21において、入力データD24と重みパラメータM24との積を算出し、乗算器311は、入力データD25と重みパラメータM25との積を算出し、乗算器312は、入力データD26と重みパラメータM26との積を算出する。 Next, as shown by the column J in FIG. 9, the adder 511 is a product of D14 × M14 calculated by the multiplier 310 and D15 × which is the product calculated by the multiplier 301 in the above step ST22. The sum of M15 and D16 × M16, which is the product calculated by the multiplier 302, is calculated. Next, the selection unit 401 of the first calculation circuit 801 is the sum calculated in step ST22 by the adder 511 of the second calculation circuit 901 based on the selection parameter acquired from the storage unit 700 in the above step ST23. A certain D14 × M14 + D15 × M15 + D16 × M16 is output to the adder 501 of the first arithmetic circuit 801. On the other hand, in step ST20 described above, the input data control unit 201 simultaneously supplies the input data D11 to the multiplier 300, supplies the input data D12 to the multiplier 301, and supplies the input data D13 to the multiplier 302. .. In step ST20 described above, the input data control unit 201 supplies the input data D24 to the multiplier 310, supplies the input data D25 to the multiplier 311 and inputs the input data to the multiplier 312 at the same time as supplying these input data. Data D26 is supplied. Further, the input data control unit 201 outputs the weight parameter M11 to the multiplier 300, the weight parameter M12 to the multiplier 301, and the weight parameter M13 to the multiplier 302 so that the storage unit 700 outputs the weight parameter M11 to the multiplier 300. At the same time as supplying the input data, the storage unit 700 is instructed. Further, the input data control unit 201 outputs the weight parameter M24 to the multiplier 310, the weight parameter M25 to the multiplier 311 and the weight parameter M26 to the multiplier 302 so that the storage unit 710 outputs the weight parameter M24 to the multiplier 310. At the same time as supplying the input data, the storage unit 700 is instructed. Next, the multiplier 300 calculates the product of the input data D11 and the weight parameter M11 in the above step ST21, and the multiplier 301 calculates the product of the input data D12 and the weight parameter M12, and the multiplier 302 Calculates the product of the input data D13 and the weight parameter M13. Further, the multiplier 310 calculates the product of the input data D24 and the weight parameter M24 in step ST21 described above, the multiplier 311 calculates the product of the input data D25 and the weight parameter M25, and the multiplier 312 calculates the product of the input data D25 and the weight parameter M25. , The product of the input data D26 and the weight parameter M26 is calculated.

次に、図9のKの列が示すように、第1の演算回路801の加算器501は、上述のステップST22において、乗算器300が算出した積であるD11×M11と、乗算器301が算出した積であるD12×M12と、乗算器302が算出した積であるD13×M13との和を算出する。次に、加算器501は、上述のステップST24において、当該和と、選択部401がステップST23で加算器501に出力した和であるD14×M14+D15×M15+D16×M16との和を算出する。出力部600は、上述のステップST25において、加算器501がステップST24で算出した和であるD11×M11+D12×M12+D13×M13+D14×M14+D15×M15+D16×M16を出力データとして制御部30に出力する。一方、入力データ制御部201は、上述のステップST20において、同時に、乗算器300に入力データD21を供給し、乗算器301に入力データD22を供給し、及び乗算器302に入力データD23を供給する。入力データ制御部201は、上述のステップST20において、これらの入力データの供給と同時に、乗算器310に入力データD34を供給し、乗算器311に入力データD35を供給し、及び乗算器312に入力データD36を供給する。また、入力データ制御部201は、格納部700が乗算器300に重みパラメータM21を出力し、乗算器301に重みパラメータM22を出力し、乗算器302に重みパラメータM23を出力するように、これらの入力データの供給と同時に、格納部700に命令する。また、入力データ制御部201は、格納部710が乗算器310に重みパラメータM34を出力し、乗算器311に重みパラメータM35を出力し、乗算器302に重みパラメータM36を出力するように、これらの入力データの供給と同時に、格納部700に命令する。また、加算器510は、上述のステップST22において、上記の入力データ制御部201による入力データの供給と格納部700への命令と同時に、乗算器310が算出した積であるD24×M24と、乗算器311が算出した積であるD25×M25と、乗算器312が算出した積であるD26×M26との和を算出する。なお、図9のLの列に関する構成は、Kの列に関する構成と同様のため、説明を省略する。 Next, as shown by the column K in FIG. 9, the adder 501 of the first arithmetic circuit 801 has the product D11 × M11 calculated by the multiplier 300 and the multiplier 301 in the above step ST22. The sum of the calculated product D12 × M12 and the product D13 × M13 calculated by the multiplier 302 is calculated. Next, the adder 501 calculates the sum of the sum and the sum of D14 × M14 + D15 × M15 + D16 × M16, which is the sum output to the adder 501 by the selection unit 401 in step ST23, in step ST24 described above. In step ST25 described above, the output unit 600 outputs D11 × M11 + D12 × M12 + D13 × M13 + D14 × M14 + D15 × M15 + D16 × M16, which is the sum calculated by the adder 501 in step ST24, to the control unit 30 as output data. On the other hand, in step ST20 described above, the input data control unit 201 simultaneously supplies the input data D21 to the multiplier 300, supplies the input data D22 to the multiplier 301, and supplies the input data D23 to the multiplier 302. .. In step ST20 described above, the input data control unit 201 supplies the input data D34 to the multiplier 310, supplies the input data D35 to the multiplier 311 and inputs the input data to the multiplier 312 at the same time as supplying these input data. Data D36 is supplied. Further, the input data control unit 201 outputs the weight parameter M21 to the multiplier 300, the weight parameter M22 to the multiplier 301, and the weight parameter M23 to the multiplier 302 so that the storage unit 700 outputs the weight parameter M21 to the multiplier 300. At the same time as supplying the input data, the storage unit 700 is instructed. Further, the input data control unit 201 outputs the weight parameter M34 to the multiplier 310, the weight parameter M35 to the multiplier 311 and the weight parameter M36 to the multiplier 302 so that the storage unit 710 outputs the weight parameter M34 to the multiplier 310. At the same time as supplying the input data, the storage unit 700 is instructed. Further, in step ST22 described above, the adder 510 simultaneously supplies the input data by the input data control unit 201 and gives an instruction to the storage unit 700, and at the same time, multiplies D24 × M24, which is the product calculated by the multiplier 310. The sum of D25 × M25, which is the product calculated by the device 311, and D26 × M26, which is the product calculated by the multiplier 312, is calculated. Since the configuration relating to the column L in FIG. 9 is the same as the configuration relating to the column K, the description thereof will be omitted.

以上のように、実施の形態1に係るニューラルネットワーク回路20は、演算回路を複数備え、入力データ制御部201は、複数の演算回路への各入力データの供給を制御し、複数の演算回路のうちの第1の演算回路801が備えている選択部401は、格納部700が格納する選択パラメータに応じて、複数の演算回路のうちの第2の演算回路901が備えている加算器511が算出した和を、第1の演算回路801が備えている加算器501にさらに出力し、第1の演算回路801が備えている加算器501は、算出した和と、第2の演算回路901が備えている加算器511が算出した和との和を算出する。 As described above, the neural network circuit 20 according to the first embodiment includes a plurality of arithmetic circuits, and the input data control unit 201 controls the supply of each input data to the plurality of arithmetic circuits, so that the plurality of arithmetic circuits may be supplied. The selection unit 401 included in the first arithmetic circuit 801 is an adder 511 included in the second arithmetic circuit 901 of the plurality of arithmetic circuits according to the selection parameters stored in the storage unit 700. The calculated sum is further output to the adder 501 included in the first arithmetic circuit 801. In the adder 501 included in the first arithmetic circuit 801 the calculated sum and the second arithmetic circuit 901 The sum with the sum calculated by the adder 511 provided is calculated.

上記の構成によれば、第1の演算回路801と第2の演算回路901とが、入力データを並列に処理することによって、演算処理時間を短縮するようにニューラルネットワーク回路21を動作させることができる。また、選択部401が選択パラメータに応じて加算器511が算出した和を加算器501に出力し、第1の演算回路801の加算器501が、算出した和と、第2の演算回路901の加算器511が算出した和との和を算出することにより、1つの出力データを出力するために並列に演算処理を行う入力データの数を増やすことができる。これにより、学習又は推論対象の性能を向上させることができる。
なお、本願発明はその発明の範囲内において、各実施の形態の自由な組み合わせ、あるいは各実施の形態の任意の構成要素の変形、もしくは各実施の形態において任意の構成要素の省略が可能である。
According to the above configuration, the first arithmetic circuit 801 and the second arithmetic circuit 901 can operate the neural network circuit 21 so as to shorten the arithmetic processing time by processing the input data in parallel. it can. Further, the selection unit 401 outputs the sum calculated by the adder 511 according to the selection parameter to the adder 501, and the adder 501 of the first arithmetic circuit 801 adds the calculated sum and the second arithmetic circuit 901. By calculating the sum with the sum calculated by the adder 511, it is possible to increase the number of input data that are subjected to arithmetic processing in parallel in order to output one output data. Thereby, the performance of the learning or inference target can be improved.
In the present invention, within the scope of the invention, it is possible to freely combine each embodiment, modify any component of each embodiment, or omit any component in each embodiment. ..

1 学習・推論システム、10 情報入力部、20 ニューラルネットワーク回路、21 ニューラルネットワーク回路、30 制御部、40 学習・推論結果出力部、200 入力データ制御部、201 入力データ制御部、210 バッファ、300 乗算器、301 乗算器、302 乗算器、310 乗算器、311 乗算器、312 乗算器、400 選択部、401 選択部、410 選択部、500 加算器、501 加算器、510 加算器、511 加算器、600 出力部、610 出力部、700 格納部、710 格納部、800 第1の演算回路、801 第1の演算回路、900 第2の演算回路、901 第2の演算回路。 1 Learning / inference system, 10 information input unit, 20 neural network circuit, 21 neural network circuit, 30 control unit, 40 learning / inference result output unit, 200 input data control unit, 201 input data control unit, 210 buffer, 300 multiplier Instrument, 301 Multiplier, 302 Multiplier, 310 Multiplier, 311 Multiplier, 312 Multiplier, 400 Selector, 401 Selector, 410 Selector, 500 Adder, 501 Adder, 510 Adder, 511 Adder, 600 output unit, 610 output unit, 700 storage unit, 710 storage unit, 800 first arithmetic circuit, 801 first arithmetic circuit, 900 second arithmetic circuit, 901 second arithmetic circuit.

Claims (5)

入力データに対して演算処理を行い、当該演算処理の結果である出力データを出力する演算回路と、
前記演算回路への入力データの供給を制御する入力データ制御部とを備え、
前記演算回路は、
重みパラメータ及び選択パラメータを格納する格納部と、
それぞれが、前記入力データ制御部が供給した入力データと、前記格納部が格納する重みパラメータとの積を算出する複数の乗算器と、
前記複数の乗算器がそれぞれ算出した積の和を算出する加算器と、
前記格納部が格納する選択パラメータに応じて、前記加算器が算出した和を前記加算器にフィードバックする選択部と、を備えていることを特徴とする、ニューラルネットワーク回路。
An arithmetic circuit that performs arithmetic processing on input data and outputs output data that is the result of the arithmetic processing.
It is provided with an input data control unit that controls the supply of input data to the arithmetic circuit.
The arithmetic circuit
A storage unit that stores weight parameters and selection parameters,
Each of a plurality of multipliers for calculating the product of the input data supplied by the input data control unit and the weight parameter stored in the storage unit.
An adder that calculates the sum of products calculated by each of the plurality of multipliers,
A neural network circuit including a selection unit that feeds back a sum calculated by the adder to the adder according to a selection parameter stored in the storage unit.
前記入力データ制御部は、前記複数の乗算器のうちの一部又は全ての乗算器に前記入力データを供給し、
前記複数の乗算器のうちの一部又は全ての乗算器は、それぞれ、前記入力データ制御部が供給した入力データと、前記格納部が格納する重みパラメータとの積を算出し、
前記加算器は、前記複数の乗算器のうちの一部又は全ての乗算器がそれぞれ前記入力データを用いて算出した積の和である第1の和を算出し、
前記入力データ制御部は、前記複数の乗算器のうちの一部又は全ての乗算器に前記入力データとは別の入力データを供給し、
前記複数の乗算器のうちの一部又は全ての乗算器は、それぞれ、前記入力データ制御部が供給した別の入力データと、前記格納部が格納する重みパラメータとの積を算出し、
前記加算器は、前記複数の乗算器のうちの一部又は全ての乗算器がそれぞれ前記別の入力データを用いて算出した積の和である第2の和を算出し、
前記選択部は、前記選択パラメータに応じて、前記加算器が算出した第1の和を前記加算器にフィードバックし、
前記加算器は、前記選択部がフィードバックした第1の和と、算出した第2の和との和である第3の和を算出することを特徴とする、請求項1に記載のニューラルネットワーク回路。
The input data control unit supplies the input data to some or all of the plurality of multipliers.
Each of some or all of the plurality of multipliers calculates the product of the input data supplied by the input data control unit and the weight parameter stored in the storage unit.
The adder calculates a first sum, which is the sum of products calculated by each of some or all of the plurality of multipliers using the input data.
The input data control unit supplies input data different from the input data to some or all of the plurality of multipliers.
Each of some or all of the plurality of multipliers calculates the product of another input data supplied by the input data control unit and the weight parameter stored in the storage unit.
The adder calculates a second sum, which is the sum of products calculated by some or all of the plurality of multipliers using the other input data.
The selection unit feeds back the first sum calculated by the adder to the adder according to the selection parameter.
The neural network circuit according to claim 1, wherein the adder calculates a third sum, which is a sum of the first sum fed back by the selection unit and the calculated second sum. ..
前記入力データ制御部は、第1の入力データを、前記複数の乗算器のうちの第1の乗算器に供給し、第2の入力データを、前記複数の乗算器のうちの第2の乗算器に供給し、
前記第1の乗算器は、前記入力データ制御部が供給した第1の入力データと、前記格納部が格納する重みパラメータとの積である第1の積を算出し、
前記第2の乗算器は、前記入力データ制御部が供給した第2の入力データと、前記格納部が格納する重みパラメータとの積である第2の積を算出し、
前記加算器は、前記第1の積と前記第2の積との和である第1の和を算出し、
前記入力データ制御部は、第3の入力データを、前記複数の乗算器のうちの第1の乗算器に供給し、第4の入力データを、前記複数の乗算器のうちの第2の乗算器に供給し、
前記第1の乗算器は、前記入力データ制御部が供給した第3の入力データと、前記格納部が格納する重みパラメータとの積である第3の積を算出し、
前記第2の乗算器は、前記入力データ制御部が供給した第4の入力データと、前記格納部が格納する重みパラメータとの積である第4の積を算出し、
前記加算器は、前記第3の積と前記第4の積との和である第2の和を算出し、
前記選択部は、前記選択パラメータに応じて、前記加算器が算出した第1の和を前記加算器にフィードバックし、
前記加算器は、前記選択部がフィードバックした第1の和と、算出した第2の和との和である第3の和を算出することを特徴とする、請求項1又は2に記載のニューラルネットワーク回路。
The input data control unit supplies the first input data to the first multiplier of the plurality of multipliers, and supplies the second input data to the second multiplier of the plurality of multipliers. Supply to the vessel,
The first multiplier calculates a first product which is a product of a first input data supplied by the input data control unit and a weight parameter stored by the storage unit.
The second multiplier calculates a second product, which is the product of the second input data supplied by the input data control unit and the weight parameter stored in the storage unit.
The adder calculates a first sum, which is the sum of the first product and the second product.
The input data control unit supplies the third input data to the first multiplier of the plurality of multipliers, and supplies the fourth input data to the second multiplier of the plurality of multipliers. Supply to the vessel,
The first multiplier calculates a third product, which is the product of the third input data supplied by the input data control unit and the weight parameter stored in the storage unit.
The second multiplier calculates a fourth product, which is the product of the fourth input data supplied by the input data control unit and the weight parameter stored in the storage unit.
The adder calculates a second sum, which is the sum of the third product and the fourth product.
The selection unit feeds back the first sum calculated by the adder to the adder according to the selection parameter.
The neural according to claim 1 or 2, wherein the adder calculates a third sum, which is a sum of the first sum fed back by the selection unit and the calculated second sum. Network circuit.
前記入力データ制御部は、前記入力データの数をmとし、前記複数の乗算器の数をnとして、前記複数の乗算器のうちのceil(m/ceil(m/n))個の乗算器にceil(m/ceil(m/n))個ずつ前記入力データを供給することを特徴とする、請求項1から請求項3の何れか1項に記載のニューラルネットワーク回路。 The input data control unit has ceil (m / ceil (m / n)) multipliers among the plurality of multipliers, where m is the number of input data and n is the number of the plurality of multipliers. The neural network circuit according to any one of claims 1 to 3, wherein the input data is supplied to each of ceil (m / ceil (m / n)). 前記演算回路を複数備え、
前記複数の演算回路のうちの第1の演算回路が備えている選択部は、前記格納部が格納する選択パラメータに応じて、前記複数の演算回路のうちの第2の演算回路が備えている加算器が算出した和を、前記第1の演算回路が備えている加算器にさらに出力し、
前記第1の演算回路が備えている加算器は、算出した和と、第2の演算回路が備えている加算器が算出した和との和を算出することを特徴とする、請求項1から請求項4の何れか1項に記載のニューラルネットワーク回路。
Equipped with a plurality of the arithmetic circuits
The selection unit included in the first arithmetic circuit among the plurality of arithmetic circuits is included in the second arithmetic circuit among the plurality of arithmetic circuits according to the selection parameters stored in the storage unit. The sum calculated by the adder is further output to the adder provided in the first arithmetic circuit.
From claim 1, the adder provided in the first arithmetic circuit calculates the sum of the calculated sum and the sum calculated by the adder included in the second arithmetic circuit. The neural network circuit according to any one of claims 4.
JP2019025269A 2019-02-15 2019-02-15 neural network circuit Active JP7241563B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019025269A JP7241563B2 (en) 2019-02-15 2019-02-15 neural network circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019025269A JP7241563B2 (en) 2019-02-15 2019-02-15 neural network circuit

Publications (2)

Publication Number Publication Date
JP2020135175A true JP2020135175A (en) 2020-08-31
JP7241563B2 JP7241563B2 (en) 2023-03-17

Family

ID=72278754

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019025269A Active JP7241563B2 (en) 2019-02-15 2019-02-15 neural network circuit

Country Status (1)

Country Link
JP (1) JP7241563B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0484264A (en) * 1990-07-26 1992-03-17 Fujitsu Ltd Product sum arithmetic unit
JPH05242065A (en) * 1992-02-28 1993-09-21 Hitachi Ltd Information processor and its system
WO2018185765A1 (en) * 2017-04-04 2018-10-11 Hailo Technologies Ltd. Neural network processor incorporating inter-device connectivity
JP2020513637A (en) * 2016-12-09 2020-05-14 ベイジン ホライズン インフォメーション テクノロジー カンパニー リミテッド System and method for data management

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0484264A (en) * 1990-07-26 1992-03-17 Fujitsu Ltd Product sum arithmetic unit
JPH05242065A (en) * 1992-02-28 1993-09-21 Hitachi Ltd Information processor and its system
JP2020513637A (en) * 2016-12-09 2020-05-14 ベイジン ホライズン インフォメーション テクノロジー カンパニー リミテッド System and method for data management
WO2018185765A1 (en) * 2017-04-04 2018-10-11 Hailo Technologies Ltd. Neural network processor incorporating inter-device connectivity

Also Published As

Publication number Publication date
JP7241563B2 (en) 2023-03-17

Similar Documents

Publication Publication Date Title
US10935939B2 (en) Machine learning device, servo control apparatus, servo control system, and machine learning method
JP2001188767A (en) Neutral network arithmetic unit and method
CN115841137A (en) Method and computing device for fixed-point processing of data to be quantized
TW201807621A (en) Artificial neuron and controlling method thereof
KR102655950B1 (en) High speed processing method of neural network and apparatus using thereof
JPH077389B2 (en) Vector processing device for processing recurrence equations at high speed
US20200226201A1 (en) Methods and Apparatus for Constructing Digital Circuits for Performing Matrix Operations
JP2022000891A5 (en)
JP7241563B2 (en) neural network circuit
WO2022163861A1 (en) Neural network generation device, neural network computing device, edge device, neural network control method, and software generation program
US11900577B2 (en) Processing apparatus for performing processing using a convolutional neural network
EP0384709A2 (en) Learning Machine
JP2022165395A (en) Method for optimizing neural network model and method for providing graphical user interface for neural network model
CN115398447A (en) Control method of neural network circuit
JPH04114263A (en) Learning machine
JP2002328915A (en) Matrix calculator of time-sharing system
KR101987475B1 (en) Neural network parameter optimization method, neural network computing method and apparatus thereof suitable for hardware implementation
KR20200072666A (en) Selective data processing method of convolution layer and neural network processor using thereof
JP2009223437A (en) New signal generation device and new signal generation method
WO2023037882A1 (en) Machine learning device
JP5034041B2 (en) Data generation circuit and data generation method
JPH06110864A (en) Learning processing device
US20240201952A1 (en) Artificial intelligence operation system and method thereof
EP4105832A1 (en) Neural network circuit for deep artificial neuronal networks using deep feedback control
CN115033388A (en) Method and system for configuring GPU (graphics processing Unit) with parallel flow in artificial intelligence system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20211210

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20211210

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221026

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20221122

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230120

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20230207

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230307

R150 Certificate of patent or registration of utility model

Ref document number: 7241563

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150