JP7614475B2 - Calculation device and calculation method - Google Patents
Calculation device and calculation method Download PDFInfo
- Publication number
- JP7614475B2 JP7614475B2 JP2020193718A JP2020193718A JP7614475B2 JP 7614475 B2 JP7614475 B2 JP 7614475B2 JP 2020193718 A JP2020193718 A JP 2020193718A JP 2020193718 A JP2020193718 A JP 2020193718A JP 7614475 B2 JP7614475 B2 JP 7614475B2
- Authority
- JP
- Japan
- Prior art keywords
- decimal point
- output
- shift
- amount
- input
- 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
Links
Images
Landscapes
- Complex Calculations (AREA)
Description
本発明の実施形態は、演算装置、及び演算方法に関する。 Embodiments of the present invention relate to a computing device and a computing method.
エッジデバイスやAI(artificial intelligence)チップは、GPU(Graphics Processing Unit)を備えたコンピュータと比較すると資源が少ない。そのため、学習済ディープニューラルネットワークモデル(DNN(Deep Neural Network))の実行は、エッジデバイスでは困難となる。そこで、モデルの重みを軽量化するため、量子化が行われる。
通常、DNNの内部では、32ビット演算精度の浮動小数点が演算で使われる。積和演算時の桁あふれ検出やAIチップでの動作検証のため、量子化ではその精度を8ビットなど、より少ないビット幅へ変換し、演算を行うことで重みを軽量化する。
Edge devices and AI (artificial intelligence) chips have fewer resources than computers equipped with GPUs (Graphics Processing Units). Therefore, it is difficult to run a trained deep neural network model (DNN (Deep Neural Network)) on an edge device. Therefore, quantization is performed to reduce the weight of the model.
Normally, floating-point numbers with 32-bit arithmetic precision are used inside DNNs. In order to detect overflow during multiplication and accumulation operations and to verify operation on AI chips, the precision is converted to a smaller bit width, such as 8 bits, during quantization, and the weights are reduced by performing the calculations.
ニューラルネットワークの重みを量子化する技術に関して、パラメータを量子化するとき、前段階、学習中、推論中でパラメータを変更可能にする技術が知られている(例えば、特許文献1参照)。この技術では、桁あふれなどはその都度調べられ、パラメータが更新される。
また、CNN(Convolutional neural network)に対して重みを量子化し、実行する技術が知られている(例えば、特許文献2参照)。
また、浮動小数点で学習されたモデルの重みを固定小数点に変換する技術が知られている(例えば、特許文献3参照)。この技術では、統計に基づいてビット幅、シフト量などのパラメータの決定、CNNのチャンネルごとにパラメータの設定が可能である。
Regarding the technology for quantizing the weights of a neural network, a technology is known that allows parameters to be changed in the pre-stage, during learning, and during inference when quantizing the parameters (see, for example, Patent Document 1). In this technology, overflow and the like are checked each time, and the parameters are updated.
Furthermore, a technique is known in which weights are quantized for a convolutional neural network (CNN) and then executed (see, for example, Patent Document 2).
There is also known a technique for converting the weights of a model trained in floating point to fixed point (see, for example, Patent Document 3). This technique makes it possible to determine parameters such as bit width and shift amount based on statistics, and to set parameters for each CNN channel.
本発明は、前述した問題を解決すべくなされたもので、固定小数点の形式の入力値に対する学習モデルの出力値の精度を向上できる演算装置、及び演算方法を提供することを目的とする。 The present invention has been made to solve the above-mentioned problems, and aims to provide a calculation device and a calculation method that can improve the accuracy of the output value of a learning model for input values in fixed-point format.
本発明の一実施形態は、ニューラルネットワーク形式の学習モデルのパラメータの小数点のシフト量を特定する情報を取得する取得部と、前記取得部が取得したパラメータの小数点のシフト量を特定する情報に基づいて、異なるビット幅で固定小数点の形式へ変換された複数の入力値に対する前記学習モデルの出力値を求め、求めた複数の前記出力値の各々と出力値の小数点のシフト量とに基づいて、求めた複数の前記出力値の各々の小数点をシフトさせる演算部と、複数の前記出力値の各々の小数点をシフトさせた結果の精度を導出する導出部と、を備え、前記入力値は、固定小数点の形式である、演算装置である。
本発明の一実施形態は、前述の演算装置において、前記パラメータには、複数の層の各々のパラメータが含まれる。
本発明の一実施形態は、前述の演算装置において、前記パラメータには、ウエイトおよび出力が含まれる。
本発明の一実施形態は、前述の演算装置において、前記パラメータには、バイアスがさらに含まれる。
本発明の一実施形態は、前述の演算装置において、前記パラメータは、固定小数点の形式である。
本発明の一実施形態は、前述の演算装置において、前記学習モデルは、ディープニューラルネットワーク形式の学習済モデルに基づいて、パラメータを固定小数点の形式に変換することによって作成されたものである。
本発明の一実施形態は、前述の演算装置において、前記演算部は、前記パラメータに基づいて、入力値に対して、MAC(multiply-accumulate)演算を行う。
One embodiment of the present invention is a calculation device comprising: an acquisition unit that acquires information specifying the amount of decimal point shift of parameters of a neural network format learning model; a calculation unit that calculates output values of the learning model for multiple input values converted to fixed-point format with different bit widths based on the information specifying the amount of decimal point shift of the parameters acquired by the acquisition unit, and shifts the decimal point of each of the calculated multiple output values based on each of the calculated multiple output values and the amount of decimal point shift of the output value; and a derivation unit that derives the accuracy of the result of shifting the decimal point of each of the calculated multiple output values , wherein the input values are in fixed-point format.
In one embodiment of the present invention, in the aforementioned computing device, the parameters include parameters for each of a plurality of layers.
In one embodiment of the present invention, in the aforementioned computing device, the parameters include weights and outputs.
In one embodiment of the present invention, in the aforementioned computing device, the parameters further include a bias.
In one embodiment of the present invention, in the aforementioned arithmetic device, the parameters are in a fixed-point format.
One embodiment of the present invention is in the aforementioned computing device, wherein the learning model is created by converting parameters into fixed-point format based on a trained model in deep neural network format.
One embodiment of the present invention is the aforementioned arithmetic device, wherein the arithmetic unit performs a MAC (multiply-accumulate) operation on an input value based on the parameter .
本発明の一実施形態は、ニューラルネットワーク形式の学習モデルのパラメータの小数点のシフト量を特定する情報を取得するステップと、取得する前記ステップで取得したパラメータの小数点のシフト量を特定する情報に基づいて、異なるビット幅で固定小数点の形式へ変換された複数の入力値に対する前記学習モデルの出力値を求め、求めた複数の前記出力値の各々と出力値の小数点のシフト量とに基づいて、求めた複数の前記出力値の各々の小数点をシフトさせるステップと、複数の前記出力値の各々の小数点をシフトさせた結果の精度を導出するステップと、を有し、前記入力値は、固定小数点の形式である、コンピュータが実行する演算方法である。 One embodiment of the present invention is a computer-executed calculation method comprising the steps of: acquiring information specifying the amount of decimal point shift of parameters of a neural network-type learning model; determining output values of the learning model for multiple input values converted to fixed-point format with different bit widths based on the information specifying the amount of decimal point shift of the parameters acquired in the acquiring step; shifting the decimal point of each of the multiple output values based on each of the multiple output values and the amount of decimal point shift of the output value; and deriving the precision of the result of shifting the decimal point of each of the multiple output values , wherein the input values are in fixed-point format.
本発明の実施形態によれば、固定小数点の形式の入力値に対する学習モデルの出力値の精度を向上できる演算装置、及び演算方法を提供できる。 According to an embodiment of the present invention, it is possible to provide a calculation device and a calculation method that can improve the accuracy of the output value of a learning model for an input value in fixed-point format.
次に、本発明の実施形態に係る演算装置、及び演算方法を、図面を参照しつつ説明する。以下で説明する実施形態は一例に過ぎず、本発明が適用される実施形態は、以下の実施形態に限られない。
なお、実施形態を説明するための全図において、同一の機能を有するものは同一符号を用い、繰り返しの説明は省略する。
また、本願でいう「XXに基づく」とは、「少なくともXXに基づく」ことを意味し、XXに加えて別の要素に基づく場合も含む。また、「XXに基づく」とは、XXを直接に用いる場合に限定されず、XXに対して演算や加工が行われたものに基づく場合も含む。「XX」は、任意の要素(例えば、任意の情報)である。
Next, a calculation device and a calculation method according to an embodiment of the present invention will be described with reference to the drawings. The embodiment described below is merely an example, and the embodiment to which the present invention is applied is not limited to the following embodiment.
In addition, in all the drawings for explaining the embodiments, the same reference numerals are used for the parts having the same functions, and the repeated explanation is omitted.
In addition, in this application, "based on XX" means "based on at least XX" and includes cases where it is based on other elements in addition to XX. Furthermore, "based on XX" is not limited to cases where XX is directly used, but also includes cases where it is based on XX that has been calculated or processed. "XX" is any element (for example, any information).
(実施形態)
[全体構成]
図1は、本発明の実施形態に係る演算装置の構成図である。
演算装置100に、入力値が入力される。入力値の一例は、浮動小数点の形式である。以下、入力値が、浮動小数点の形式である場合について説明を続ける。
演算装置100は、入力された入力値を受け付ける。演算装置100は、受け付けた入力値を浮動小数点の形式から固定小数点の形式へ変換する。固定小数点の形式へ変換するときの桁数(ビット幅)nは、予め設定されている。
(Embodiment)
[Overall configuration]
FIG. 1 is a configuration diagram of a computing device according to an embodiment of the present invention.
An input value is input to the
The
演算装置100は、学習モデルに基づいて、その学習モデルに含まれるパラメータの小数点のシフト量を特定する情報を取得する。学習モデルの一例は、ディープニューラルネットワークなどのニューラルネットワーク形式の学習モデルである。学習モデルの一例は、Pytonで記述されている。
演算装置100は、固定小数点の形式へ変換後の入力値およびパラメータの小数点のシフト量を特定する情報に基づいて、入力値に対する学習モデルの出力値を演算する。
演算装置100は、学習モデルの出力値の演算結果を導出する際に、出力値の小数点のシフト量osfに基づいて、積和演算の結果の小数点をシフトさせることによって最終出力値を導出する。演算装置100は、導出した最終出力値を出力する。
以下、演算装置100について説明する。
The
The
When deriving the calculation result of the output value of the learning model, the
The
[演算装置100]
演算装置100は、スマートフォン、携帯端末、又はパーソナルコンピュータ、タブレット端末装置、あるいはその他の情報処理機器として実現される。演算装置100は、例えば、入力部110と、受付部120と、取得部125と、演算部130と、出力部140と、記憶部150とを備える。
[Calculation device 100]
The
入力部110は、入力デバイスを備える。入力部110には、入力値を特定する情報が入力される。入力部110は、入力された入力値を特定する情報を取得する。入力値の一例は、32ビットの浮動小数点の形式の数である。以下、一例として、入力値が32ビットの浮動小数点の形式の数である場合について説明を続ける。
The
記憶部150は、HDD(Hard Disk Drive)やフラッシュメモリ、RAM(Random Access Memory)、ROM(Read Only Memory)などにより実現される。記憶部150は、学習モデル152とシフト量情報154とが記憶される。
学習モデル152の一例は、ディープニューラルネットワーク形式の学習モデルである。この学習モデル152は、量子化されている。学習モデルを量子化する方法については、後述する。以下、学習モデル152が、ディープニューラルネットワーク形式の量子化された学習モデルである場合について説明を続ける。
The
An example of the
図2は、本実施形態に係る演算装置が有する学習モデルの一例を示す図である。図2は、学習モデル152の一例として、ディープニューラルネットワーク形式の量子化された学習モデル152を示す。
学習モデル152は、入力層151-1と、中間層151-2と、出力層151-3とを備える。入力層151-1は一または複数のユニットを有し、中間層151-2は一または複数のユニットを有し、出力層151-3は一または複数のユニットを有する。入力層151-1に含まれる一または複数のユニットの各々は、中間層151-2に含まれる一または複数のユニットの各々と、一または複数のリンクによって接続される。中間層151-2に含まれる一または複数のユニットの各々は、出力層151-3に含まれる一または複数のユニットの各々と、一または複数のリンクによって接続される。
2 is a diagram showing an example of a learning model included in the arithmetic device according to the present embodiment. As an example of the
The
一または複数のユニットの各々は、一または複数の他のユニットが出力した情報を取得し、取得した情報を処理する。一または複数のユニットの各々は、情報を処理した結果を出力する。具体的には、一または複数のユニットの各々は、一または複数の入力値を取得する。一または複数のユニットの各々は、取得した一または複数の入力値とパラメータとに基づいて、出力を導出する。ここで、パラメータには、ウエイトが含まれる。
さらに、パラメータには、バイアスが含まれてもよい。一例として、パラメータには、ウエイトとバイアスとが含まれる場合について説明を続ける。一または複数のユニットの各々は、一または複数の入力値と一または複数のウエイトとをそれぞれ乗算した結果の和とバイアスとを加算する。
Each of the one or more units acquires information output by one or more other units and processes the acquired information. Each of the one or more units outputs a result of processing the information. Specifically, each of the one or more units acquires one or more input values. Each of the one or more units derives an output based on the acquired one or more input values and parameters. Here, the parameters include weights.
Furthermore, the parameters may include a bias. As an example, the description will be continued assuming that the parameters include a weight and a bias. Each of the one or more units multiplies one or more input values by one or more weights, respectively, and adds the sum of the results and the bias.
シフト量情報154は、学習モデル152に含まれる入力層151-1と中間層151-2と出力層151-3との各々の入力値の小数点のシフト量を特定する情報と、パラメータの小数点のシフト量を特定する情報と、入力層151-1と中間層151-2と出力層151-3との各々の出力の小数点のシフト量を特定する情報とを記憶する。パラメータには、ウエイトとバイアスとが含まれる。
つまり、パラメータの小数点のシフト量を特定する情報には、ウエイトの小数点のシフト量wsfを特定する情報とバイアスの小数点のシフト量を特定する情報とが含まれる。入力層151-1と中間層151-2と出力層151-3との各々の入力値の小数点のシフト量を特定する情報と、パラメータの小数点のシフト量と、入力層151-1と中間層151-2と出力層151-3との各々の出力の小数点のシフト量とを導出する方法については、後述する。
The
That is, the information specifying the amount of shift of the decimal point of the parameter includes information specifying the amount of shift of the decimal point of the weight wsf and information specifying the amount of shift of the decimal point of the bias. A method for deriving information specifying the amount of shift of the decimal point of the input value of each of the input layer 151-1, the intermediate layer 151-2, and the output layer 151-3, the amount of shift of the decimal point of the parameter, and the amount of shift of the decimal point of the output of each of the input layer 151-1, the intermediate layer 151-2, and the output layer 151-3 will be described later.
受付部120は、入力部110に入力された入力値を特定する情報を取得し、取得した入力値を特定する情報を受け付ける。受付部120が受け付けた入力値を特定する情報は、演算部130へ出力される。
取得部125は、受付部120が入力値を特定する情報を受け付けた場合に、記憶部150のシフト量情報154に記憶されている入力層と中間層と出力層との各々の入力値の小数点のシフト量を特定する情報と、パラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とを取得する。取得部125が取得した入力層と中間層と出力層との各々の入力値の小数点のシフト量を特定する情報と、パラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とは、演算部130へ出力される。
The receiving
When the receiving
演算部130は、受付部120が受け付けた入力値を特定する情報を取得する。演算部130は、取得した入力値を特定する情報と、入力値の小数点のシフト量を特定する情報とに基づいて、式(1)を演算することによって入力値を固定小数点の形式へ変換する。
例えば、演算部130は、ビット幅nを8とした場合には、32ビットの浮動小数点の形式の入力値を、8ビットの固定小数点の形式に変換する。
The
For example, when the bit width n is 8, the
図3は、本実施形態に係る演算装置が処理する浮動小数点の形式の入力値の一例を説明するための図である。
図3に示すように、浮動小数点形式の入力値200は、符号ビット210、指数部220および仮数部230を含む。浮動小数点は、1つの数を、小数点部分を示す部分と小数点位置を示す部分とに分けて表現する表記法である。仮数部230は、小数点部分を示す部分であり、指数部220は小数点位置を示す部分である。符号ビット210は、入力値200の符号を決定する部分である。
FIG. 3 is a diagram for explaining an example of an input value in a floating-point format processed by the arithmetic device according to the present embodiment.
3, an
図4は、本実施形態に係る演算装置が処理する固定小数点の形式の入力値の一例を説明するための図である。
図4に示すように、固定小数点形式の入力値205は、符号ビット215、整数部225、小数部235および小数点245を含む。固定小数点は、小数点を使用して固定された桁数の小数を示す表記法を意味する。符号ビット215は入力値205の符号を決定し、整数部225は入力値205の整数を示す部分に対応し、小数部235は入力値205の小数を示す部分に対応する。小数点245は、入力値205の整数部225および小数部235を区分する基準になる点を示す。
FIG. 4 is a diagram for explaining an example of an input value in a fixed-point format processed by the arithmetic device according to the present embodiment.
4, the
演算部130は、取得部125が取得した入力層と中間層と出力層との各々の入力値の小数点のシフト量を特定する情報と、パラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とを取得する。
演算部130は、取得した入力層と中間層と出力層との各々の入力値の小数点のシフト量を特定する情報と、パラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とに基づいて、入力値に対する学習モデル152の出力値を演算する。
The
The
図5は、本実施形態に係る演算装置が実行する演算の一例を説明するための図である。図5は、演算部130が実行するMAC(multiply-and-accumulate)演算を示す。
演算部130は、乗算器10と加算器20と加算器30とを備え、積和演算を行う。演算部130は、入力値inとパラメータの小数点のシフト量を特定する情報とを取得する。ここで、入力値inは、入力値の小数点のシフト量isfを特定する情報に基づいて、固定小数点の形式に変換されたものである。
演算部130は、パラメータの小数点のシフト量を特定する情報に基づいて、ウエイトWEの小数点をシフトさせる。
演算部130において、乗算器10は、入力値inと小数点をシフトさせたウエイトWEとを乗算する。加算器20は、入力値inと小数点をシフトさせたウエイトWEとを乗算した結果とを加算する。加算器30は、加算器20の出力値OUと出力の小数点のシフト量osfとに基づいて、出力値OUの小数点をシフトさせることによって、最終出力を導出する。具体的には、加算器30は、出力値OUに0.5を加算する。出力値OUの小数点をシフトさせることによって、出力値OUの精度を向上させることができる。
5 is a diagram for explaining an example of a calculation executed by the calculation device according to the present embodiment. FIG. 5 shows a MAC (multiply-and-accumulate) calculation executed by the
The
The
In the
ここで、入力値の小数点のシフト量を特定する情報と、パラメータの小数点のシフト量の導出する処理について説明する。
入力値の小数点のシフト量を特定する情報と、パラメータの小数点のシフト量との導出は、端末装置によって実行される。
端末装置は、記憶している学習モデルから入力層を取得し、取得した入力層に含まれるウエイトとバイアスとに基づいて、入力層のウエイトの小数点のシフト量とバイアスの小数点のシフト量とを導出する。端末装置は、導出した入力層のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とを記憶する。
端末装置は、ウエイトとバイアスとを固定小数点の形式に変換する。端末装置は、固定小数点の形式に変換したウエイトとバイアスとを含む入力層を新たに作成する。端末装置は、記憶している学習モデルの入力層を、新たに作成した入力層に交換する。
Here, information for specifying the amount of shift of the decimal point of the input value and a process for deriving the amount of shift of the decimal point of the parameter will be described.
The derivation of the information specifying the amount of shift of the decimal point of the input value and the amount of shift of the decimal point of the parameter is performed by the terminal device.
The terminal device acquires an input layer from the stored learning model, and derives the amount of shift of the decimal point of the weights of the input layer and the amount of shift of the decimal point of the bias based on the weights and biases included in the acquired input layer. The terminal device stores information specifying the amount of shift of the decimal point of the weights of the derived input layer and information specifying the amount of shift of the decimal point of the bias.
The terminal device converts the weights and biases into a fixed-point format. The terminal device creates a new input layer including the weights and biases converted into the fixed-point format. The terminal device replaces the input layer of the stored learning model with the newly created input layer.
端末装置は、記憶している学習モデルから中間層を取得し、取得した中間層に含まれるウエイトとバイアスとに基づいて、中間層のウエイトの小数点のシフト量とバイアスの小数点のシフト量とを導出する。端末装置は、導出した中間層のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とを記憶する。
端末装置は、ウエイトとバイアスとを固定小数点の形式に変換する。端末装置は、固定小数点の形式に変換したウエイトとバイアスとを含む中間層を新たに作成する。端末装置は、記憶している学習モデルの中間層を、新たに作成した中間層に交換する。
The terminal device acquires an intermediate layer from the stored learning model, and derives the amount of shift of the decimal point of the weights of the intermediate layer and the amount of shift of the decimal point of the bias based on the weights and biases included in the acquired intermediate layer. The terminal device stores information specifying the amount of shift of the decimal point of the weights of the intermediate layer and information specifying the amount of shift of the decimal point of the bias.
The terminal device converts the weights and biases into a fixed-point format. The terminal device creates a new intermediate layer including the weights and biases converted into the fixed-point format. The terminal device replaces the intermediate layer of the stored learning model with the newly created intermediate layer.
端末装置は、記憶している学習モデルから出力層を取得し、取得した出力層に含まれるウエイトとバイアスとに基づいて、出力層のウエイトの小数点のシフト量とバイアスの小数点のシフト量とを導出する。端末装置は、導出した出力層のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とを記憶する。
端末装置は、ウエイトとバイアスとを固定小数点の形式に変換する。端末装置は、固定小数点の形式に変換したウエイトとバイアスとを含む出力層を新たに作成する。端末装置は、記憶している学習モデルの出力層を、新たに作成した出力層に交換する。以上で、量子化した学習モデルが完成する。
The terminal device acquires an output layer from the stored learning model, and derives the amount of shift of the decimal point of the weights of the output layer and the amount of shift of the decimal point of the bias based on the weights and biases included in the acquired output layer. The terminal device stores information specifying the amount of shift of the decimal point of the weights of the output layer and information specifying the amount of shift of the decimal point of the bias derived.
The terminal device converts the weights and biases into a fixed-point format. The terminal device creates a new output layer including the weights and biases converted into the fixed-point format. The terminal device replaces the output layer of the stored learning model with the newly created output layer. This completes the quantized learning model.
量子化した学習モデルに含まれるウエイトとバイアスとは、浮動小数点の形式から固定小数点の形式へ変換されている。量子化した学習モデルを使用することによって、積和演算などを固定小数点の形式で実行できる。このため、エッジデバイスやAIチップでそのまま実行できる。
ただし、このままでは、学習モデルの演算結果の精度が低下する。この学習モデルの演算結果の精度の低下は、演算精度の減少だけが原因ではない。浮動小数点の形式の学習モデルでは、出力部分で(式1)の演算を行っている。
しかし、量子化された学習モデルの出力部分では(式1)と同等の処理をしてない。そのため、すべての層において、入力値、ウエイト、出力のシフト量から、整数でも実行できるようにすることによって、量子化された学習モデルの各層において、出力OUに、出力の小数点のシフト量を適用する。このように構成することによって、演算結果の精度の低下を防止できる。
The weights and biases included in the quantized learning model are converted from floating-point format to fixed-point format. By using the quantized learning model, multiplication and accumulation operations can be performed in fixed-point format. This allows them to be executed directly on edge devices and AI chips.
However, if this continues, the accuracy of the calculation results of the learning model will decrease. The decrease in accuracy of the calculation results of this learning model is not only caused by the decrease in calculation accuracy. In the learning model in the floating-point format, the calculation of (Equation 1) is performed in the output part.
However, the output part of the quantized learning model does not perform the same processing as (Equation 1). Therefore, in all layers, the input value, weight, and output shift amount are made executable even with integers, and the output decimal point shift amount is applied to the output OU in each layer of the quantized learning model. By configuring in this way, it is possible to prevent a decrease in the accuracy of the calculation result.
端末装置は、入力された入力値を特定する情報を取得し、取得した入力値を特定する情報を受け付ける。端末装置は、記憶している入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報を取得する。端末装置は、取得した入力値を特定する情報に基づいて、入力値を固定小数点の形式に変換する。
端末装置は、取得した入力層のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報に基づいて、固定小数点の形式に変換した入力値に対する量子化した学習モデルの入力層の出力を導出する。端末装置は、導出した入力層の出力に基づいて、入力層の出力の小数点のシフト量を導出する。このように構成することによって、仮に入力層の出力が量子化されていない場合でも、量子化を行うことができる。端末装置は、導出した入力層の出力の小数点のシフト量、換言すれば中間層の入力値の小数点のシフト量を特定する情報を記憶する。
The terminal device acquires information for identifying an input value that has been input, and accepts the information for identifying the acquired input value. The terminal device acquires information for identifying the amount of shift of the decimal point of each parameter of the stored input layer, intermediate layer, and output layer. The terminal device converts the input value into a fixed-point format based on the information for identifying the acquired input value.
The terminal device derives the output of the input layer of the quantized learning model for the input value converted to fixed-point format based on the acquired information specifying the shift amount of the decimal point of the weight of the input layer and the information specifying the shift amount of the decimal point of the bias. The terminal device derives the shift amount of the decimal point of the output of the input layer based on the derived output of the input layer. By configuring in this way, quantization can be performed even if the output of the input layer is not quantized. The terminal device stores information specifying the shift amount of the decimal point of the derived output of the input layer, in other words, the shift amount of the decimal point of the input value of the intermediate layer.
端末装置は、取得した中間層のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報に基づいて、量子化した学習モデルの入力層の出力値に対する量子化した学習モデルの中間層の出力を導出する。端末装置は、導出した中間層の出力に基づいて、中間層の出力の小数点のシフト量を導出する。
このように構成することによって、仮に中間層の出力が量子化されていない場合でも、量子化を行うことができる。端末装置は、導出した中間層の出力の小数点のシフト量、換言すれば出力層の入力値の小数点のシフト量を特定する情報を記憶する。
The terminal device derives an output of the intermediate layer of the quantized learning model for the output value of the input layer of the quantized learning model based on the acquired information specifying the shift amount of the decimal point of the intermediate layer weight and the information specifying the shift amount of the decimal point of the bias. The terminal device derives the shift amount of the decimal point of the intermediate layer output based on the derived output of the intermediate layer.
By configuring in this way, even if the output of the intermediate layer is not quantized, quantization can be performed. The terminal device stores information specifying the amount of shift of the decimal point of the derived output of the intermediate layer, in other words, the amount of shift of the decimal point of the input value of the output layer.
端末装置は、取得した出力層のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報に基づいて、量子化した学習モデルの中間層の出力値に対する量子化した学習モデルの出力層の出力を導出する。
端末装置は、導出した出力層の出力に基づいて、分散などの演算を行うことによって、出力層の出力の小数点のシフト量を導出する。このように構成することによって、仮に出力層の出力が量子化されていない場合でも、量子化を行うことができる。端末装置は、導出した出力層の出力の小数点のシフト量を特定する情報を記憶する。
以下、端末装置300について説明する。
図6は、本実施形態に係る端末装置のパラメータの小数点のシフト量の導出を説明するための図である。
The terminal device derives the output of the output layer of the quantized learning model for the output value of the intermediate layer of the quantized learning model based on the information specifying the amount of shift of the decimal point of the weight of the output layer and the information specifying the amount of shift of the decimal point of the bias acquired.
The terminal device derives the amount of shift of the decimal point of the output of the output layer by performing a calculation such as variance based on the derived output of the output layer. By configuring in this way, even if the output of the output layer is not quantized, quantization can be performed. The terminal device stores information that specifies the amount of shift of the decimal point of the derived output of the output layer.
The
FIG. 6 is a diagram for explaining derivation of the decimal point shift amount of the parameter of the terminal device according to this embodiment.
[端末装置300]
端末装置300は、パーソナルコンピュータ、サーバー、タブレットコンピュータ又は産業用コンピュータ等の装置によって実現される。端末装置300は、例えば、入力部310と、受付部320と、取得部325と、演算部330と、出力部340と、記憶部350とを備える。
[Terminal Device 300]
The
記憶部350は、HDDやフラッシュメモリ、RAM、ROMなどにより実現される。記憶部350は、学習モデル352とシフト量情報354とが記憶される。
学習モデル352の一例は、ディープニューラルネットワーク形式の学習済の学習モデルである。以下、学習モデル352が、ディープニューラルネットワーク形式の学習済の学習モデルである場合について説明を続ける。
The
An example of the
図7は、本実施形態に係る端末装置が有する学習モデルの一例を示す図である。
学習モデル352は、入力層351-1と、中間層351-2と、出力層351-3とを備える。入力層351-1は一または複数のユニットを有し、中間層351-2は一または複数のユニットを有し、出力層351-3は一または複数のユニットを有する。
入力層351-1に含まれる一または複数のユニットの各々は、中間層351-2に含まれる一または複数のユニットの各々と、一または複数のリンクによって接続される。中間層351-2に含まれる一または複数のユニットの各々は、出力層351-3に含まれる一または複数のユニットの各々と、一または複数のリンクによって接続される。
FIG. 7 is a diagram showing an example of a learning model possessed by a terminal device according to this embodiment.
The
Each of one or more units included in the input layer 351-1 is connected to each of one or more units included in the hidden layer 351-2 by one or more links. Each of one or more units included in the hidden layer 351-2 is connected to each of one or more units included in the output layer 351-3 by one or more links.
一または複数のユニットの各々は、一または複数の他のユニットが出力した情報を取得し、取得した情報を処理する。一または複数のユニットの各々は、情報を処理した結果を出力する。具体的には、一または複数のユニットの各々は、一または複数の入力値を取得する。一または複数のユニットの各々は、取得した一または複数の入力値とパラメータとに基づいて、出力を導出する。ここで、パラメータには、ウエイトとバイアスとが含まれる。一または複数のユニットの各々は、一または複数の入力値と一または複数のウエイトとをそれぞれ乗算した結果の和とバイアスとを加算する。 Each of the one or more units acquires information output by one or more other units and processes the acquired information. Each of the one or more units outputs the result of processing the information. Specifically, each of the one or more units acquires one or more input values. Each of the one or more units derives an output based on the acquired one or more input values and parameters. Here, the parameters include weights and biases. Each of the one or more units adds the sum of the results of multiplying the one or more input values by the one or more weights and the bias.
演算部330は、記憶部350の学習モデル352から入力層351-1を取得する(1)。演算部330は、取得した入力層351-1に含まれるウエイトとバイアスとに基づいて、分散などの演算を行うことによって、入力層351-1のウエイトの小数点のシフト量とバイアスの小数点のシフト量とを導出する。演算部330は、導出した入力層351-1のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とを記憶部350のシフト量情報354に記憶させる。
演算部330は、ウエイトとバイアスとを固定小数点の形式に変換する。演算部330は、固定小数点の形式に変換したウエイトとバイアスとを含む入力層351a-1を作成する(2)。演算部330は、記憶部350の学習モデル352の入力層351-1を、作成した入力層351a-1に交換する(3)。
The
The
演算部330は、中間層351-2を取得する。演算部330は、取得した中間層351-2に含まれるウエイトとバイアスとに基づいて、分散などの演算を行うことによって、中間層351-2のウエイトの小数点のシフト量とバイアスの小数点のシフト量とを導出する。演算部330は、導出した中間層351-2のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とを、記憶部350のシフト量情報354に記憶させる。
演算部330は、ウエイトとバイアスとを固定小数点の形式に変換する。演算部130は、固定小数点の形式に変換したウエイトとバイアスとを含む中間層351a-2を作成する。演算部330は、学習モデル352の中間層351-2を、作成した中間層351a-2に交換する。
The
The
演算部330は、出力層351-3を取得する。演算部330は、取得した出力層351-3に含まれるウエイトとバイアスとに基づいて、分散などの演算を行うことによって、出力層351-3のウエイトの小数点のシフト量とバイアスの小数点のシフト量とを導出する。
演算部330は、導出した出力層351-3のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とを、記憶部350のシフト量情報354に記憶させる。
演算部330は、ウエイトとバイアスとを固定小数点の形式に変換する。演算部330は、固定小数点の形式に変換したウエイトとバイアスとを含む出力層351a-3を作成する。演算部330は、学習モデル352の出力層351-3を、作成した出力層351a-3に交換する(4)。
前述した処理を行うことによって、演算部330は、学習モデル352から、量子化した学習モデル352aを作成する。
演算部330は、入力層351-1のウエイトの小数点のシフト量とバイアスの小数点のシフト量と、中間層351-2のウエイトの小数点のシフト量とバイアスの小数点のシフト量と、出力層351-3のウエイトの小数点のシフト量wsfとバイアスの小数点のシフト量とを導出できる。
The
The
The
By performing the above-described processing, the
The
入力部310は、入力デバイスを備える。例えば、この入力デバイスには、キーボード等の文字情報を入力するデバイス、マウス、タッチパネル等のポインティングデバイス、釦、ダイヤル、ジョイスティック、タッチセンサ、タッチパッド等が含まれる。入力部310に入力値を特定する情報が入力される。入力部310は、入力された入力値を特定する情報を取得する。入力値の一例は、32ビットの浮動小数点の形式の数である。以下、一例として、入力値が32ビットの浮動小数点の形式の数である場合について説明を続ける。
The
受付部320は、入力部310に入力された入力値を特定する情報を取得し、取得した入力値を特定する情報を受け付ける。受付部320が受け付けた入力値を特定する情報は、演算部330へ出力される。
The
取得部325は、受付部320が入力値を特定する情報を受け付けた場合に、記憶部350のシフト量情報354に記憶されている入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報を取得する。取得部325が取得した入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報は、演算部330へ出力される。
When the receiving
演算部330は、受付部320が受け付けた入力値を特定する情報を取得する。演算部330は、取得した入力値を特定する情報に基づいて、入力値を固定小数点の形式に変換する。
演算部330は、取得部325から入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報を取得する。演算部330は、取得した入力層351-1のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報に基づいて、固定小数点の形式に変換した入力値に対する量子化した学習モデル352aの入力層351a-1の出力を導出する。
演算部330は、導出した入力層351a-1の出力に基づいて、分散などの演算を行うことによって、入力層351a-1の出力の小数点のシフト量を導出する。このように構成することによって、仮に入力層351a-1の出力が量子化されていない場合でも、量子化を行うことができる。演算部330は、導出した入力層351a-1の出力の小数点のシフト量、換言すれば中間層351a-2の入力の小数点のシフト量を特定する情報を記憶部350のシフト量情報354に記憶させる。
The
The
The
演算部330は、取得した中間層351a-2のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報に基づいて、学習モデル352aの入力層351a-1の出力値に対する量子化した学習モデル352aの中間層351a-2の出力を導出する。
演算部330は、導出した中間層351a-2の出力に基づいて、分散などの演算を行うことによって、中間層351a-2の出力の小数点のシフト量を導出する。このように構成することによって、仮に中間層351a-2の出力が量子化されていない場合でも、量子化を行うことができる。演算部330は、導出した中間層351a-2の出力の小数点のシフト量、換言すれば出力層351a-3の入力の小数点のシフト量を特定する情報を記憶部350のシフト量情報354に記憶させる。
演算部330は、取得した出力層351a-3のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報に基づいて、学習モデル352aの中間層351a-2の出力値に対する量子化した学習モデル352aの出力層351a-3の出力を導出する。
The
The
The
演算部330は、導出した出力層351a-3の出力に基づいて、分散などの演算を行うことによって、出力層351a-3の出力の小数点のシフト量を導出する。このように構成することによって、仮に出力層351a-3の出力が量子化されていない場合でも、量子化を行うことができる。演算部330は、導出した出力層351a-3の出力の小数点のシフト量を特定する情報を記憶部350のシフト量情報354に記憶させる。
前述した処理を行うことによって、演算部330は、入力層351a-1の出力の小数点のシフト量、換言すれば中間層351a-2の入力の小数点のシフト量と、中間層351a-2の出力の小数点のシフト量、換言すれば出力層351a-3の入力の小数点のシフト量と、出力層351a-3の出力の小数点のシフト量とを導出する。
端末装置300によって作成された量子化した学習モデル352aが、演算装置100において学習モデル152として使用される。端末装置300によって作成されたシフト量情報354が、演算装置100においてシフト量情報154として使用される。
The
By performing the above-mentioned processing, the
The
(演算装置100の動作)
図8は、本実施形態に係る演算装置の動作の一例を示すフローチャートである。
(ステップS1-1)
演算装置100において、受付部120は、入力部110に入力された入力値を特定する情報を取得し、取得した入力値を特定する情報を受け付ける。
(ステップS2-1)
演算装置100において、取得部125は、記憶部150のシフト量情報154に記憶されている入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とを取得する。入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報には、入力層の入力値の小数点のシフト量を特定する情報と、中間層の入力値の小数点のシフト量を特定する情報と、出力層の入力値の小数点のシフト量を特定する情報とが含まれる。
(Operation of the arithmetic device 100)
FIG. 8 is a flowchart showing an example of the operation of the arithmetic device according to the present embodiment.
(Step S1-1)
In the
(Step S2-1)
In the
(ステップS3-1)
演算装置100において、演算部130は、受付部120が受け付けた入力値を特定する情報を取得する。演算部130は、取得した入力値を特定する情報と、入力値の小数点のシフト量を特定する情報とに基づいて、入力値を固定小数点の形式へ変換する。
(ステップS4-1)
演算装置100において、演算部130は、取得部125が取得した入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とを取得する。演算部130は、取得した入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とに基づいて、入力値に対する出力値OUを演算する。
(ステップS5-1)
演算装置100において、演算部130は、出力値OUと出力の小数点のシフト量osfとに基づいて、出力値OUの小数点をシフトさせることによって、最終出力を導出する。
(Step S3-1)
In the
(Step S4-1)
In the
(Step S5-1)
In the
(端末装置300の動作)
図9は、本実施形態に係る端末装置の動作の一例を示すフローチャートである。
(ステップS1-2)
端末装置300において、演算部330は、記憶部350の学習モデル352から入力層351-1を取得する。演算部330は、取得した入力層351-1に含まれるウエイトとバイアスとに基づいて、入力層351-1のウエイトの小数点のシフト量とバイアスの小数点のシフト量とを導出する。
演算部330は、導出した入力層351-1のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とを記憶部350のシフト量情報354に記憶させる。
(ステップS2-2)
端末装置300において、演算部330は、入力層351-1のウエイトとバイアスとを固定小数点の形式に変換する。
(Operation of Terminal Device 300)
FIG. 9 is a flowchart showing an example of the operation of the terminal device according to this embodiment.
(Step S1-2)
In the
The
(Step S2-2)
In the
(ステップS3-2)
端末装置300において、演算部330は、固定小数点の形式に変換したウエイトとバイアスとを含む入力層351a-1を作成する。演算部330は、記憶部350の学習モデル352の入力層351-1を、作成した入力層351a-1に交換する。
(ステップS4-2)
端末装置300において、演算部330は、記憶部350の学習モデル352から中間層351-2を取得する。演算部330は、取得した中間層351-2に含まれるウエイトとバイアスとに基づいて、中間層351-2のウエイトの小数点のシフト量とバイアスの小数点のシフト量とを導出する。演算部330は、導出した中間層351-2のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とを記憶部350のシフト量情報354に記憶させる。
(ステップS5-2)
端末装置300において、演算部330は、中間層351-2のウエイトとバイアスとを固定小数点の形式に変換する。
(Step S3-2)
In the
(Step S4-2)
In the
(Step S5-2)
In the
(ステップS6-2)
端末装置300において、演算部130は、固定小数点の形式に変換したウエイトとバイアスとを含む中間層351a-2を作成する。演算部330は、学習モデル352の中間層351-2を、作成した中間層351a-2に交換する。
(ステップS7-2)
端末装置300において、演算部330は、記憶部350の学習モデル352から出力層351-3を取得する。演算部330は、取得した出力層351-3に含まれるウエイトとバイアスとに基づいて、出力層351-3のウエイトの小数点のシフト量を導出する。演算部330は、導出した出力層351-3のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とを記憶部350のシフト量情報354に記憶させる。
(Step S6-2)
In the
(Step S7-2)
In the
(ステップS8-2)
端末装置300において、演算部330は、出力層351-3のウエイトとバイアスとを固定小数点の形式に変換する。
(ステップS9-2)
端末装置300において、演算部330は、固定小数点の形式に変換したウエイトとバイアスとを含む出力層351a-3を作成する。演算部330は、学習モデル352の出力層351-3を、作成した出力層351a-3に交換する。
(ステップS10-2)
端末装置300において、受付部320は、入力部310に入力された入力値を特定する情報を取得し、取得した入力値を特定する情報を受け付ける。
(Step S8-2)
In the
(Step S9-2)
In the
(Step S10-2)
In the
(ステップS11-2)
端末装置300において、取得部325は、記憶部350のシフト量情報354に記憶されている入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報を取得する。
(ステップS12-2)
端末装置300において、演算部330は、受付部320が受け付けた入力値を特定する情報を取得する。演算部330は、取得した入力値を特定する情報と、入力値の小数点のシフト量を特定する情報とに基づいて、入力値を固定小数点の形式に変換する。
(ステップS13-2)
端末装置300において、演算部330は、取得部325から入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報を取得する。演算部330は、取得した入力層351-1のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とに基づいて、固定小数点の形式に変換した入力値に対する量子化した学習モデル352aの入力層351a-1の出力を導出する。
演算部330は、導出した入力層351a-1の出力に基づいて、入力層351a-1の出力の小数点のシフト量を導出する。演算部330は、導出した入力層351a-1の出力の小数点のシフト量、換言すれば中間層351a-2の入力値の小数点のシフト量を特定する情報を記憶部350のシフト量情報354に記憶させる。
(Step S11-2)
In the
(Step S12-2)
In the
(Step S13-2)
In the
The
(ステップS14-2)
端末装置300において、演算部330は、取得した中間層351a-2のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とに基づいて、学習モデル352aの入力層351a-1の出力値に対する量子化した学習モデル352aの中間層351a-2の出力を導出する。
演算部330は、導出した中間層351a-2の出力に基づいて、中間層351a-2の出力の小数点のシフト量を導出する。演算部330は、導出した中間層351a-2の出力の小数点のシフト量、換言すれば出力層351a-3の入力値の小数点のシフト量を特定する情報を記憶部350のシフト量情報354に記憶させる。
(ステップS15-2)
端末装置300において、演算部330は、取得した出力層351a-3のウエイトの小数点のシフト量を特定する情報とバイアスの小数点のシフト量を特定する情報とに基づいて、学習モデル352aの中間層351a-2の出力値に対する量子化した学習モデル352aの出力層351a-3の出力を導出する。
演算部330は、導出した出力層351a-3の出力に基づいて、分散などの演算を行うことによって、出力層351a-3の出力の小数点のシフト量を導出する。演算部330は、導出した出力層351a-3の出力の小数点のシフト量を特定する情報を記憶部350のシフト量情報354に記憶させる。
(Step S14-2)
In the
The
(Step S15-2)
In the
The
本実施形態に係る演算装置100の最終的な出力値の精度について説明する。
図10は、本実施形態に係る演算装置100の精度の一例を説明するための図である。図10は、入力値を固定小数点の形式へ変換するときの桁数(ビット幅)nを2から8とした場合の各々について、出力値OUの小数点をシフトさせたものを最終出力値とした場合と、出力値OUを最終出力値とした場合について、最終出力値の精度の一例を示す。
図10によれば、ビット幅が6桁までは、出力値OUの小数点をシフトさせたか否かにかかわらず、小数点第二位まで等しい精度が得られているのが分かる。ビット幅が5桁では、出力値OUの小数点をシフトさせない場合と小数点をシフトさせた場合とでは、小数点第二位に差が生じている。ビット幅が4桁以下では、小数点をシフトさせない場合は、出力値OUの小数点をシフトさせた場合と比較して、精度が大きく低下する。
The accuracy of the final output value of the
Fig. 10 is a diagram for explaining an example of the accuracy of the
10, it can be seen that, for bit widths up to six digits, the same accuracy is obtained up to the first decimal place regardless of whether the decimal point of the output value OU is shifted or not. For bit widths of five digits, there is a difference in the first decimal place between when the decimal point of the output value OU is not shifted and when it is shifted. For bit widths of four digits or less, when the decimal point is not shifted, the accuracy is significantly reduced compared to when the decimal point of the output value OU is shifted.
前述した実施形態では、学習モデルの一例として、ディープニューラルネットワーク形式の学習モデルについて説明したがこの例に限られない。例えば、学習モデルに、畳み込みニューラルネットワーク形式の学習モデルが使用されてもよい。積和演算が含まれる層を有する学習モデルが使用可能である。
前述した実施形態では、学習モデルの一例が、Pytonで記述されている場合について説明したが、この例に限られない。例えば、学習モデルの一例が、Pytorch、Tensorflowなどのライブラリーで記述されていてもよい。
前述した実施形態では、入力値の一例として、32ビットの浮動小数点の形式の数である場合について説明したが、この例に限られない。例えば、入力値として、16ビットの浮動小数点の形式の数などの32ビット以外の浮動小数点の形式の数を使用してもよい。
前述した実施形態において、学習モデル152と学習モデル352との各々は、複数の中間層を備えてもよい。複数の中間層を備える場合に、複数の中間層の各々について、ウエイトの小数点のシフト量とバイアスの小数点のシフト量と出力の小数点のシフト量(入力の小数点のシフト量)が導出される。
前述した実施形態において、演算装置100は、出力値OUと出力の小数点のシフト量osfとに基づいて、出力値OUの小数点をシフトさせるか否かを選択できるようにしてもよい。例えば、図10に示すように、ビット幅nが6から8では、出力値OUの小数点をシフトさせたものを最終出力値とした場合と、出力値OUを最終出力値とした場合との間で精度の差が小さいため、出力値OUの小数点をシフトさせる必要がないためである。このように構成することによって、出力値OUの小数点をシフトさせるハードウェアを削減できる。
In the above embodiment, a deep neural network type learning model has been described as an example of the learning model, but the present invention is not limited to this example. For example, a convolutional neural network type learning model may be used as the learning model. A learning model having a layer including a product-sum operation may be used.
In the above embodiment, an example of the learning model is described in Python, but this is not limited to this example. For example, an example of the learning model may be described in a library such as Pytorch or Tensorflow.
In the above embodiment, the input value is, for example, a 32-bit floating-point number, but the input value is not limited to this example. For example, the input value may be a floating-point number other than 32 bits, such as a 16-bit floating-point number.
In the above-described embodiment, each of the
In the above-mentioned embodiment, the
実施形態に係る演算装置によれば、演算装置100は、ニューラルネットワーク形式の学習モデル152のパラメータの小数点のシフト量を特定する情報を取得する取得部125と、取得部125が取得したパラメータの小数点のシフト量を特定する情報に基づいて、入力値に対する学習モデル152の出力値を演算する演算部130と、出力値と出力値の小数点のシフト量とに基づいて、出力値の小数点をシフトさせ、小数点をシフトさせた出力値を出力する出力部140とを備え、入力値は、固定小数点の形式である。
このように構成することによって、演算装置100は、学習モデル152のパラメータの小数点のシフト量を特定する情報に基づいて、固定小数点の形式の入力値に対する学習モデル152の出力値を演算し、出力値と出力値の小数点のシフト量とに基づいて、出力値の小数点をシフトさせ、小数点をシフトさせた出力値を出力する。
出力値と出力値の小数点のシフト量とに基づいて、出力値の小数点をシフトさせることができるため、入力値を固定小数点の形式に変換した場合に演算精度を向上できる。このため、ハードウェアに実装する前に正確な精度を求めることができる。ハードウェアと同等のエミュレーションができるため、ハードウェアのデバッグに使用できる。エミュレーションの段階で、桁あふれをチェックできる。通常使用されているディープニューラルネットワークフレームワークと併用して使用できる。
According to the computing device of the embodiment, the
By configuring in this manner, the
Since the decimal point of the output value can be shifted based on the output value and the amount of shift of the decimal point of the output value, the calculation accuracy can be improved when the input value is converted to a fixed-point format. Therefore, accurate accuracy can be obtained before implementing it in hardware. Since it is possible to perform emulation equivalent to hardware, it can be used for debugging hardware. It is possible to check for overflow at the emulation stage. It can be used in conjunction with commonly used deep neural network frameworks.
また、パラメータには、複数の層の各々のパラメータが含まれる。このように構成することによって、演算装置100は、学習モデル152の複数の層の各々のパラメータに基づいて、入力値に対する学習モデル152の出力値を演算できるため、入力値を固定小数点の形式に変換した場合に、演算精度を向上できる。
また、パラメータには、ウエイトおよび出力が含まれる。このように構成することによって、演算装置100は、学習モデル152の複数のウエイトの各々の小数点のシフト量と複数の層の各々の出力の小数点のシフト量とを特定する情報に基づいて、入力値に対する学習モデル152の出力値を演算できるため、入力値を固定小数点の形式に変換した場合に、演算精度を向上できる。
また、パラメータには、バイアスがさらに含まれる。このように構成することによって、演算装置100は、学習モデル152の複数のバイアスの各々の小数点のシフト量を特定する情報にさらに基づいて、入力値に対する学習モデル152の出力値を演算できるため、入力値を固定小数点の形式に変換した場合に、演算精度を向上できる。
Moreover, the parameters include parameters for each of the multiple layers. With this configuration, the
In addition, the parameters include weights and outputs. With this configuration, the
In addition, the parameters further include a bias. With this configuration, the
また、パラメータは、固定小数点の形式である。このように構成することによって、演算装置100は、量子化された学習モデル152のパラメータの小数点のシフト量を特定する情報に基づいて、固定小数点の形式の入力値に対する学習モデル152の出力値を演算し、出力値と出力値の小数点のシフト量とに基づいて、出力値の小数点をシフトさせ、小数点をシフトさせた出力値を出力できる。このため、ハードウェアに実装する前に正確な精度を求めることができる。ハードウェアと同等のエミュレーションができるため、ハードウェアのデバッグに使用できる。通常使用されているディープニューラルネットワークフレームワークと併用して使用できる。
また、学習モデルは、ディープニューラルネットワーク形式の学習済モデルに基づいて、パラメータを固定小数点の形式に変換することによって作成されたものである。このように構成することによって、学習済モデルから学習モデルを用意できる。
また、演算部130は、パラメータに基づいて、入力値に対して、MAC(multiply-accumulate)演算を行う。このように構成することによって、入力値に対してMAC演算を行うことによって、入力値に対する学習モデル152の出力値を演算できる。
Moreover, the parameters are in a fixed-point format. With this configuration, the
In addition, the learning model is created by converting parameters into a fixed-point format based on a trained model in the form of a deep neural network. By configuring in this way, it is possible to prepare a learning model from a trained model.
Furthermore, the
ニューラルネットワークを用いたシステムは、その応用範囲の広さから、様々な用途で使われ、特にエッジデバイスでの使用がされている。しかし、ニューラルネットワークは大量の計算が必要であるため、エッジデバイスで実行するには、計算量を削減する量子化が必須となる。このため、実施形態に係る演算装置の応用先としては監視カメラ、組込みカメラなどで使われるニューラルネットワークの量子化が挙げられる。特に演算方法は実際のハードウェアをエミュレーションすることが可能であり、検証をすばやく行える。また、どのようなニューラルネットワークにも対応可能であり、新しいモデルに対しても量子化を試すことができる。 Because of their wide range of applications, systems using neural networks are used for a variety of purposes, particularly in edge devices. However, because neural networks require a large amount of calculation, quantization to reduce the amount of calculation is essential to run them on edge devices. For this reason, applications of the arithmetic device according to the embodiment include quantization of neural networks used in surveillance cameras, embedded cameras, and the like. In particular, the arithmetic method is capable of emulating actual hardware, allowing for quick verification. In addition, it is compatible with any neural network, making it possible to try quantization on new models as well.
(実施形態の変形例)
[全体構成]
図11は、実施形態の変形例に係る演算装置の構成図である。
ユーザーUは、演算装置100aに、入力値を入力する操作を行う。入力値の一例は、浮動小数点の形式である。以下、入力値が、浮動小数点の形式である場合について説明を続ける。
演算装置100aは、ユーザーUが入力した入力値を受け付ける。演算装置100aは、受け付けた入力値を浮動小数点の形式から固定小数点の形式へ変換する。固定小数点の形式へ変換するときの桁数(ビット幅)nは、予め設定されている。ここで、本実施形態の変形例に係る演算装置100aでは、複数のビット幅nが設定されている。具体的には、n=6、7、8、9、10、16などである。
(Modification of the embodiment)
[Overall configuration]
FIG. 11 is a configuration diagram of a calculation device according to a modified example of the embodiment.
The user U performs an operation to input an input value to the
The
演算装置100aは、ディープニューラルネットワーク形式の学習モデルに基づいて、その学習モデルに含まれるパラメータを取得する。パラメータの一例は、浮動小数点の形式である。以下、入力値が、浮動小数点の形式である場合について説明を続ける。演算装置100aは、取得したパラメータを固定小数点の形式へ変換する。固定小数点の形式へ変換するときの桁数(ビット幅)nは、予め設定されている。
The
演算装置100aは、固定小数点の形式へ変換後の複数の入力値およびパラメータに基づいて、複数の入力値の各々に対する出力値ouを演算することによって導出する。演算装置100aは、導出した複数の出力値ouと出力値の小数点のシフト量osfとに基づいて、複数の出力値ouの各々の小数点をシフトさせることによって最終出力値を導出する。
演算装置100aは、複数の最終出力値の各々について、最終出力値の精度を導出する。演算装置100aは、入力値を固定小数点の形式へ変換するときの複数のビット幅nの各々について、ビット幅と精度とを関連付けて出力する。
以下、演算装置100aについて説明する。
The
The
The
[演算装置100a]
演算装置100aは、スマートフォン、携帯端末、又はパーソナルコンピュータ、タブレット端末装置、あるいはその他の情報処理機器として実現される。演算装置100aは、例えば、入力部110と、受付部120と、取得部125と、演算部130aと、導出部135と、出力部140aと、記憶部150とを備える。
[
The
演算部130aは、取得部125が取得した入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とを取得する。演算部130aは、取得した入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とに基づいて、入力値に対する学習モデル152の出力値を演算する。
The
演算部130aが実行するMAC演算は、図5を適用できる。演算部130aは、乗算器10と加算器20と加算器30とを備え、積和演算と加算演算とを行う。演算部130aは、入力値inとパラメータの小数点のシフト量を特定する情報とを取得する。ここで、入力値inは、入力値の小数点のシフト量を特定する情報に基づいて、固定小数点の形式に変換されたものである。
演算部130aは、パラメータの小数点のシフト量を特定する情報に基づいて、ウエイトWEの小数点をシフトさせる。演算部130aにおいて、乗算器10は、入力値inと小数点をシフトさせたウエイトWEとを乗算する。加算器20は、入力値inと小数点をシフトさせたウエイトWEとを乗算した結果とを加算する。
The MAC calculation performed by the
The
加算器30は、加算器20の出力値OUと出力の小数点のシフト量osfとに基づいて、出力値OUの小数点をシフトさせることによって、最終出力を導出する。具体的には、加算器30は、出力値OUに0.5を加算する。
導出部135は、演算部130aから、複数のビット幅nの各々について、最終出力を取得する。導出部135は、取得した複数の最終出力に基づいて、最終出力の精度を導出する。
出力部140aは、導出部135から、入力値を固定小数点の形式に変換したときの複数のビット幅の各々と、最終出力の精度とを関連付けた情報を取得する。出力部140aは、取得した複数のビット幅の各々と、最終出力の精度とを関連付けた情報を出力する。
The
The
The
(演算装置100aの動作)
図12は、実施形態の変形例に係る演算装置の動作の一例を示すフローチャートである。
(ステップS1-3)
演算装置100aにおいて、受付部120は、入力部110に入力された入力値を特定する情報を取得し、取得した入力値を特定する情報を受け付ける。
(ステップS2-3)
演算装置100aにおいて、取得部125は、記憶部150のシフト量情報154に記憶されている入力値の小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とを取得する。
(ステップS3-3)
演算装置100aにおいて、演算部130aは、ビット幅を設定する。
(Operation of
FIG. 12 is a flowchart illustrating an example of the operation of a calculation device according to a modified example of the embodiment.
(Step S1-3)
In the
(Step S2-3)
In the
(Step S3-3)
In the
(ステップS4-3)
演算装置100aにおいて、演算部130aは、受付部120が受け付けた入力値を特定する情報を取得する。演算部130aは、取得した入力値を特定する情報と設定したビット幅とに基づいて、入力値を固定小数点の形式へ変換する。
(ステップS5-3)
演算装置100aにおいて、演算部130aは、取得部125が取得した入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とを取得する。演算部130aは、取得した入力層と中間層と出力層との各々のパラメータの小数点のシフト量を特定する情報と、入力層と中間層と出力層との各々の出力の小数点のシフト量を特定する情報とに基づいて、入力値に対する学習モデル152の出力値を演算する。
(Step S4-3)
In the
(Step S5-3)
In the
(ステップS6-3)
演算装置100aにおいて、演算部130aは、出力値と出力の小数点のシフト量osfとに基づいて、出力値OUの小数点をシフトさせることによって、最終出力を導出する。
(ステップS7-3)
演算装置100aにおいて、演算部130aは、全てのビット幅で最終出力を導出したか否かを判定する。最終出力を導出していないビット幅がある場合には、ステップS3-3へ戻る。
(ステップS8-3)
演算装置100aにおいて、導出部135は、演算部130aが全てのビット幅で最終出力を導出したと判定した場合に、演算部130aから、複数のビット幅nの各々について、最終出力を取得する。導出部135は、取得した複数の最終出力に基づいて、最終出力の精度を導出する。
(Step S6-3)
In the
(Step S7-3)
In the
(Step S8-3)
In the
(ステップS9-3)
演算装置100aにおいて、出力部140aは、導出部135から、入力値を固定小数点の形式に変換したときの複数のビット幅の各々と、最終出力の精度とを関連付けた情報を取得する。出力部140aは、取得した複数のビット幅の各々と、最終出力の精度とを関連付けた情報を出力する。
図12では、全てのビット幅で最終出力を導出した後に、最終出力の精度が導出される場合について説明したが、この例に限られない。例えば、最終出力が導出されるたびに、最終出力の精度が導出されるようにしてもよい。
(Step S9-3)
In the
12, the case where the accuracy of the final output is derived after the final output is derived for all bit widths has been described, but this is not limiting. For example, the accuracy of the final output may be derived every time the final output is derived.
実施形態の変形例に係る演算装置100aによれば、演算装置100aは、前述した演算装置100において、演算部130aは、異なるビット幅で固定小数点の形式へ変換された複数の入力値に対する学習モデルの出力値を求め、求めた複数の出力値の各々と出力値の小数点のシフト量とに基づいて、求めた複数の出力値の各々の小数点をシフトさせる。演算装置100aは、複数の出力値の各々の小数点をシフトさせた結果の精度を導出する導出部を備える。
このように構成することによって、演算装置100aは、複数のビット幅の各々について、学習モデルの出力値の小数点をシフトさせた結果の精度を導出できる。このため、仮に学習モデルに要求される精度が設定された場合に、その要求される精度を満足するビット幅を求めることができる。つまり、複数の学習モデルが用意された場合に、許容できるビット幅を求めることができる。また、エミュレーションの時点で、量子化によってどの程度精度が低下するかが分かる。
According to the
By configuring in this way, the
図13は、本実施形態の変形例に係る演算装置の出力の精度の導出結果の一例を示す図である。図13において、横軸は入力値の形式であり、縦軸は精度を示す。
「FP32」は浮動小数点形式の32ビットであり、「FP16」は浮動小数点形式の16ビットである。「INT16」は固定小数点形式の16ビットであり、「INT10」は固定小数点形式の10ビットであり、「INT9」は固定小数点形式の9ビットである。「INT8」は固定小数点形式の8ビットであり、「INT7」は固定小数点形式の7ビットであり、「INT6」は固定小数点形式の6ビットである。
ImageNetとCIFAR100とで学習された学習モデルを使用して、精度の評価を行った。ここでは、学習モデルの一例として、AlexNetと、VGG16と、MobileNet-v2とについて示す。
13 is a diagram showing an example of a result of deriving the accuracy of the output of a calculation device according to a modified example of this embodiment, in which the horizontal axis indicates the format of the input value, and the vertical axis indicates the accuracy.
"FP32" is 32-bit floating point format, "FP16" is 16-bit floating point format, "INT16" is 16-bit fixed point format, "INT10" is 10-bit fixed point format, "INT9" is 9-bit fixed point format, "INT8" is 8-bit fixed point format, "INT7" is 7-bit fixed point format, and "INT6" is 6-bit fixed point format.
Accuracy was evaluated using a learning model trained on ImageNet and
図13によれば、ImageNetで学習されたAlexNet(Innet_AlexNet)の場合には、FP32、FP16、INT16、INT10、INT9に比べて、INT8、INT7、INT6については精度が低下することが分かる。
ImageNetで学習されたVGG16(Innet_VGG16)の場合には、FP32、FP16、INT16、INT10、INT9、INT8に比べて、INT7、INT6については精度が低下することが分かる。
ImageNetで学習されたMobileNet-v2(Innet_MobileNet-v2)の場合には、FP32、FP16、INT16、INT10に比べて、INT9、INT8、INT7、INT6については精度が低下することが分かる。
According to FIG. 13, in the case of AlexNet (Innet_AlexNet) trained with ImageNet, the accuracy is lower for INT8, INT7, and INT6 compared to FP32, FP16, INT16, INT10, and INT9.
In the case of VGG16 (Innet_VGG16) trained with ImageNet, it can be seen that the accuracy is lower for INT7 and INT6 compared to FP32, FP16, INT16, INT10, INT9, and INT8.
In the case of MobileNet-v2 (Innet_MobileNet-v2) trained with ImageNet, it can be seen that the accuracy is lower for INT9, INT8, INT7, and INT6 compared to FP32, FP16, INT16, and INT10.
さらに、図13によれば、CIFAR100で学習されたAlexNet(C100_AlexNet)の場合には、FP32、FP16、INT16、INT10、INT9に比べて、INT8、INT7、INT6については精度が低下することが分かる。
CIFAR100で学習されたVGG16(C100_VGG16)の場合には、FP32、FP16、INT16、INT10、INT9、INT8に比べて、INT7、INT6については精度が低下することが分かる。
CIFAR100で学習されたMobileNet-v2(C100_MobileNet-v2)の場合には、FP32、FP16、INT16、INT10、INT9に比べて、INT8、INT7、INT6については精度が低下することが分かる。
さらに、図13によれば、CIFAR100で学習されたAlexNetにGAP(Global average Pooling)を適用(C100_AlexNet_GAP)の場合には、FP32、FP16、INT16、INT10、INT9に比べて、INT8、INT7、INT6については精度が低下することが分かる。
CIFAR100で学習されたVGG16にGAPを適用(C100_VGG16_GAP)の場合には、FP32、FP16、INT16、INT10、INT9、INT8に比べて、INT7、INT6については精度が低下することが分かる。
図13によれば、学習モデルが用意された場合に、許容される精度に基づいて、何ビットまで許容できるか求めることができる。
Furthermore, according to FIG. 13, in the case of AlexNet trained with CIFAR100 (C100_AlexNet), the accuracy is lower for INT8, INT7, and INT6 compared to FP32, FP16, INT16, INT10, and INT9.
In the case of VGG16 (C100_VGG16) trained with CIFAR100, it can be seen that the accuracy is lower for INT7 and INT6 compared to FP32, FP16, INT16, INT10, INT9, and INT8.
In the case of MobileNet-v2 (C100_MobileNet-v2) trained with CIFAR100, it can be seen that the accuracy is lower for INT8, INT7, and INT6 compared to FP32, FP16, INT16, INT10, and INT9.
Furthermore, according to FIG. 13, when GAP (Global average Pooling) is applied to AlexNet trained with CIFAR100 (C100_AlexNet_GAP), the accuracy is lower for INT8, INT7, and INT6 compared to FP32, FP16, INT16, INT10, and INT9.
When GAP is applied to VGG16 trained with CIFAR100 (C100_VGG16_GAP), it can be seen that the accuracy is lower for INT7 and INT6 compared to FP32, FP16, INT16, INT10, INT9, and INT8.
According to FIG. 13, when a learning model is prepared, it is possible to find how many bits are permissible based on the permissible accuracy.
以上、本発明の実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更、組合わせを行うことができる。これら実施形態及びその変形例は、発明の範囲や要旨に含まれると同時に、特許請求の範囲に記載された発明とその均等の範囲に含まれるものである。
なお、前述の演算装置100、端末装置300、演算装置100aは内部にコンピュータを有している。そして、前述した各装置の各処理の過程は、プログラムの形式でコンピュータ読み取り可能な記録媒体に記憶されており、このプログラムをコンピュータが読み出して実行することによって、上記処理が行われる。ここでコンピュータ読み取り可能な記録媒体とは、磁気ディスク、光磁気ディスク、CD-ROM、DVD-ROM、半導体メモリなどをいう。また、このコンピュータプログラムを通信回線によってコンピュータに配信し、この配信を受けたコンピュータが当該プログラムを実行するようにしてもよい。
また、上記プログラムは、前述した機能の一部を実現するためのものであってもよい。
さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるもの、いわゆる差分ファイル(差分プログラム)であってもよい。
Although the embodiments of the present invention have been described above, these embodiments are presented as examples and are not intended to limit the scope of the invention. These embodiments can be implemented in various other forms, and various omissions, substitutions, modifications, and combinations can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope and spirit of the invention, and are also included in the scope of the invention and its equivalents described in the claims.
The above-mentioned
The program may be for realizing part of the functions described above.
Furthermore, the above-mentioned functions may be realized in combination with a program already recorded in the computer system, that is, a so-called differential file (differential program).
10…乗算器、 20、30…加算器、100、100a…演算装置、 110…入力部、 120…受付部、 125…取得部、 130、130a…演算部、 135…導出部、 140、140a…出力部、 150…記憶部、 151-1…入力層、 151-2…中間層、 151-3…出力層、 152…学習モデル、 154…シフト量情報、 200、205…入力値、 210、215…符号ビット、 220…指数部、 225…整数部、 230…仮数部、 235…小数部、 245…小数点、300…端末装置、 310…入力部、 320…受付部、 325…取得部、 330…演算部、 340…出力部、 350…記憶部、 352、352a…学習モデル、 354…シフト量情報、 351-1、351a-1…入力層、 351-2、351a-2…中間層、 351-3、351a-3…出力層 10...multiplier, 20, 30...adder, 100, 100a...arithmetic unit, 110...input unit, 120...reception unit, 125...acquisition unit, 130, 130a...arithmetic unit, 135...derivation unit, 140, 140a...output unit, 150...storage unit, 151-1...input layer, 151-2...intermediate layer, 151-3...output layer, 152...learning model, 154...shift amount information, 200, 205...input value, 210, 215...sign bit, 220...exponent part, 225...integer part, 230...mantissa part, 235...fractional part, 245...decimal point, 300...terminal device, 310...input unit, 320...reception unit, 325...acquisition unit, 330: Calculation unit; 340: Output unit; 350: Storage unit; 352, 352a: Learning model; 354: Shift amount information; 351-1, 351a-1: Input layer; 351-2, 351a-2: Intermediate layer; 351-3, 351a-3: Output layer
Claims (8)
前記取得部が取得したパラメータの小数点のシフト量を特定する情報に基づいて、異なるビット幅で固定小数点の形式へ変換された複数の入力値に対する前記学習モデルの出力値を求め、求めた複数の前記出力値の各々と出力値の小数点のシフト量とに基づいて、求めた複数の前記出力値の各々の小数点をシフトさせる演算部と、
複数の前記出力値の各々の小数点をシフトさせた結果の精度を導出する導出部と、
を備え、
前記入力値は、固定小数点の形式である、演算装置。 An acquisition unit that acquires information that specifies a decimal point shift amount of a parameter of a neural network type learning model;
a calculation unit that calculates output values of the learning model for a plurality of input values converted to a fixed-point format with different bit widths based on information specifying the amount of shift of a decimal point of the parameter acquired by the acquisition unit, and shifts the decimal point of each of the calculated output values based on each of the calculated output values and the amount of shift of the decimal point of the output value ;
a derivation unit that derives a precision of a result of shifting a decimal point of each of the plurality of output values;
Equipped with
The input values are in fixed-point format.
取得する前記ステップで取得したパラメータの小数点のシフト量を特定する情報に基づいて、異なるビット幅で固定小数点の形式へ変換された複数の入力値に対する前記学習モデルの出力値を求め、求めた複数の前記出力値の各々と出力値の小数点のシフト量とに基づいて、求めた複数の前記出力値の各々の小数点をシフトさせるステップと、
複数の前記出力値の各々の小数点をシフトさせた結果の精度を導出するステップと、
を有し、
前記入力値は、固定小数点の形式である、コンピュータが実行する演算方法。 Obtaining information specifying a decimal point shift amount of a parameter of a neural network type learning model;
A step of obtaining output values of the learning model for a plurality of input values converted to a fixed-point format with different bit widths based on information specifying the amount of shift of the decimal point of the parameter obtained in the obtaining step, and shifting the decimal point of each of the obtained plurality of output values based on each of the obtained plurality of output values and the amount of shift of the decimal point of the output value;
deriving a precision resulting from shifting the decimal point of each of the plurality of output values;
having
A computer implemented method of arithmetic, wherein the input values are in fixed point format.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020193718A JP7614475B2 (en) | 2020-11-20 | 2020-11-20 | Calculation device and calculation method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020193718A JP7614475B2 (en) | 2020-11-20 | 2020-11-20 | Calculation device and calculation method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2022082257A JP2022082257A (en) | 2022-06-01 |
| JP7614475B2 true JP7614475B2 (en) | 2025-01-16 |
Family
ID=81810679
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2020193718A Active JP7614475B2 (en) | 2020-11-20 | 2020-11-20 | Calculation device and calculation method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7614475B2 (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2019139338A (en) | 2018-02-07 | 2019-08-22 | 富士通株式会社 | Information processor, information processing method and program |
| JP2020009444A (en) | 2018-07-04 | 2020-01-16 | 三星電子株式会社Samsung Electronics Co.,Ltd. | Method and apparatus of processing parameter in neural network |
-
2020
- 2020-11-20 JP JP2020193718A patent/JP7614475B2/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2019139338A (en) | 2018-02-07 | 2019-08-22 | 富士通株式会社 | Information processor, information processing method and program |
| JP2020009444A (en) | 2018-07-04 | 2020-01-16 | 三星電子株式会社Samsung Electronics Co.,Ltd. | Method and apparatus of processing parameter in neural network |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2022082257A (en) | 2022-06-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11169778B2 (en) | Converting floating point numbers to reduce the precision | |
| CN113011425B (en) | Image segmentation method, device, electronic equipment and computer readable storage medium | |
| Mandelli et al. | Adaptive sampling using support vector machines | |
| US20080219352A1 (en) | Motion vector searching apparatus, motion vector searching method and storage medium for storing motion vector searching program | |
| US10628124B2 (en) | Stochastic rounding logic | |
| US11106431B2 (en) | Apparatus and method of fast floating-point adder tree for neural networks | |
| US20240404262A1 (en) | Method and machine learning system to perform quantization of neural network | |
| EP3798929A1 (en) | Information processing apparatus, information processing method, and information processing program | |
| WO2022247368A1 (en) | Methods, systems, and mediafor low-bit neural networks using bit shift operations | |
| JP4500358B2 (en) | Arithmetic processing apparatus and arithmetic processing method | |
| JP7614475B2 (en) | Calculation device and calculation method | |
| Santos | Deep and Physics-Informed Neural Networks as a Substitute for Finite Element Analysis | |
| CN112182729A (en) | Tunnel face stability rapid determination method based on naive Bayes | |
| JP7188237B2 (en) | Information processing device, information processing method, information processing program | |
| CN110337636A (en) | Data conversion method and device | |
| CN118070551A (en) | Saddle point approximate line sampling method for reliability analysis of uncertain systems | |
| US20080071852A1 (en) | Method to perform a subtraction of two operands in a binary arithmetic unit plus arithmetic unit to perform such a method | |
| JP2023031296A (en) | Arithmetic method and device | |
| CN112236749B (en) | A floating point precision detection method and device | |
| CN121434554B (en) | Matrix multiplication device, method, electronic device, and storage medium | |
| CN120431283B (en) | Implicit geological modeling method, system and equipment based on GPU acceleration | |
| CN120430143B (en) | BIM-based tunnel soft rock deformation data processing method and system | |
| CN120911144B (en) | Single-precision hardware double-precision simulation method based on floating point decomposition reconstruction | |
| CN119494414B (en) | Dirty quantum constant comparator, dirty quantum variable comparator and quantum computer | |
| CN110648287A (en) | Parallel efficient calculation method for box type filter |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20201208 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20231102 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20240830 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20240903 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20241031 |
|
| 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: 20241119 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20241127 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7614475 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |