JP7241563B2 - neural network circuit - Google Patents

neural network circuit Download PDF

Info

Publication number
JP7241563B2
JP7241563B2 JP2019025269A JP2019025269A JP7241563B2 JP 7241563 B2 JP7241563 B2 JP 7241563B2 JP 2019025269 A JP2019025269 A JP 2019025269A JP 2019025269 A JP2019025269 A JP 2019025269A JP 7241563 B2 JP7241563 B2 JP 7241563B2
Authority
JP
Japan
Prior art keywords
input data
sum
adder
multiplier
multipliers
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.)
Active
Application number
JP2019025269A
Other languages
Japanese (ja)
Other versions
JP2020135175A (en
Inventor
拓 今野
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)

Description

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

ニューラルネットワークは、一般的に、積和演算回路を用いて構成される。また、ニューラルネットワークは、学習又は推論する対象(以下、学習又は推論対象)に応じて異なった構成となるため、学習又は推論対象を変更する場合には、ニューラルネットワークの構成の変更に伴って、ニューラルネットワーク回路の構成を変更する必要がある。そこで、従来では、ニューラルネットワークの学習又は推論対象を変更する際に、FPGA(field-programmable gate array)のリコンフィグレーション機能を利用し、FPGA内の論理回路を書き換える方法が用いられている(例えば、特許文献1参照)。なお、FPGAのリコンフィグレーション機能とは、FPGAに変更後の設計データを書き込むことで、例えば、FPGAが備えている複数のロジックセル間の配線の接続を変更することにより、FPGAの論理回路を書き換える機能を意味する。 A neural network is generally configured using a sum-of-products operation circuit. In addition, since the neural network has a different configuration depending on the object to be learned or inferred (hereinafter referred to as the object to be learned or inferred), when changing the object to be learned or inferred, the neural network configuration changes, 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, the reconfiguration function of FPGA (field-programmable gate array) is used to rewrite the logic circuit in FPGA (for example, , see Patent Document 1). Note that the reconfiguration function of FPGA is to write changed design data into FPGA. Means the ability to rewrite.

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

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

この発明に係るニューラルネットワーク回路は、入力データに対して演算処理を行い、当該演算処理の結果である出力データを出力する演算回路と、演算回路への入力データの供給を制御する入力データ制御部とを備え、演算回路は、重みパラメータ及び選択パラメータを格納する格納部と、それぞれが、入力データ制御部が供給した入力データと、格納部が格納する重みパラメータとの積を算出する複数の乗算器と、複数の乗算器がそれぞれ算出した積の和を算出する加算器と、格納部が格納する選択パラメータに応じて、加算器が算出した和を加算器にフィードバックする選択部と、を備え、入力データ制御部は、複数の乗算器のうちの一部又は全ての乗算器に入力データを供給し、複数の乗算器のうちの一部又は全ての乗算器は、それぞれ、入力データ制御部が供給した入力データと、格納部が格納する重みパラメータとの積を算出し、加算器は、複数の乗算器のうちの一部又は全ての乗算器がそれぞれ入力データを用いて算出した積の和である第1の和を算出し、入力データ制御部は、複数の乗算器のうちの一部又は全ての乗算器に入力データとは別の入力データを供給し、複数の乗算器のうちの一部又は全ての乗算器は、それぞれ、入力データ制御部が供給した別の入力データと、格納部が格納する重みパラメータとの積を算出し、加算器は、複数の乗算器のうちの一部又は全ての乗算器がそれぞれ別の入力データを用いて算出した積の和である第2の和を算出し、選択部は、選択パラメータに応じて、加算器が算出した第1の和を加算器にフィードバックし、加算器は、選択部がフィードバックした第1の和と、算出した第2の和との和である第3の和を算出する
この発明に係るニューラルネットワーク回路は、入力データに対して演算処理を行い、当該演算処理の結果である出力データを出力する演算回路と、演算回路への入力データの供給を制御する入力データ制御部とを備え、演算回路は、重みパラメータ及び選択パラメータを格納する格納部と、それぞれが、入力データ制御部が供給した入力データと、格納部が格納する重みパラメータとの積を算出する複数の乗算器と、複数の乗算器がそれぞれ算出した積の和を算出する加算器と、格納部が格納する選択パラメータに応じて、加算器が算出した和を加算器にフィードバックする選択部と、を備え、入力データ制御部は、第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の演算回路が備えている加算器が算出した和を、第1の演算回路が備えている加算器にさらに出力し、第1の演算回路が備えている加算器は、算出した和と、第2の演算回路が備えている加算器が算出した和との和を算出する。
A neural network circuit according to the present invention includes 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 the supply of input data to the arithmetic circuit. and a plurality of multiplication units each calculating a 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 the products calculated by the plurality of multipliers; and a selection unit that feeds back the sum calculated by the adder to the adder according to a selection parameter stored in the storage unit. , the input data control unit supplies input data to some or all of the multiple multipliers, and some or all of the multiple multipliers each have an input data control unit calculates the product of the input data supplied by and the weight parameter stored in the storage unit, and the adder calculates the products calculated by some or all of the multiple multipliers using the input data, respectively. The input data control unit supplies input data different from the input data to some or all of the multiple multipliers, and A part or all of the multipliers of each of the multipliers calculates a product of another input data supplied by the input data control unit and a weight parameter stored in the storage unit, and an adder of the plurality of multipliers Some or all of the multipliers calculate a second sum that is a sum of products calculated using different input data, and the selection unit selects the first sum calculated by the adders according to the selection parameter is fed back to the adder, and the adder calculates the third sum that is the sum of the first sum fed back by the selector and the calculated second sum.
A neural network circuit according to the present invention includes 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 the supply of input data to the arithmetic circuit. and a plurality of multiplication units each calculating a 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 the products calculated by the plurality of multipliers; and a selection unit that feeds back the sum calculated by the adder to the adder according to a selection parameter stored in the storage unit. , the input data control unit supplies first input data to a first multiplier of the plurality of multipliers and supplies second input data to a second multiplier of the plurality of multipliers; a first multiplier for calculating a first product of the first input data supplied by the input data control unit and a weight parameter stored by the storage unit; and a second multiplier for , the second input data supplied by the input data control unit and the weight parameter stored in the storage unit to calculate a second product, the adder calculating the product of the first product and the second product; The input data control unit supplies the third input data to a first multiplier of the plurality of multipliers, and the fourth input data to the plurality of multiplications. The first multiplier supplies the third product which is the product of the third input data provided by the input data control unit and the weight parameter stored in the storage unit. , the second multiplier calculates a fourth product of the fourth input data supplied by the input data control unit and the weight parameter stored in the storage unit, and the adder calculates the fourth Calculate a second sum that is the sum of the product of 3 and the fourth product, the selection unit feeds back the first sum calculated by the adder to the adder according to the selection parameter, and the adder , a third sum that is the sum of the first sum fed back by the selector and the second sum calculated.
A neural network circuit according to the present invention includes 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 the supply of input data to the arithmetic circuit. and a plurality of multiplication units each calculating a 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 the products calculated by the plurality of multipliers; and a selection unit that feeds back the sum calculated by the adder to the adder according to a selection parameter stored in the storage unit. , a plurality of arithmetic circuits, wherein a selection unit included in a first arithmetic circuit among the plurality of arithmetic circuits selects a second arithmetic circuit among the plurality of arithmetic circuits in accordance with a selection parameter stored in the storage unit; further outputs the sum calculated by the adder provided in to the adder provided in the first arithmetic circuit, and the adder provided in the first arithmetic circuit outputs the calculated sum and the second calculation Calculate the sum with the sum calculated by the adder provided in the circuit.

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

実施の形態1に係るニューラルネットワーク回路を含む学習・推論システムの構成を示すブロック図である。1 is a block diagram showing the configuration of a learning/inference system including a neural network circuit according to Embodiment 1; FIG. 実施の形態1に係るニューラルネットワーク回路の構成を示すブロック図である。1 is a block diagram showing the configuration of a neural network circuit according to Embodiment 1; FIG. 実施の形態1に係るニューラルネットワーク回路による第1の演算処理方法を示すフローチャートである。4 is a flow chart showing a first arithmetic processing method by the neural network circuit according to Embodiment 1; 実施の形態1に係るニューラルネットワーク回路の動作の第1の具体例を説明するための図である。4 is a diagram for explaining a first specific example of the operation of the neural network circuit according to Embodiment 1; FIG. 実施の形態1に係るニューラルネットワーク回路による第2の演算処理方法を示すフローチャートである。7 is a flow chart showing a second arithmetic processing method by the neural network circuit according to Embodiment 1; 実施の形態1に係るニューラルネットワーク回路の動作の第2の具体例を説明するための図である。FIG. 9 is a diagram for explaining a second specific example of the operation of the neural network circuit according to Embodiment 1; 実施の形態2に係るニューラルネットワーク回路の構成を示すブロック図である。8 is a block diagram showing the configuration of a neural network circuit according to Embodiment 2; FIG. 実施の形態2に係るニューラルネットワーク回路による演算処理方法を示すフローチャートである。9 is a flowchart showing an arithmetic processing method by a neural network circuit according to Embodiment 2; 実施の形態2に係るニューラルネットワーク回路の動作の具体例を説明するための図である。FIG. 10 is a diagram for explaining a specific example of the operation of the neural network circuit according to the second embodiment;

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

情報入力部10は、ユーザによる入力により、ニューラルネットワーク回路20が学習又は推論を行う対象である入力データを取得する。情報入力部10は、入力データを、制御部30を介してニューラルネットワーク回路20に出力する。情報入力部10の例として、カメラ、マイク又はキーボード等が挙げられる。情報入力部10が入力する入力データの例として、画像データ、音声データ、又は文字列データ等が挙げられる。
ニューラルネットワーク回路20は、情報入力部10から取得した入力データを参照して、学習処理及び推論処理を行う。ニューラルネットワーク回路20は、当該学習処理及び推論処理の結果である出力データを制御部30に出力する。ニューラルネットワーク回路20の詳細な説明は後述する。
The information input unit 10 acquires input data for learning or inference by the neural network circuit 20 through user input. The information input section 10 outputs input data to the neural network circuit 20 via the control section 30 . Examples of the information input unit 10 include a camera, microphone, keyboard, and the like. Examples of input data input by the information input unit 10 include image data, voice data, character string data, and the like.
The neural network circuit 20 refers to the input data acquired from the information input unit 10 and performs learning processing and inference processing. The neural network circuit 20 outputs output data resulting from the learning process and the inference process to the control unit 30 . A detailed description of the neural network circuit 20 will be given 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 refers to the input data acquired from the information input unit 10, and sets or updates weighting parameters and selection parameters used in learning processing and inference processing. Next, the control unit 30 outputs the input data, the weight parameter and the selection parameter to the neural network circuit 20 and acquires output data from the neural network circuit 20 . Next, the control unit 30 refers to the output data to set or update the weight parameters and selection parameters used by the neural network circuit 20 for learning processing and inference processing. Through the steps described above, the control unit 30 controls the learning processing and the inference processing by the neural network circuit 20 . Note that the control unit 30 may reference the output data acquired from the neural network circuit 20 and return the output data to the neural network circuit 20 after updating the weight parameter. In that case, the neural network circuit 20 may perform learning processing and inference processing again using the output data. In addition, 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, audio 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 images, voices, 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 the configuration of neural network circuit 20 according to the first embodiment. As shown in FIG. 2, the neural network circuit 20 includes an input data control section 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 Embodiment 1, a configuration in which neural network circuit 20 includes two arithmetic circuits will be described. 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 accumulates the input data. The buffer 210 outputs part or all of the accumulated input data to the input data control section 200 .
The input data control section 200 acquires a plurality of pieces of input data from the buffer 210 and controls supply of each input data to the first arithmetic circuit 800 and the second arithmetic circuit 900 . The details of how the input data control unit 200 controls the supply of 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 weight parameters and selection parameters 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 section 400 , an adder 500 , an output section 600 and a storage section 700 . In this embodiment, a configuration in which each of the first arithmetic circuit 800 and the second arithmetic circuit 900 includes three multipliers will be described. However, the first arithmetic circuit 800 and the second arithmetic circuit 900 only need to have a plurality of multipliers. The number of multipliers included in circuit 900 may vary and is not limited to this configuration.

格納部700は、制御部30が出力した重みパラメータ及び選択パラメータを格納する。また、格納部700は、入力データ制御部200の命令に基づいて、格納している重みパラメータを乗算器300、乗算器301、又は乗算器302に出力する。なお、重みパラメータは、出力される乗算器毎に存在し、それらの重みパラメータは、互いに同じ値でもよく、異なる値でもよい。また、格納部700は、入力データ制御部200の命令に基づいて、格納している選択パラメータを選択部400に出力する。なお、本実施形態では、入力データ制御部200が格納部700からの重みパラメータ及び選択パラメータの出力を制御する構成について説明するが、制御部30が格納部700からの重みパラメータ及び選択パラメータの出力を制御してもよい。 The storage unit 700 stores the weight parameters and selection parameters output by the control unit 30 . The storage unit 700 also outputs the stored weight parameter to the multiplier 300 , the multiplier 301 or the multiplier 302 based on the command from the input data control unit 200 . A weight parameter exists for each output multiplier, and these weight parameters may have the same value or different values. The storage unit 700 also outputs the stored selection parameters to the selection unit 400 based on the command from the input data control unit 200 . In this embodiment, the input data control unit 200 controls the output of the weighting parameters and the selection parameters from the storage unit 700. However, the control unit 30 outputs the weighting parameters and the selection parameters 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に出力する。
Multipliers 300 , 301 , and 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 . Multiplier 300 , multiplier 301 , and multiplier 302 each output the calculated product to adder 500 .
Adder 500 calculates the sum of the products calculated by multipliers 300 , 301 , and 302 . The adder 500 outputs the calculated sum to the selection section 400 or the output section 600 according to the operation of the selection section 400, which will be 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, if the selection parameter is a value that instructs the adder 500 to feed back the first sum calculated by the adder 500 , the selection unit 400 sends the first sum to the adder 500 . give feedback. Next, the adder 500 adds the first sum fed back by the selection unit 400 and the second sum, which is the sum calculated after calculating the first sum, to obtain the third sum, which is the addition result. is output to the output unit 600. On the other hand, if the selection parameter is a value that instructs not to feed back the first sum to the adder 500 , the selection unit 400 outputs a 0 value to the adder 500 . In that case, the adder 500 outputs the calculated sum to the output section 600 as it is. In other words, 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 obtained from the selection unit 400, and otherwise 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 section 410 , an adder 510 , an output section 610 and a storage section 710 . The multiplier 310, the multiplier 311, the multiplier 312, the selector 410, the adder 510, the output unit 610, and the storage unit 710 are respectively the multiplier 310, the multiplier 311, the multiplier 312, the selector 400, and the storage unit 710 described above. It has the same functions as adder 500 , output section 600 and storage section 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 to the multiplier 300 by the input data control unit 200 and a weight parameter different from the weight parameter used by the multiplier 300. do. Multiplier 311 calculates the product of the same input data as the input data supplied to multiplier 301 by input data control section 200 and a weight parameter different from the weight parameter used by multiplier 301 . The multiplier 312 calculates the product of the same input data as the input data supplied to the multiplier 302 by the input data control unit 200 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, and the selector 410 calculates the The resulting sum is fed back to 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 types of output data, 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 may be any number. Therefore, the neural network circuit 20 according to this 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, operation of the neural network circuit 20 according to Embodiment 1 will be described with reference to the drawings. It should be noted that the neural network circuit 20 starts the operation when the input data, the weight parameter and the selection parameter are obtained 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 explanation of the operation of the arithmetic circuits included in the neural network circuit 20 will be given only for the first arithmetic circuit 800. Only the operation of is explained.

まず、ニューラルネットワーク回路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 provided in the first arithmetic circuit 800 and the second arithmetic circuit 900 , the operation of the neural network circuit 20 will be described. FIG. 3 is a flowchart showing an arithmetic processing method by the neural network circuit 20 according to the first embodiment in this case. Moreover, in the specification of the present application, the term “simultaneously” does not have to be exactly the same time, but 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 section 200 supplies input data to the multipliers 300, 301, and 302 (step ST1). The input data control unit 200 also instructs the storage unit 700 to output weight parameters to the multipliers 300, 301, and 302, respectively. The input data control unit 200 also commands the storage unit 700 to output the selection parameter to the selection unit 400 .

乗算器300、乗算器301、及び乗算器302は、それぞれ、入力データ制御部200が供給した入力データと、格納部700から取得した重みパラメータとの積を算出する(ステップST2)。乗算器300、乗算器301、及び乗算器302は、算出した各積を加算器500に出力する。 The multipliers 300, 301, and 302 each calculate the product of the input data supplied by the input data control section 200 and the weight parameter obtained from the storage section 700 (step ST2). Multiplier 300 , multiplier 301 , and multiplier 302 output each calculated product to 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 multipliers 300, 301, and 302 (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 section 600 as it is.
The output unit 600 outputs the sum acquired from the adder 500 to the control unit 30 as output data (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 less than or equal to the number of multipliers provided in the first arithmetic circuit 800 and the second arithmetic circuit 900 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 represents each data processed by any configuration provided in the neural network circuit 20, and each data described in the same column represents the neural network Each of the data is shown to be processed simultaneously by any of the components of circuit 20. FIG. In addition, shaded blocks in FIG. 4 indicate that the configuration of the neural network circuit 20 corresponding to the block does not perform processing, or that the configuration of the neural network circuit 20 corresponding to the block performs processing. Indicates that the processing result will not be 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 each include An example in which the number of multipliers is three will be described. is equal to or less than the number of multipliers provided, and is not limited to this example.

まず、図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 in column A of FIG. 4, in step ST1 described above, input data control section 200 simultaneously supplies input data D11 to multiplier 300, supplies input data D12 to multiplier 301, The multiplier 302 is supplied with the input data D13. Further, input data control section 200 controls these parameters so that storage section 700 outputs weight parameter M11 to multiplier 300, weight parameter M12 to multiplier 301, and weight parameter M13 to multiplier 302. The storage unit 700 is instructed at the same time as the input data is supplied. 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 of B in FIG. 4, the adder 500 adds D11×M11, which is the product calculated by the multiplier 300, and D12×, which is the product calculated by the multiplier 301, in step ST3 described above. The sum of M12 and D13×M13, which is the product calculated by the multiplier 302, is calculated. After the calculation of the sum by the adder 500 or in parallel with the calculation of the sum, the selector 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 section 600, and the output section 600 sends the sum as output data to the control section 30 in step ST5 described above. Output.
In parallel with the execution of the above steps by the adder 500, the input data control section 200 simultaneously supplies the input data D21 to the multiplier 300, supplies the input data D22 to the multiplier 301, and and supplies the input data D23 to the multiplier 302 . At the same time when these input data are supplied, the input data control unit 200 outputs the weight parameter M21 to the multiplier 300, the weight parameter M22 to the multiplier 301, the weight parameter M22 to the multiplier 302, and the weight parameter M22 to the multiplier 302. The storage unit 700 is instructed to output M23. Next, in step ST2 described above, the multiplier 300 calculates the product of the input data D21 and the weight parameter M21, 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 D22 and the weight parameter M22. 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 in column C of FIG. 4, adder 500 adds D21×M21, which is the product calculated by multiplier 300, and D22×, which is the product calculated by multiplier 301, in step ST3 described above. The sum of M22 and D23×M23, which is the product calculated by the multiplier 302, is calculated. After 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 0 based on the selection parameter acquired from the storage unit 700 in step ST4 described above. to output Next, the adder 500 outputs the calculated sum D21×M21+D22×M22+D23×M23 as it is to the output section 600, and the output section 600 sends the sum as output data to the control section 30 in step ST5 described above. Output.
In parallel with execution of the above steps by adder 500, input data control section 200 simultaneously supplies input data D31 to multiplier 300, supplies input data D32 to multiplier 301, and supplies input data D31 to multiplier 301 in step ST1 described above. and supplies the input data D33 to the multiplier 302 . At the same time when these input data are supplied, the input data control unit 200 outputs the weight parameter M31 to the multiplier 300 , the weight parameter M32 to the multiplier 301 , the weight parameter M32 to the multiplier 302 , and the weight parameter M32 to the multiplier 302 . The storage unit 700 is instructed to output M33. Next, in step ST2 described above, the multiplier 300 calculates the product of the input data D31 and M31, the multiplier 301 calculates the product of the input data D32 and M32, the multiplier 302 calculates the input data Calculate the product of D33 and M33.

以上のように、ニューラルネットワーク回路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 piece of 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. In some cases, the adder 500 outputs the sum to the output section 600 without feeding back the sum calculated by the adder 500 to the adder 500 as in the above specific example.

次に、ニューラルネットワーク回路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 greater than the number of multipliers provided in each of the first arithmetic circuit 800 and the second arithmetic circuit 900 , the operation of the neural network circuit 20 will be described. FIG. 5 is a flowchart showing an arithmetic 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). The input data control unit 200 also instructs the storage unit 700 to output weight parameters to the multipliers 300 and 301, respectively.

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

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

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

乗算器300は、入力データ制御部200から取得した第3の入力データと、格納部700から取得した重みパラメータとの積である第3の積を算出し、乗算器301は、入力データ制御部200から取得した第4の入力データと、格納部700から取得した重みパラメータとの積である第4の積を算出する(ステップST14)。乗算器300は、算出した第3の積を加算器500に出力し、乗算器301は、算出した第4の積を加算器500に出力する。 Multiplier 300 calculates a third product of the third input data obtained from input data control section 200 and the weight parameter obtained from storage section 700, and multiplier 301 calculates the third product of the input data control section. A fourth product of the fourth input data obtained from 200 and the weight parameter obtained from storage unit 700 is calculated (step ST14). Multiplier 300 outputs the calculated third product to adder 500 , and multiplier 301 outputs the calculated fourth product to 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 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 obtained from the adder 500 to the adder 500 based on the selection parameter obtained from the storage unit 700 (step ST16).
The adder 500 calculates a third sum that is the sum of the first sum fed back by the selection section 400 and the calculated second sum (step ST17). Adder 500 outputs the calculated third sum to output section 600 .
The output section 600 outputs the third sum acquired from the adder 500 to the control section 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 greater than the number of multipliers provided in each of the first arithmetic circuit 800 and the second arithmetic circuit 900 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 represents each data processed by any configuration provided in the neural network circuit 20, and each data described in the same column represents the neural network Each of the data is shown to be processed simultaneously by any of the components of circuit 20. FIG. 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 that the configuration of the neural network circuit 20 corresponding to the block performs processing. Indicates that the processing result will not be 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 four, and the first arithmetic circuit 800 and the second arithmetic circuit 900 each include An example in which the number of multipliers is three will be described. is greater than the number of multipliers provided, and is not limited to this example.

図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 in column D in FIG. 6, input data control section 200 simultaneously supplies input data D11 (first input data) to multiplier 300 and input data D11 (first input data) to multiplier 301 in step ST10 described above. D12 (second input data) is supplied. At the same time as supplying these input data, the input data control unit 200 causes the storage unit 700 to output the weight parameter M11 to the multiplier 300 and the weight parameter M12 to the multiplier 301. Command. Then, after each of the above steps, multiplier 300 calculates the product (first product) of input data D11 and weight parameter M11 in step ST11 described above, and multiplier 301 calculates input data D12 and weight A product (second product) with the parameter M12 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 in column E in FIG. 6, the adder 500 converts D11×M11, which is the product calculated by the multiplier 300, and D12×M12, which is the product calculated by the multiplier 301, in step ST12 described above. A sum (first sum) is calculated. After the calculation of the sum by the adder 500 or in parallel with the calculation of the sum, the input data control section 200 supplies the input data D13 (third input data) to the multiplier 300 in step ST13 described above. , and supplies input data D14 (fourth input data) to the multiplier 301 . At the same time as supplying these input data, the input data control unit 200 instructs the storage unit 700 to output the weight parameter M13 to the multiplier 300 and the weight parameter M14 to the multiplier 301 . do. Next, in step ST14 described above, multiplier 300 calculates the product (third product) of input data D13 and weight parameter M13, and multiplier 301 calculates the product (third product) of input data D14 and weight parameter M14. 4th product).

図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 column F in FIG. 6, the adder 500 converts D13×M13, which is the product calculated by the multiplier 300, and D14×M14, which is the product calculated by the multiplier 301, in step ST15 described above. A sum (second sum) is calculated. After the calculation of the sum by the adder 500, or in parallel with the calculation of the sum, the selection unit 400 calculates the D11×M11+D12×M12, which is the sum of the obtained values, is output to the adder 500. FIG. Then, in step ST17 described above, the adder 500 adds the sum of the first sum D11×M11+D12×M12 obtained from the selection unit 400 and the calculated second sum D13×M13+D14×M14 (third sum) Calculate 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 third sum in step ST18 described above. is output to the control unit 30 as output data. On the other hand, input data control section 200 returns to the process of step ST10 described above, supplies input data D21 (first input data) to multiplier 300, and supplies input data D22 (second input data) to multiplier 301. ). At the same time as supplying these input data, the input data control unit 200 stores the Command. Note that the configuration of the G and H columns in FIG. 6 is the same as the configuration of the E and F columns, and thus the description thereof is 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 piece of output data. More than the number of multipliers. In this 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 section 200 supplies input data to the first multiplier 300 and the second multiplier 301 of the plurality of multipliers provided in the first arithmetic circuit in step ST10. , the first multiplier 300 and the second multiplier 301 respectively calculate the first product and the second product in step ST11, but the configuration is not limited to this. The input data control unit 200 can supply data to some or all of the multiple multipliers included in the first arithmetic circuit. Further, some or all of the multiple multipliers can each calculate the product of the input data supplied by the input data control section 200 and the weight parameter stored in the storage section 700 .

以上の、実施の形態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 same as that of the first arithmetic circuit 800 and that of the second arithmetic circuit 800. The operation of neural network circuit 20 and the number of input data used by neural network circuit 20 to calculate one piece of output data when the number of multipliers included in arithmetic circuit 900 is less than or equal to the first The operation of the neural network circuit 20 when the number of multipliers provided in the arithmetic circuit 800 and the second arithmetic circuit 900 is greater than that of the arithmetic circuit 800 and the second arithmetic circuit 900 has been described. In this way, the operation of the neural network circuit 20 is based on the number of input data used by the neural network circuit 20 to calculate one piece of output data, and the number of input data used by the first arithmetic circuit 800 and the second arithmetic circuit 900. It depends on the number of multipliers you have. Generalizing this, the input data control unit 200 sets the number of input data simultaneously supplied to each multiplier by the input data control unit 200 to m, and the first arithmetic circuit 800 and the second arithmetic circuit 900 are provided with m. Assuming that the number of multipliers connected is n, m data are temporarily stored in the buffer 210, ceil(m/ceil(m/n)) input data are acquired from the buffer 210, and n ceil(m/ceil(m/n)) pieces of input data are supplied to ceil(m/ceil(m/n)) pieces of multipliers among the multipliers. Note that "ceil()" in "ceil(m/ceil(m/n))" indicates a function that rounds up the argument to the first decimal place.

以上のように、実施の形態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 input data, and the first arithmetic circuit 800 that outputs the output data that is the result of the arithmetic processing; The first arithmetic circuit 800 includes a storage unit 700 for storing weighting parameters and selection parameters, and a storage unit 700 for storing the input data provided by the input data control unit 200. A multiplier 300, a multiplier 301, and a multiplier 302 of a plurality of multipliers that calculate the product of data and a weight parameter stored in the storage unit 700, and an addition that calculates the sum of the products calculated by the plurality of multipliers. and a selection unit 400 that feeds back the sum calculated by the adder 500 to the adder 500 according to the selection parameter 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 piece of output data is the number of multipliers provided in the first arithmetic circuit 800 and the second arithmetic circuit 900, respectively. If: . 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 multipliers provided in the first arithmetic circuit and the second arithmetic circuit. , the input data control unit 200 divides the input data and supplies the divided input data to a plurality of multipliers at different timings to perform time division of the input data, and the plurality of multipliers and , and the adder 500 sequentially process the divided input data, and the selector 400 feeds back the input data processed by the adder 500 in the past to the adder 500 . This enables time-division processing of input data. By controlling the supply of input data to a plurality of multipliers by the input data control unit 200 and by the feedback to the adder 500 by the selection unit 400, when changing the learning or inference target of the neural network, the FPGA The configuration of the neural network circuit can be changed 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 FPGA.

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

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

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

また、実施の形態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 Embodiment 1, the input data control unit 200 supplies the first input data to the first multiplier 300 among the multiple multipliers, and the second input data is supplied to the second multiplier 301 of the plurality of multipliers, and the first multiplier 300 receives the first input data supplied by the input data control unit 200 and the weight parameter stored in the storage unit 700. , and the second multiplier 301 calculates a first product that 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 . 2, the adder 500 calculates a first sum that is the sum of the first product and the second product, and the input data control unit 200 converts the third input data into a plurality of a first multiplier 300 of the multipliers and fourth input data to a second multiplier 301 of the plurality of multipliers, the first multiplier 300 having an input data control A 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 calculates the third input data supplied by the input data control unit 200. 4 and the weight parameter stored in the storage unit 700, and the adder 500 calculates a second sum that is the sum of the third product and the fourth product. and 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 fed back by the selection unit 400 and A third sum, which is the sum with 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 Embodiment 1, the input data control unit 200 outputs a plurality of the first input data, the second input data, the third input data and the fourth input data. The input data is divided, the divided input data is supplied to the first multiplier 300 and the second multiplier 301, respectively, and the first multiplier 300 and the second multiplier 301, the adder 500 and the sequentially processes the divided input data, and the selector 400 feeds back the data processed by the adder 500 in the past to the adder 500 . The adder 500 adds the current processed data and the data fed back by the selector 400 . This enables time-division processing of input data.

また、実施の形態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, the number of multiple multipliers to n, and ceil(m/ ceil(m/n)) multipliers are supplied with ceil(m/ceil(m/n)) pieces of input data.
According to the above configuration, the number of input data used by the neural network circuit 20 to calculate one piece of output data is the number of multipliers provided in the first arithmetic circuit 800 and the second arithmetic circuit 900, respectively. Input data can be processed in parallel, as described above, if: Also, when the number of input data used by the neural network circuit 20 to calculate one output data is greater than the number of multipliers provided in the first arithmetic circuit 800 and the second arithmetic circuit 900, , time-division processing of the input data can be performed.

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

以下で、実施の形態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に供給する入力データとを異ならせることができる。
Embodiment 2 will be described below with reference to the drawings. In addition, the same reference numerals are given to the configurations having the same functions as the configurations described in the first embodiment, and the description thereof will be omitted.
FIG. 7 is a block diagram showing the configuration of neural network circuit 21 according to the second embodiment. As shown in FIG. 7, the neural network circuit 21 according to the second embodiment differs from the neural network circuit 20 according to the first embodiment in that the input data control unit 201 includes a multiplier 300, a multiplier 301, a multiplier 302, multiplier 310, multiplier 311 and multiplier 312 are individually connected. Thereby, the input data control section 201 can make the input data supplied to the multiplier 300 and the input data supplied to the multiplier 310 the same or different. Also, the input data control section 201 can make the input data supplied to the multiplier 301 and the input data supplied to the multiplier 311 different. Also, the input data control section 201 can make the input data supplied to the multiplier 302 and the input data supplied to the multiplier 312 different.

さらに、実施の形態2に係るニューラルネットワーク回路21が実施の形態1に係るニューラルネットワーク回路20と異なる点は、第2の演算回路901の加算器511の出力側が、第1の演算回路801の選択部401に接続されている点である。これにより、加算器511は、算出した和を選択部401に出力する。選択部401は、格納部700から取得した選択パラメータに応じて、加算器511が算出した和を加算器501に出力する。加算器501は、算出した和と、選択部401から取得した和との和を算出し、当該和を出力部600に出力する。 Further, the neural network circuit 21 according to the second embodiment differs from the neural network circuit 20 according to the first embodiment in that the output side of the adder 511 of the second arithmetic circuit 901 is connected to the selection of the first arithmetic circuit 801. The point is that it is connected to the unit 401 . Thereby, 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, an arithmetic processing method by the neural network circuit 21 according to Embodiment 2 will be described with reference to the drawings. FIG. 8 is a flow chart showing an arithmetic processing method by the neural network circuit 21 according to the second embodiment. 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, description of steps ST20 to ST22 is omitted.

また、ステップST21及びステップST22の各工程は、第1の演算回路801と第2の演算回路901とで、並行して行われるものとする。また、以下で説明する演算処理方法は、入力データ制御部201が、乗算器300及び乗算器310にそれぞれ異なる入力データを供給し、乗算器301及び乗算器311にそれぞれ異なる入力データを供給し、乗算器302及び乗算器312にそれぞれ異なる入力データを供給し、出力部600のみが出力データを出力する場合の例である。 Moreover, each process of step ST21 and step ST22 shall be performed in parallel by the 1st arithmetic circuit 801 and the 2nd arithmetic circuit 901. FIG. Further, in the arithmetic processing method described below, the input data control unit 201 supplies different input data to the multipliers 300 and 310, supplies different input data to the multipliers 301 and 311, This is an example in which different input data are supplied to the multipliers 302 and 312, respectively, and only the output section 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 process of step ST22, the adder 511 outputs the sum calculated in step ST22 to the selection section 401 of the first arithmetic circuit 801. FIG. Next, based on the selection parameter acquired from the storage unit 700, the selection unit 401 of the first arithmetic circuit 801 outputs the sum calculated in step ST22 by the adder 511 of the second arithmetic circuit 901 to the first arithmetic circuit. It is 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で算出した和の代わりに用いられる。 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 are described in the first embodiment instead of steps ST20 to ST22. Steps ST10 to ST17 may be performed. When the second arithmetic circuit 901 performs steps ST10 to ST17 described in the first embodiment, the third sum calculated by the adder 511 in step ST17 is calculated by the second arithmetic circuit 901 in step ST23. The adder 511 is used instead 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 multipliers 300 and 310, supplies different input data to the multipliers 301 and 311, An example of supplying different input data to the multiplier 302 and the multiplier 312 and outputting the output data from the output unit 600 has been described. On the other hand, the input data control unit 201 supplies the same input data to the multipliers 300 and 310, supplies the same input data to the multipliers 301 and 311, and supplies the same input data to the multipliers 302 and 311. 312 are supplied with the same input data, and the output unit 600 and the output unit 610 respectively output the output data, a method similar to 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 arithmetic circuit 801 causes the adder 511 of the second arithmetic circuit 901 to perform A zero value is output to the adder 501 of the first arithmetic circuit 801 instead of the calculated sum. Next, instead of steps ST24 and 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 outputs the sum calculated by the adder 511 in step ST22. The sum is directly output to the control unit 30 as output data.

次に、実施の形態2に係るニューラルネットワーク回路21の動作の具体例について説明する。図9は、当該具体例を説明するための図である。図9では、同一の行に記載されている各ブロックは、ニューラルネットワーク回路21が備えている何れかの構成が処理する各データを示し、同一の列に記載されている各データは、ニューラルネットワーク回路21が備えている何れかの構成が同時に処理する各データを示している。なお、図9において網掛けされたブロックは、当該ブロックに対応するニューラルネットワーク回路20の構成が処理を行わないことを示しているか、又は、当該ブロックに対応するニューラルネットワーク回路20の構成が処理を行っても処理結果を別の構成に出力しないことを示す。 Next, a specific example of 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 represents the neural network Each of the data is shown to be processed simultaneously by any component of circuit 21 . In addition, shaded blocks in FIG. 9 indicate that the configuration of the neural network circuit 20 corresponding to the block does not perform processing, or that the configuration of the neural network circuit 20 corresponding to the block performs processing. Indicates that the processing result will not be 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 in column I in FIG. 9, input data control section 201 simultaneously supplies input data D14 to multiplier 310, supplies input data D15 to multiplier 311, and supplies input data D15 to multiplier 311 in step ST20 described above. 312 with input data D16. At the same time when these input data are supplied, the input data control unit 201 outputs the weight parameter M14 to the multiplier 310, the weight parameter M15 to the multiplier 311, the weight parameter M15 to the multiplier 312, and the weight parameter M15 to the multiplier 312. The storage unit 700 is instructed to output M16. After these steps, multiplier 310 calculates the product of input data D14 and weight parameter M14 in step ST21 described above, and multiplier 301 calculates the product of input data D15 and 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 in column J in FIG. 9, adder 511 adds D14×M14, which is the product calculated by multiplier 310, and D15×, which is the product calculated by multiplier 301, in step ST22 described above. 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 arithmetic circuit 801 selects the sum calculated in step ST22 by the adder 511 of the second arithmetic circuit 901 based on the selection parameter acquired from the storage unit 700 in step ST23 described above. A certain D14×M14+D15×M15+D16×M16 is output to the adder 501 of the first arithmetic circuit 801. FIG. On the other hand, in step ST20 described above, the input data control section 201 simultaneously supplies input data D11 to the multiplier 300, supplies input data D12 to the multiplier 301, and supplies 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 supplies the input data D25 to the multiplier 312 at the same time as supplying these input data. Data D26 is supplied. In addition, input data control section 201 controls these parameters so that storage section 700 outputs weight parameter M11 to multiplier 300 , weight parameter M12 to multiplier 301 , and weight parameter M13 to multiplier 302 . At the same time as supplying the input data, the storage unit 700 is commanded. Further, input data control section 201 controls these parameters so that storage section 710 outputs weight parameter M24 to multiplier 310, weight parameter M25 to multiplier 311, and weight parameter M26 to multiplier 302. At the same time as supplying the input data, the storage unit 700 is commanded. Next, in step ST21 described above, multiplier 300 calculates the product of input data D11 and weight parameter M11, multiplier 301 calculates the product of input data D12 and weight parameter M12, and multiplier 302 calculates the product of input data D12 and weight parameter M12. calculates the product of the input data D13 and the weight parameter M13. In step ST21 described above, the multiplier 310 calculates the product of the input data D24 and the weight parameter M24, 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 in column K in FIG. 9, the adder 501 of the first arithmetic circuit 801 converts D11×M11, which is the product calculated by the multiplier 300 in step ST22 described above, and the multiplier 301 The sum of the calculated product D12×M12 and the product calculated by the multiplier 302 D13×M13 is calculated. Next, in step ST24 described above, adder 501 calculates the sum of this sum and D14×M14+D15×M15+D16×M16, which is the sum output from selection section 401 to adder 501 in step ST23. 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 in step ST24 by the adder 501, to the control unit 30 as output data. On the other hand, in step ST20 described above, the input data control section 201 simultaneously supplies input data D21 to the multiplier 300, supplies input data D22 to the multiplier 301, and supplies input data D23 to the multiplier 302. . In step ST20 described above, the input data control unit 201 supplies input data D34 to the multiplier 310, supplies input data D35 to the multiplier 311, and supplies input data D35 to the multiplier 312 at the same time as supplying these input data. Data D36 is supplied. Further, input data control section 201 controls these parameters so that storage section 700 outputs weight parameter M21 to multiplier 300, weight parameter M22 to multiplier 301, and weight parameter M23 to multiplier 302. At the same time as supplying the input data, the storage unit 700 is commanded. Further, input data control section 201 controls these parameters so that storage section 710 outputs weight parameter M34 to multiplier 310, weight parameter M35 to multiplier 311, and weight parameter M36 to multiplier 302. At the same time as supplying the input data, the storage unit 700 is commanded. In step ST22 described above, the adder 510 supplies the input data from the input data control unit 201 and the instruction to the storage unit 700 at the same time as D24×M24, which is the product calculated by the multiplier 310, and the multiplication The sum of D25×M25, which is the product calculated by the multiplier 311, and D26×M26, which is the product calculated by the multiplier 312, is calculated. Note that the configuration regarding the L column in FIG. 9 is the same as the configuration regarding the K column, and thus description thereof is 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 Embodiment 1 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. The selection unit 401 provided in the first arithmetic circuit 801 among the plurality of arithmetic circuits selects the adder 511 provided in the second arithmetic circuit 901 according to the selection parameter stored in the storage unit 700. The calculated sum is further output to the adder 501 provided in the first arithmetic circuit 801, and the adder 501 provided in the first arithmetic circuit 801 outputs 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 process the input data in parallel, thereby operating the neural network circuit 21 so as to shorten the arithmetic processing time. 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 outputs the calculated sum and the sum of the second arithmetic circuit 901. By calculating the sum of the sums calculated by the adder 511, it is possible to increase the number of pieces of input data that are subjected to arithmetic processing in parallel in order to output one piece of output data. This can improve the performance of the learning or inference target.
In addition, within the scope of the present 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 multiplication unit, 301 multiplier, 302 multiplier, 310 multiplier, 311 multiplier, 312 multiplier, 400 selection unit, 401 selection unit, 410 selection unit, 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 (4)

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

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (2)

* 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

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
JP2020135175A (en) 2020-08-31

Similar Documents

Publication Publication Date Title
CN107657316B (en) Design of cooperative system of general processor and neural network processor
JP6635265B2 (en) Prediction device, prediction method, and prediction program
JP6610278B2 (en) Machine learning apparatus, machine learning method, and machine learning program
US20180284703A1 (en) Machine learning device, servo control apparatus, servo control system, and machine learning method
KR102655950B1 (en) High speed processing method of neural network and apparatus using thereof
EP3754503A1 (en) Allocation system, method and apparatus for machine learning, and computer device
JPH0944356A (en) Processor and data processor
KR20190065144A (en) Processing element and operating method thereof in neural network
JP7241563B2 (en) neural network circuit
US20200226201A1 (en) Methods and Apparatus for Constructing Digital Circuits for Performing Matrix Operations
JP2022000891A5 (en)
US11900577B2 (en) Processing apparatus for performing processing using a convolutional neural network
JPH07191950A (en) Calculation network
CN115203383A (en) Method and apparatus for querying similarity vectors in a set of candidate vectors
CN109634556B (en) Multiply-accumulator and accumulation output method
JPWO2019168088A1 (en) Inference device, convolution operation execution method and program
JP7104183B2 (en) Neural network contraction device
US11475311B2 (en) Neural network instruction streaming
CN108858194B (en) Control method and device of Boolean network robot
JP2009223437A (en) New signal generation device and new signal generation method
WO2023037882A1 (en) Machine learning device
CN109144470B (en) Computing device and method
CN112394640A (en) Parameter setting method and device, storage medium and parameter setting unit
JP4436412B2 (en) Adder, synthesizing apparatus, synthesizing method, synthesizing program, synthesizing program recording medium
CN115906917B (en) Neural network model deployment method and device based on model algorithm division

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