JP7187065B1 - Calculation method determination system, calculation method determination method, and calculation method determination program - Google Patents
Calculation method determination system, calculation method determination method, and calculation method determination program Download PDFInfo
- Publication number
- JP7187065B1 JP7187065B1 JP2021105479A JP2021105479A JP7187065B1 JP 7187065 B1 JP7187065 B1 JP 7187065B1 JP 2021105479 A JP2021105479 A JP 2021105479A JP 2021105479 A JP2021105479 A JP 2021105479A JP 7187065 B1 JP7187065 B1 JP 7187065B1
- Authority
- JP
- Japan
- Prior art keywords
- layer
- calculation
- calculation method
- data
- unit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000004364 calculation method Methods 0.000 title claims abstract description 346
- 238000000034 method Methods 0.000 title claims description 57
- 230000003044 adaptive effect Effects 0.000 claims abstract description 11
- 238000012545 processing Methods 0.000 claims description 45
- 230000006978 adaptation Effects 0.000 claims description 34
- 230000008569 process Effects 0.000 claims description 19
- 238000000205 computational method Methods 0.000 claims description 15
- 238000006243 chemical reaction Methods 0.000 claims description 10
- 238000012546 transfer Methods 0.000 claims description 7
- 238000011144 upstream manufacturing Methods 0.000 claims description 3
- 210000002569 neuron Anatomy 0.000 description 32
- 230000006870 function Effects 0.000 description 26
- 238000013528 artificial neural network Methods 0.000 description 18
- 238000010586 diagram Methods 0.000 description 15
- 230000004913 activation Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000010801 machine learning Methods 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 238000003780 insertion Methods 0.000 description 2
- 230000037431 insertion Effects 0.000 description 2
- WBMKMLWMIQUJDP-STHHAXOLSA-N (4R,4aS,7aR,12bS)-4a,9-dihydroxy-3-prop-2-ynyl-2,4,5,6,7a,13-hexahydro-1H-4,12-methanobenzofuro[3,2-e]isoquinolin-7-one hydrochloride Chemical compound Cl.Oc1ccc2C[C@H]3N(CC#C)CC[C@@]45[C@@H](Oc1c24)C(=O)CC[C@@]35O WBMKMLWMIQUJDP-STHHAXOLSA-N 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000001747 exhibiting effect Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000000653 nervous system Anatomy 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Landscapes
- Image Analysis (AREA)
Abstract
【課題】計算コストを適切に考慮してネットワーク構造の各層の計算手法を決定できるシステムを提供する。【解決手段】計算手法決定システムは、層ごとに予め準備された少なくとも1つの計算手法に基づいて、ネットワーク構造の入力から出力までの間の各層の計算手法の組み合わせを複数決定する決定部と、複数の組み合わせごとに、データのやり取りを行う二層の計算手法が所定の関係を満たすか否かを判定し、二層の間のデータのやり取りのために実行される適合層を決定する適合部と、計算手法の計算コストと適合層の計算コストとに基づいて、複数の組み合わせごとに総コストを算出する算出部と、組み合わせごとに算出された総コストに基づいて、複数の組み合わせの中から一つの組み合わせを選択する選択部とを備える。【選択図】図4Kind Code: A1 A system is provided that can determine a calculation method for each layer of a network structure by properly considering calculation costs. A calculation method determination system includes a determination unit that determines a plurality of combinations of calculation methods for each layer from input to output of a network structure based on at least one calculation method prepared in advance for each layer; A matching unit that determines whether or not two layers of calculation methods that exchange data satisfy a predetermined relationship for each combination, and determines a matching layer to be executed for data exchange between the two layers. , a calculation unit that calculates the total cost for each of a plurality of combinations based on the calculation cost of the calculation method and the calculation cost of the adaptive layer; and a selection unit that selects one combination. [Selection drawing] Fig. 4
Description
本開示は、計算手法決定システム、計算手法決定方法、及び、計算手法決定プログラムに関する。 The present disclosure relates to a calculation method determination system, a calculation method determination method, and a calculation method determination program.
特許文献1は、入力層、中間層、出力層という複数層で構成される階層型ネットワークを有する認識装置のためのシステムを開示する。認識装置は、学習済みのネットワーク構造及び重みデータを用いて認識を行う。システムは、予め準備された計算手法を実行環境にて実際に動作させて計算コストを取得し、計算コストが最小となる計算手法を層ごとに選択する。
特許文献1に記載のシステムにおいては、ネットワーク構造全体の計算コストは、各層の計算コストを加算して得ることができる。このため、各層において計算コストが最小となる計算手法が選択されれば、ネットワーク構造全体の計算コストも最小となる。ところで、データをやり取りする二層間の計算手法において、計算に用いるデバイス、環境、データフォーマットなどの違いがある場合には、二層間のデータのやり取りのための処理が必要となる。このため、各層において計算コストが最小となる計算手法を選択したとしても、ネットワーク構造全体の計算コストが最小となるとは限らない。本開示は、ネットワーク構造の各層の計算手法をより適切に決定することができる技術を提供する。
In the system described in
本開示の一側面は、ネットワーク構造及び重みデータを用いて入力データを処理するための計算が行われる実行環境において、ネットワーク構造の層ごとに計算手法を決定する計算手法決定システムである。システムは、決定部、適合部、算出部及び選択部を備える。決定部は、層ごとに予め準備された少なくとも1つの計算手法に基づいて、ネットワーク構造の入力から出力までの間の各層の計算手法の組み合わせを複数決定する。適合部は、複数の組み合わせごとに、データのやり取りを行う二層の計算手法が所定の関係を満たすか否かを判定し、二層の間のデータのやり取りのために実行される適合層を決定する。算出部は、計算手法の計算コストと適合層の計算コストとに基づいて、複数の組み合わせごとに総コストを算出する。選択部は、組み合わせごとに算出された総コストに基づいて、複数の組み合わせの中から一つの組み合わせを選択する。 One aspect of the present disclosure is a computational method determination system that determines a computational method for each layer of a network structure in an execution environment where computations are performed to process input data using network structure and weight data. The system comprises a determiner, a matcher, a calculator and a selector. The determination unit determines a plurality of combinations of calculation methods for each layer from input to output of the network structure based on at least one calculation method prepared in advance for each layer. The adapting unit determines whether or not the two-layer calculation method for exchanging data satisfies a predetermined relationship for each of a plurality of combinations, and selects an adaptation layer to be executed for exchanging data between the two layers. decide. The calculation unit calculates the total cost for each of the multiple combinations based on the calculation cost of the calculation method and the calculation cost of the matching layer. The selection unit selects one combination from a plurality of combinations based on the total cost calculated for each combination.
この計算手法決定システムにおいては、ネットワーク構造の入力から出力までの間の各層の計算手法の組み合わせが複数決定される。そして、複数の組み合わせごとに、データのやり取りを行う二層の計算手法が所定の関係を満たすか否かが判定され、二層の間のデータのやり取りのために実行される適合層が決定される。そして、計算手法の計算コストと適合層の計算コストとに基づいて、複数の組み合わせごとに総コストが算出される。組み合わせごとに算出された総コストに基づいて、複数の組み合わせの中から一つの組み合わせが選択される。このように、計算手法決定システムによれば、適合層の計算コストを考慮して各層の計算手法の組み合わせの総コストが算出される。このため、計算手法決定システムは、各層の計算コストを加算する場合と比べて、ネットワーク構造全体の計算コストをより正確に算出することができる。よって、計算手法決定システムは、ネットワーク構造の各層の計算手法をより適切に決定することができる。 In this calculation method determination system, a plurality of combinations of calculation methods for each layer from the input to the output of the network structure are determined. Then, for each of the plurality of combinations, it is determined whether or not the two-layer calculation method for exchanging data satisfies a predetermined relationship, and a matching layer to be executed for exchanging data between the two layers is determined. be. Then, based on the calculation cost of the calculation method and the calculation cost of the matching layer, the total cost is calculated for each of the multiple combinations. One combination is selected from a plurality of combinations based on the total cost calculated for each combination. Thus, according to the calculation method determination system, the total cost of the combination of calculation methods for each layer is calculated in consideration of the calculation cost of the matching layer. Therefore, the calculation method determination system can calculate the calculation cost of the entire network structure more accurately than when adding the calculation cost of each layer. Therefore, the calculation method determination system can more appropriately determine the calculation method for each layer of the network structure.
一実施形態においては、少なくとも1つの計算手法は、実行環境で実行可能であり、それぞれが異なる演算で同一機能を発揮する複数のアルゴリズムを含んでもよい。この場合、計算手法決定システムは、同一結果を出力するものの演算方法がそれぞれ異なる複数のアルゴリズムを実行環境にて実際に動作させ、得られた計算コストに基づいて最適なアルゴリズムを決定することができる。 In one embodiment, the at least one computational technique may include multiple algorithms that are executable in an execution environment, each performing the same function with different operations. In this case, the calculation method determination system can actually run multiple algorithms that output the same result but have different calculation methods in the execution environment, and can determine the optimum algorithm based on the obtained calculation cost. .
一実施形態においては、少なくとも1つの計算手法は、実行環境で実行可能であり、それぞれが異なるデバイスを用いて同一機能を発揮する複数のアルゴリズムを含み、適合層は、異種デバイス間のデータ転送の処理を実行してもよい。この場合、計算手法決定システムは、異種デバイス間のデータ転送の処理の計算コストを総コストに含めることができるので、ネットワーク構造の各層の計算手法をより適切に決定することができる。 In one embodiment, the at least one computational technique is executable in an execution environment and includes multiple algorithms each performing the same function using a different device, and the adaptation layer is responsible for data transfer between heterogeneous devices. processing may be performed. In this case, the calculation method determination system can include the calculation cost of data transfer processing between heterogeneous devices in the total cost, so that the calculation method for each layer of the network structure can be determined more appropriately.
一実施形態においては、少なくとも1つの計算手法は、実行環境で実行可能であり、それぞれが異なるデータ型のデータに対して同一の演算を行う複数のアルゴリズムを含み、適合層は、データ型の変換の処理を実行してもよい。この場合、計算手法決定システムは、データ型の変換の処理の計算コストを総コストに含めることができるので、ネットワーク構造の各層の計算手法をより適切に決定することができる。 In one embodiment, the at least one computational technique is executable in an execution environment and includes a plurality of algorithms each performing the same operation on data of different data types, and the adaptation layer comprises data type conversion. may be performed. In this case, the calculation method determination system can include the calculation cost of data type conversion processing in the total cost, so that the calculation method for each layer of the network structure can be determined more appropriately.
一実施形態においては、少なくとも1つの計算手法は、実行環境で実行可能であり、それぞれが異なるチャネル位置のデータに対して同一の演算を行う複数のアルゴリズムを含み、適合層は、データレイアウトの変更の処理を実行してもよい。この場合、計算手法決定システムは、データレイアウトの変更の処理の計算コストを総コストに含めることができるので、ネットワーク構造の各層の計算手法をより適切に決定することができる。 In one embodiment, the at least one computational technique is executable in an execution environment and includes a plurality of algorithms each performing the same operation on data at different channel locations, and the adaptation layer changes the data layout. may be performed. In this case, the calculation method determination system can include the calculation cost of the data layout change processing in the total cost, so that the calculation method for each layer of the network structure can be determined more appropriately.
一実施形態においては、選択部は、複数の組み合わせの中から総コストが最小となる組み合わせを選択してもよい。この場合、計算手法決定システムは、ネットワーク構造の各層の計算手法を最も適切に決定することができる。 In one embodiment, the selection unit may select a combination with the lowest total cost from among a plurality of combinations. In this case, the calculation method determination system can most appropriately determine the calculation method for each layer of the network structure.
一実施形態においては、ネットワーク構造が、分岐元の層から複数の層に分岐し、分岐元の層から派生した複数の出力が合流層で合流する分岐構造を有する場合、決定部は、分岐元の層の計算手法を拘束条件とし、分岐元の層の後続の層が拘束条件を満たすように拘束条件ごとに組み合わせを決定してもよい。分岐構造に含まれる各層において、例えば計算コストが最小となる計算手法が選択された場合、分岐元の層の計算手法が一方の分岐では第一手法となり、他方の分岐では第二手法となるような不整合が生じるおそれがある。このため、計算手法決定システムは、分岐元の層の後続の層については分岐元の層の計算手法を拘束条件として計算手法を決定し、拘束条件ごとに組み合わせを決定することにより、不整合が発生することを抑制できる。 In one embodiment, when the network structure has a branching structure in which a plurality of layers branch from a branching source layer and a plurality of outputs derived from the branching source layer merge in a confluence layer, the determining unit A combination may be determined for each constraint so that the layer subsequent to the branch source layer satisfies the constraint. For example, if a calculation method with the lowest calculation cost is selected in each layer included in the branch structure, the calculation method of the branch source layer becomes the first method in one branch and the second method in the other branch. Such inconsistencies may occur. For this reason, the calculation method determination system determines the calculation method for the layer following the branch source layer with the calculation method of the branch source layer as a constraint condition, and determines the combination for each constraint condition, thereby eliminating inconsistencies. You can prevent it from happening.
一実施形態においては、ネットワーク構造の入力を行う入力層が複数となる場合、決定部は、複数の入力層の上流側に、複数の入力層それぞれに接続される補助入力層を生成し、補助入力層の計算手法を拘束条件とし、補助入力層の後続の層が拘束条件を満たすように拘束条件ごとに組み合わせを決定してもよい。この場合、計算手法決定システムは、複数の入力層を有するネットワーク構造であっても、補助入力層を生成することにより、分岐構造と同一の論理を用いることができるので、不整合が発生することを抑制できる。 In one embodiment, when there are a plurality of input layers for inputting the network structure, the determination unit generates an auxiliary input layer connected to each of the plurality of input layers on the upstream side of the plurality of input layers, and The calculation method of the input layer may be used as a constraint condition, and the combination may be determined for each constraint condition so that the layer subsequent to the auxiliary input layer satisfies the constraint condition. In this case, even if the network structure has multiple input layers, the calculation method determination system can use the same logic as the branch structure by generating an auxiliary input layer. can be suppressed.
一実施形態においては、ネットワーク構造の出力を行う出力層が複数となる場合、決定部は、複数の出力層の下流側に、複数の出力層それぞれに接続される補助出力層を生成し、複数の出力層よりも前段の層において分岐している層の計算手法を拘束条件とし、拘束条件を満たすように拘束条件ごとに組み合わせを決定してもよい。この場合、計算手法決定システムは、複数の出力層を有するネットワーク構造であっても、補助出力層を生成することにより、分岐構造と同一の論理を用いることができるので、不整合が発生することを抑制できる。 In one embodiment, when there are a plurality of output layers for outputting the network structure, the determining unit generates auxiliary output layers downstream of the plurality of output layers and connected to each of the plurality of output layers. It is also possible to set the calculation method of the layer branching in the layer preceding the output layer as the constraint condition, and determine the combination for each constraint condition so as to satisfy the constraint condition. In this case, even if the network structure has a plurality of output layers, the calculation method determination system can use the same logic as the branch structure by generating the auxiliary output layer. can be suppressed.
本開示の他の側面は、ネットワーク構造及び重みデータを用いて入力データを処理するための計算が行われる実行環境において、ネットワーク構造の層ごとに計算手法を決定する計算手法決定方法である。方法は、決定ステップ、適合ステップ、算出ステップ及び選択ステップを備える。決定ステップでは、層ごとに予め準備された少なくとも1つの計算手法に基づいて、ネットワーク構造の入力から出力までの間の各層の計算手法の組み合わせを複数決定する。適合ステップでは、複数の組み合わせごとに、データのやり取りを行う二層の計算手法が所定の関係を満たすか否かを判定し、二層の間のデータのやり取りのために実行される適合層を決定する。算出ステップでは、計算手法の計算コストと適合層の計算コストとに基づいて、複数の組み合わせごとに総コストを算出する。選択ステップでは、組み合わせごとに算出された総コストに基づいて、複数の組み合わせの中から一つの組み合わせを選択する。 Another aspect of the present disclosure is a computational method determination method for determining a computational method for each layer of a network structure in an execution environment where computations are performed to process input data using the network structure and weight data. The method comprises a determining step, a matching step, a calculating step and a selecting step. In the determination step, based on at least one calculation method prepared in advance for each layer, a plurality of combinations of calculation methods for each layer from input to output of the network structure are determined. In the adaptation step, it is determined whether or not the two-layer calculation method for exchanging data satisfies a predetermined relationship for each of a plurality of combinations, and the adaptation layer executed for exchanging data between the two layers is determined. decide. In the calculation step, the total cost is calculated for each of the multiple combinations based on the calculation cost of the calculation method and the calculation cost of the adaptive layer. In the selection step, one combination is selected from a plurality of combinations based on the total cost calculated for each combination.
本開示のさらに他の側面は、ネットワーク構造及び重みデータを用いて入力データを処理するための計算が行われる実行環境において、ネットワーク構造の層ごとに計算手法を決定するようにコンピュータを動作させる計算手法決定プログラムである。プログラムは、コンピュータを、決定部、適合部、算出部及び選択部として機能させる。決定部は、層ごとに予め準備された少なくとも1つの計算手法に基づいて、ネットワーク構造の入力から出力までの間の各層の計算手法の組み合わせを複数決定する。適合部は、複数の組み合わせごとに、データのやり取りを行う二層の計算手法が所定の関係を満たすか否かを判定し、二層の間のデータのやり取りのために実行される適合層を決定する。算出部は、計算手法の計算コストと適合層の計算コストとに基づいて、複数の組み合わせごとに総コストを算出する。選択部は、組み合わせごとに算出された総コストに基づいて、複数の組み合わせの中から一つの組み合わせを選択する選択部として機能させる。 Yet another aspect of the present disclosure is a computation that operates a computer to determine a computational approach for each layer of the network structure in an execution environment where computations are performed to process input data using the network structure and weight data. It is a method decision program. The program causes the computer to function as a determiner, fitter, calculator and selector. The determination unit determines a plurality of combinations of calculation methods for each layer from input to output of the network structure based on at least one calculation method prepared in advance for each layer. The adapting unit determines whether or not the two-layer calculation method for exchanging data satisfies a predetermined relationship for each of a plurality of combinations, and selects an adaptation layer to be executed for exchanging data between the two layers. decide. The calculation unit calculates the total cost for each of the multiple combinations based on the calculation cost of the calculation method and the calculation cost of the matching layer. The selection unit functions as a selection unit that selects one combination from a plurality of combinations based on the total cost calculated for each combination.
この計算手法決定方法及び計算手法決定プログラムは、上述した計算手法決定システムと同一の効果を奏する。 This calculation method determination method and calculation method determination program have the same effect as the above-described calculation method determination system.
本開示の種々の側面によれば、計算コストを適切に考慮してネットワーク構造の各層の計算手法を決定することができる。 According to various aspects of the present disclosure, computational cost can be appropriately considered to determine computational techniques for each layer of the network structure.
以下、添付図面を参照して実施形態について説明する。なお、図面の説明において同一の要素には同一の符号を付し、重複する説明は繰り返さない。 Embodiments will be described below with reference to the accompanying drawings. In the description of the drawings, the same elements are denoted by the same reference numerals, and redundant description will not be repeated.
[第一実施形態]
(計算手法決定システムの概要)
実施形態に係る計算手法決定システム100(図4参照)は、階層型ネットワークを有する処理装置の最適な計算手法を決定するシステムである。階層型ネットワークとは、階層構造を有するネットワークであり、一例としてニューラルネットワークである。ニューラルネットワークは、ネットワーク構造及び重みデータなどを用いて定義される。ニューラルネットワークの詳細は後述される。
[First embodiment]
(Overview of calculation method determination system)
A calculation method determination system 100 (see FIG. 4) according to the embodiment is a system that determines an optimum calculation method for a processing device having a hierarchical network. A hierarchical network is a network having a hierarchical structure, such as a neural network. A neural network is defined using a network structure, weight data, and the like. Details of the neural network will be described later.
処理装置は、種々のプログラムを実行可能な実行環境を有する。実行環境では、ネットワーク構造及び重みデータを用いて入力データを処理するための計算が実行される。入力データとは、階層型ネットワークの目的を達成するために処理されるデータである。例えば、階層型ネットワークの目的が認識である場合には、入力データは認識対象データとなる。処理装置は、階層型ネットワークを有する装置であれば特に限定されない。処理装置は、一例として、画像の内容をラベリングする端末装置であったり、画像内の物***置(人の位置など)を特定する監視カメラであったり、一般的なパーソナルコンピュータであってもよい。以下では、処理装置の一例として、ニューラルネットワークを用いて認識対象データの内容を認識する認識部11(図1,図4参照)を有する端末装置を説明する。認識対象データとは、コンピュータに認識させる対象となるデータであり、例えば、画像データ、音声データ、テキストデータなどである。 The processing device has an execution environment capable of executing various programs. In the execution environment, computations are performed to process the input data using the network structure and weight data. Input data is data that is processed to achieve the objectives of the hierarchical network. For example, if the purpose of the hierarchical network is recognition, the input data is recognition target data. The processing device is not particularly limited as long as it has a hierarchical network. The processing device may be, for example, a terminal device that labels the content of an image, a surveillance camera that identifies the position of an object (such as the position of a person) in an image, or a general personal computer. A terminal device having a recognition unit 11 (see FIGS. 1 and 4) that recognizes the content of recognition target data using a neural network will be described below as an example of a processing device. Recognition target data is data to be recognized by a computer, such as image data, voice data, and text data.
計算手法決定システム100により決定される認識部11の計算手法とは、入力に対して演算を行い、結果を出力する手法である。計算手法はルーチンともいう。計算手法決定システム100は、入力に対して所定の精度で同一の結果を出力することを前提として、実行可能な複数種類のアルゴリズムの中から最適なアルゴリズムを決定したり、リソースの種類、使用量又は使用形態が異なる複数の同一アルゴリズムの中から最適なアルゴリズムを決定したりする。リソースは、ハードウェアリソースやソフトウェアリソースが含まれる。ハードウェアリソースは、例えば演算するためのCPU(Central Processing Unit)、GPU(GraphicsProcessing Unit)、DSP(Digital Signal Processor)、キャッシュなどである。ソフトウェアリソースは、例えばライブラリである。アルゴリズムが使用するリソースは、例えばアルゴリズムのパラメータで定義される。
The calculation method of the
計算手法決定システム100は、計算コストを考慮して認識部11の計算手法を決定する。計算コストとは、一例として、計算に要する時間(処理時間)で評価される。この場合、計算コストは、計算に要する時間が長いほど大きくなる。計算コストは、リソースの使用量で評価されてもよい。この場合、計算コストは、リソースの使用量が大きくなるほど大きくなる。計算コストは、計算に要する時間及びリソースの使用量の2つを用いて評価されてもよい。
The calculation
計算手法決定システム100は、認識部11の実行環境で実行可能な計算手法の中から計算コストが最小となる計算手法を決定する。計算手法決定システム100は、実行可能な計算手法の計算コストの平均よりも小さい計算コストとなる計算手法を選択するようにしてもよい。このように、計算手法決定システム100は、認識部11の計算速度を最適化したり、認識部11のリソース使用量を最適化したりする。
The calculation
計算手法決定システム100は、計算手法を決定する際に、認識部11の実行環境で実行可能な計算手法を実行し、実行結果に基づいて計算手法を評価し、最適な計算手法を決定する。
When determining a calculation method, the calculation
具体的な一例として、計算手法決定システム100は、認識部11の実行環境において、ネットワーク構造の層ごとに予め準備された少なくとも1つの計算手法を用いて、所定データに対するネットワーク構造の各層の計算を実行することと、ネットワーク構造の各層の計算結果に基づいて、ネットワーク構造の層ごとに少なくとも1つの計算手法の計算コストを取得することとを実行可能に構成される。
As a specific example, the calculation
具体的な他の例として、計算手法決定システム100は、層ごとに予め準備された少なくとも1つの計算手法に基づいて、ネットワーク構造の入力から出力までの間の各層の計算手法の組み合わせを複数決定することと、複数の組み合わせごとに、データのやり取りを行う二層の計算手法が所定の関係を満たすか否かを判定し、二層の間のデータのやり取りのために実行される適合層を決定することと、計算手法の計算コストと適合層の計算コストとに基づいて、複数の組み合わせごとに総コストを算出することと、組み合わせごとに算出された総コストに基づいて複数の組み合わせの中から一つの組み合わせを選択することと、を実行可能に構成される。
As another specific example, the calculation
(認識部の詳細)
最初に、計算手法決定システムが計算手法を決定する対象となる認識部11を説明する。以下では、一例として、認識対象データが画像データであり、認識する対象が画像の内容(人、動物、物体、風景、室内など)である場合を説明する。
(Details of the recognition unit)
First, the
図1は、認識部11を説明する図である。図1に示されるように、認識部11は、端末装置10に備わる。認識部11は、画像データである認識対象データG1を入力し、認識結果を出力する。図1の(A)に示されるように、認識対象データG1は、犬が描画された画像の画像データである。認識部11は、画像データ(より詳細には画素値)を入力し、学習結果(例えばネットワーク構造及び重みデータ)を用いて画像の内容を表すラベルを出力する。ラベルとは、認識対象データの内容を分類するために用いるものであり、システム利用者によって予め設定されたカテゴリを識別する情報である。図1の(A)の例では、認識部11は「犬」のラベルを出力する。ラベルは、認識部11によって認識対象データG1に付与される。付与とは、関連付けされることを意味し、例えば関連テーブルなどで認識対象データG1とラベルとの関係性のみが記録されてもよいし、認識対象データG1そのものに組み込まれてもよい。認識部11は、画像データを入力してラベルを付与することができるため、画像データを自動的に分類したり、Web上で所望の画像を検索したりすることができる。
FIG. 1 is a diagram for explaining the
システム利用者によって予め設定されたラベルが複数ある場合、その中から最も確からしいラベルを認識対象データに付与するシングルラベル処理と、ある一定の確からしさとなったラベルの全てを認識対象データに付与するマルチラベル処理が存在する。図1の(B)に示されるように、認識対象データG2は、人及び花が描画された画像の画像データである。認識部11がシングルラベル処理を行う場合、認識部11によって認識対象データG2に「人」のラベルが付与される。認識部11がマルチラベル処理を行う場合、認識部11によって認識対象データG2に「人」のラベルと「花」のラベルの2つが付与される。
When there are multiple labels preset by the system user, single label processing that assigns the most probable label to the recognition target data from among them, and assigns all labels that have a certain degree of certainty to the recognition target data. There is multi-label processing that As shown in FIG. 1B, the recognition target data G2 is image data of an image in which people and flowers are drawn. When the recognizing
図2は、認識部11におけるニューラルネットワークを説明する図である。認識部11は、ニューラルネットワークを用いて画像データに対応するラベルを認識する。ニューラルネットワークとは、脳神経系をモデルにした情報処理システムである。図2に示すように、認識部11のニューラルネットワークは、いわゆる階層型ニューラルネットワークであり、円で示す多数の人工ニューロンが階層を形成しつつ連結されている。階層型ニューラルネットワークは、入力用の人工ニューロン、処理用の人工ニューロン及び出力用の人工ニューロンを備える。
FIG. 2 is a diagram for explaining the neural network in the
入力用の人工ニューロンは、認識対象データを取得して処理用の人工ニューロンへ分配する。以下では、ニューラルネットワークでやり取りされる信号そのものをスコアという。スコアは数値である。入力用の人工ニューロンは、並列配置されることで入力層111を形成する。 The artificial neuron for input acquires recognition target data and distributes it to the artificial neuron for processing. The signal itself exchanged in the neural network is hereinafter referred to as a score. A score is a number. Input artificial neurons form an input layer 111 by being arranged in parallel.
処理用の人工ニューロンは、入力用の人工ニューロンに接続され、人工ニューロンの機能にしたがって入力を処理し、出力を他のニューロンへ伝える。処理用の人工ニューロンは、並列配置されることで中間層112を形成する。中間層112は、複数の層であってもよい。なお、中間層112を備えた3階層以上のニューラルネットワークをディープニューラルネットワークという。 The processing artificial neuron is connected to the input artificial neuron, processes the input according to the function of the artificial neuron, and conveys the output to other neurons. Artificial neurons for processing are arranged in parallel to form an intermediate layer 112 . Intermediate layer 112 may be multiple layers. A neural network with three or more hierarchies including the intermediate layer 112 is called a deep neural network.
出力用の人工ニューロンは、外部へ認識スコアを出力する。出力用の人工ニューロンは、ラベルの数と同じ数だけ用意される。つまり、ニューラルネットワークでは、ラベルごとに認識スコアを出力する。図2の例では、「犬」「人」「花」の3つのラベルに合わせて3つの人工ニューロンが用意されている。出力用の人工ニューロンは、「犬」のラベルに対応する認識スコアB1、「人」のラベルに対応する認識スコアB2、「花」のラベルに対応する認識スコアB3を出力する。認識スコアは、認識結果を表すスコアであり、正評価を「1」、負評価を「0」として学習した場合には、ラベルの認識スコアが高いほど画像の内容を示すラベルである確からしさが高くなる。出力用の人工ニューロンは、並列配置されることで出力層113を形成する。 The output artificial neuron outputs the recognition score to the outside. The number of artificial neurons for output is the same as the number of labels. In other words, the neural network outputs a recognition score for each label. In the example of FIG. 2, three artificial neurons are prepared for the three labels of "dog", "person" and "flower". The output artificial neuron outputs a recognition score B1 corresponding to the "dog" label, a recognition score B2 corresponding to the "person" label, and a recognition score B3 corresponding to the "flower" label. The recognition score is a score representing the recognition result. When learning is performed with a positive evaluation as "1" and a negative evaluation as "0", the higher the recognition score of a label, the more likely it is that the label indicates the content of the image. get higher The artificial neurons for output form an output layer 113 by being arranged in parallel.
認識部11は、出力層113によって出力された認識スコアを用いて、付与ラベルを決定する。例えば、認識部11は、所定値以上の認識スコアに対応するラベルを認識対象データに付与する。これにより、認識対象データにその内容を示すラベルが自動的に付与される。なお、シングルラベル処理の場合には、認識部11は、最も高い認識スコアに対応するラベルを認識対象データに付与する。
The
図3は、図2に示す人工ニューロンを説明する図である。図3の(A)に示す人工ニューロンは、x1,x2,x3を入力し、それぞれに対応する重み係数w1,w2,w3をそれぞれ積算する。人工ニューロンは、積算値(x1・w1,x2・w2,x3・w3)とバイアス値bとの総和を算出する。この総和を活性化関数に代入して、人工ニューロンの出力とする。 FIG. 3 is a diagram explaining the artificial neuron shown in FIG. The artificial neuron shown in (A) of FIG. 3 inputs x 1 , x 2 and x 3 and integrates corresponding weighting factors w 1 , w 2 and w 3 respectively. The artificial neuron calculates the sum of the integrated values (x 1 ·w 1 , x 2 ·w 2 , x 3 ·w 3 ) and the bias value b. Substitute this sum into the activation function to obtain the output of the artificial neuron.
より詳細には、対象の人工ニューロンの出力は、以下の数式(1)となる。
ここで、gは活性化関数であり、例えばシグモイド関数である。
More specifically, the output of the artificial neuron of interest is given by Equation (1) below.
where g is an activation function, eg a sigmoid function.
図3の(B)は、N階層(N=3)の人工ニューロンを説明する図である。図3の(B)に示されるように、三階層の場合には、二階層に位置する人工ニューロンの出力h1
(2)、h2
(2)、h3
(2)はそれぞれ以下の数式(3)~(5)となる。ここで、nは対象階層の人工ニューロンの数、w1j
(1)は二階層一番目の人工ニューロンにおける一階層j番目の出力に対応する重み係数、b1
(1)は一階層のバイアス値である。
w2j
(1)は二階層二番目の人工ニューロンにおける一階層j番目の出力に対応する重み係数、w3j
(1)は二階層三番目の人工ニューロンにおける一階層j番目の出力に対応する重み係数、b2
(1)は一階層二番目のバイアス値、b3
(1)は一階層三番目のバイアス値である。これにより、三階層の人工ニューロンの出力h1
(3)は以下の数式(6)で表される。
なお、バイアス値bは必ずしも必要ではなく、前段の人工ニューロンの出力と重み係数との積算値だけで出力を演算してもよい。
FIG. 3B is a diagram for explaining an artificial neuron of N layers (N=3). As shown in FIG. 3B, in the case of three layers, the outputs h 1 (2) , h 2 (2) , and h 3 (2) of the artificial neurons located in the second layer are expressed by the following equations. (3) to (5). Here, n is the number of artificial neurons in the target layer, w 1j (1) is the weight coefficient corresponding to the j-th output of the first artificial neuron in the second layer, and b 1 (1) is the bias value of the first layer. is.
w 2j (1) is the weight coefficient corresponding to the j-th output of the second layer of the second artificial neuron, and w 3j (1) is the weight of the j-th output of the third layer of the second layer of the artificial neuron. The coefficient b 2 (1) is the second bias value of the first hierarchy, and b 3 (1) is the third bias value of the first hierarchy. As a result, the output h 1 (3) of the three-level artificial neuron is represented by the following formula (6).
Note that the bias value b is not necessarily required, and the output may be calculated using only the integrated value of the output of the artificial neuron in the preceding stage and the weighting factor.
人工ニューロンは上記に限定されるものではなく、一般化したものでもよい。i番目の中間層112の機能に関する一般式は以下の数式(7)となる。
ここで、x(i)は中間層112への入力ベクトル、w(i)は中間層112の重みパラメータベクトル、b(i)はバイアスベクトル、v(i)は中間層112の出力ベクトルである。画像認識で一般的に使用される中間層112の一例として、全結合層及び畳み込み層がある。図3で表現されている全結合層の出力は、一般的には以下の数式(8)となる。
ここで、xp
(i)はi番目の中間層112の入力の第p成分、vq
(i)は中間層112の出力の第q成分、wp,q
(i)は中間層112の重み係数のp,q成分である。また、畳み込み層の出力は以下の数式(9)となる。
ここで、xp,(r,s)
(i)はi番目の中間層112の入力の第pチャンネルの(r,s)成分、vq,(r,s)
(i)は中間層112の出力の第qチャンネルの(r,s)成分、wp,q,(r’,s’)
(i)は中間層112の畳み込みフィルタに関する重み係数である。r’,s’は、0から畳み込みフィルタの(幅-1)、(高さ-1)の値まで変化する。以上のような中間層112及び活性化関数g(i)の計算を繰り返すことにより、出力層113直前の中間層の出力が以下の数式10となる。
where x (i) is the input vector to hidden layer 112, w (i) is the weight parameter vector of hidden layer 112, b (i) is the bias vector, and v (i) is the output vector of hidden layer 112. . Examples of intermediate layers 112 commonly used in image recognition include fully connected layers and convolutional layers. The output of the fully connected layer represented in FIG. 3 is generally given by Equation (8) below.
Here, x p (i) is the p-th component of the input of the i-th hidden layer 112, v q (i) is the q-th component of the output of the hidden layer 112, and w p,q (i) is the These are the p and q components of the weighting coefficients. Also, the output of the convolutional layer is the following formula (9).
where x p, (r, s) (i) is the (r, s) component of the p-th channel of the input of the i-th hidden layer 112, v q, (r, s) (i) is the hidden layer 112 The (r,s) component of the qth channel of the output of w p,q,(r′,s′) (i) is the weighting factor for the convolution filter of the hidden layer 112 . r' and s' vary from 0 to (width-1) and (height-1) values of the convolution filter. By repeating the calculation of the intermediate layer 112 and the activation function g (i) as described above, the output of the intermediate layer immediately before the output layer 113 is given by
上述したネットワーク構造、重み係数(重みデータ)及びバイアス値は、後述する学習装置30で学習され、学習結果として認識部11へ配布されたものである。つまり、学習装置30は、認識対象データの特徴量とその内容を示すラベルとを対応させるためのネットワーク構造、重み係数及びバイアス値を学習する装置である。なお、認識部11がバイアス値bを用いない場合には、学習装置30は、ネットワーク構造及び重み係数のみを学習する。
The network structure, weighting coefficients (weighting data) and bias values described above are learned by the
(計算手法決定システムの構成)
図4は、実施形態に係る計算手法決定システム100の機能ブロック図である。図4に示されるように、計算手法決定システム100は、端末装置10及び提供装置40を含み、学習装置30に接続される。学習装置30は、画像データを収集して学習する。学習装置30の学習結果は、提供装置40を介して端末装置10へ提供される。
(Configuration of calculation method determination system)
FIG. 4 is a functional block diagram of the calculation
(ハードウェア構成)
最初に、端末装置10、学習装置30及び提供装置40のハードウェアについて説明する。図5は、図4に示す装置のハードウェア構成を示すブロック図である。図5に示すように、端末装置10は、物理的には、CPU101、RAM(Random Access Memory)102及びROM(Read Only Memory)103などの主記憶装置、タッチパネルやキーボードなどの入力デバイス104、ディスプレイなどの出力デバイス105、ハードディスクなどの補助記憶装置106などを含む通常のコンピュータシステムとして構成される。端末装置10の各機能は、CPU101が、RAM102、ROM103などのハードウェア上に所定のコンピュータソフトウェアを読み込ませ、CPU101の制御の元で入力デバイス104及び出力デバイス105を動作させるとともに、主記憶装置や補助記憶装置106におけるデータの読み出し及び書き込みを行うことで実現される。なお、端末装置10は、上記以外のハードウェアを備えてもよい。例えば、端末装置10は、GPU、FPGA(Field-Programmable Gate Array)、DSPなどを備えてもよい。
(Hardware configuration)
First, hardware of the
学習装置30及び提供装置40のハードウェアも端末装置10と同一のハードウェアで構成可能である。すなわち、学習装置30は、物理的には、CPU301、RAM302及びROM303などの主記憶装置、入力デバイス304、出力デバイス305、補助記憶装置306などを含む通常のコンピュータシステムとして構成される。提供装置40は、物理的には、CPU401、RAM402及びROM403などの主記憶装置、入力デバイス404、出力デバイス405、補助記憶装置406などを含む通常のコンピュータシステムとして構成される。提供装置40の各機能は、CPU401が、RAM402、ROM403などのハードウェア上に所定のコンピュータソフトウェアを読み込ませ、CPU401の制御の元で入力デバイス404及び出力デバイス405を動作させるとともに、主記憶装置や補助記憶装置406におけるデータの読み出し及び書き込みを行うことで実現される。なお、学習装置30及び提供装置40は、ハードウェアとして1つの筐体に収容されている必要はなく、いくつかの装置に分離していてもよい。
The hardware of the
(機能的構成)
次に、学習装置30の機能的構成について説明する。学習装置30は、画像データを収集して学習する。学習装置30は、画像データを格納したデータベース21、画像データを生成するカメラ22、画像データをダウンロード可能なWebサイト23などに接続されており、学習の入力データとなる画像データを取得することができる。もちろん、学習装置30は、外部記憶媒体を接続して画像データを取得してもよいし、通信を介して画像データを受信してもよく、画像データ取得の態様には限定されない。
(Functional configuration)
Next, the functional configuration of the
学習装置30は、ニューラルネットワークを機械学習により構築するプラットフォームを有する。プラットフォームは、学習モデルを学習データに基づいて機械学習する動作環境である。学習モデルは、例えばネットワーク構造及び重みデータなどであり、学習データは、例えば画像データである。プラットフォームは、機械学習を行うソフトウェア群であるフレームワークを備える。プラットフォーム及びフレームワークは、使用言語の違いや設計思想の違いなどによって、学習結果出力に複数のフォーマットが存在する。
The
提供装置40は、学習装置30から取得した、フォーマットの異なる学習結果を、統一フォーマットに変換し、端末装置10へ提供する。これにより、端末装置10は、あらゆるプラットフォームで学習された学習結果を利用することができる。提供装置40は、変換部41を備える。変換部41は、ネットワーク構造及び重みデータを学習装置30から取得し、統一フォーマットの学習結果M1に変換する。
The providing
端末装置10は、認識部11の動作が効率的となるように、学習結果M1のネットワーク構造を事前に動作させ、計算コストが最小となる計算手法を決定しておく。これにより、端末装置10は、学習結果M1を利用した認識部11の動作を効率化させることができる。このために、端末装置10は、事前計算部12、候補決定部13、組み合わせ決定部14(決定部の一例)、適合部15、コスト取得部16、算出部17及び選択部18を備える。
The
事前計算部12は、学習結果M1のネットワーク構造を端末装置10の実行環境で動作させるように構成される。事前計算部12は、提供装置40から学習結果M1を取得する。そして、学習結果M1に含まれる層の情報を候補決定部13へ出力する。
The
候補決定部13は、実行環境に基づいて、ネットワーク構造の各層に対して少なくとも1つの計算手法を準備する。一例として、候補決定部13は、端末装置10の実行環境のハードウェア構成プロファイル、ソフトウェアライブラリなどを参照しつつ、学習結果M1に含まれる層の情報に基づいて、各層に対して実行可能な計算手法TD1を決定する。これにより、事前計算部12の実行前に、層ごとに計算手法が予め準備される。
The
計算手法TD1は、例えば、実行環境で実行可能であり、それぞれが異なる演算で同一機能を発揮する複数のアルゴリズムを含む。計算手法TD1は、それぞれが異なる演算で同一機能を発揮するアルゴリズムであれば、同一リソースを用いても異なるリソースを用いてもよい。計算手法TD1の一例としては、ループの階層の順番が異なるアルゴリズムや、CPU拡張機能を利用したアルゴリズムとCPU拡張機能を利用しないアルゴリズムなどである。 Calculation technique TD1 includes, for example, a plurality of algorithms that can be executed in an execution environment, each performing the same function with different operations. The calculation method TD1 may use the same resource or different resources as long as they are algorithms that exhibit the same function in different operations. An example of the calculation method TD1 is an algorithm in which the order of loop layers is different, an algorithm using CPU extended functions and an algorithm not using CPU extended functions, and the like.
計算手法TD1は、それぞれが異なるデバイスを用いて同一機能を発揮する複数のアルゴリズムを含んでもよい。例えば、計算手法TD1は、演算に用いられるデバイス(プロセッサ)がCPUであるアルゴリズム、GPUであるアルゴリズム、及びDSPであるアルゴリズムを含む。計算手法TD1は、実行環境で実行可能であり、それぞれが異なるデータ型のデータに対して同一の演算を行う複数のアルゴリズムを含んでもよい。データ型は、一例として浮動小数点のビット数である。例えば、計算手法TD1は、処理データの浮動小数点が8ビット、32ビット、及び64ビットでそれぞれ表現されるアルゴリズムを含む。計算手法TD1は、所定のビット数で量子化されたデータを処理するアルゴリズムを含んでもよい。また、計算手法TD1は、実行環境で実行可能であり、それぞれが異なるチャネル位置のデータに対して同一の演算を行う複数のアルゴリズムを含んでもよい。チャネル位置は、画像データにおけるRGBチャネルのデータ位置のことである。チャネルファーストの場合には画像データの次元の並びはチャネル、高さ、幅の順で表現され、チャネルラストの場合には画像データの次元の並びは高さ、幅、チャネルの順で表現される。つまり、計算手法TD1は、チャネルファーストデータを扱うアルゴリズムと、チャネルラストデータを扱うアルゴリズムとを含んでもよい。 The calculation technique TD1 may include multiple algorithms each performing the same function using different devices. For example, the calculation method TD1 includes an algorithm in which the device (processor) used for calculation is a CPU, an algorithm in which it is a GPU, and an algorithm in which it is a DSP. The calculation technique TD1 can be executed in an execution environment and may include multiple algorithms each performing the same operation on data of different data types. The data type is, for example, the number of floating-point bits. For example, calculation method TD1 includes algorithms in which floating point data to be processed are represented by 8 bits, 32 bits, and 64 bits, respectively. Calculation technique TD1 may include an algorithm that processes data quantized with a predetermined number of bits. The calculation technique TD1 may also include multiple algorithms that are executable in an execution environment and each performs the same operation on data at different channel locations. The channel position is the data position of the RGB channels in the image data. In the case of channel-first, the dimensional order of the image data is expressed in the order of channel, height, and width; in the case of channel-last, the dimensional order of the image data is expressed in the order of height, width, and channel. . That is, the calculation technique TD1 may include an algorithm that handles channel first data and an algorithm that handles channel last data.
組み合わせ決定部14は、計算手法TD1に基づいて、ネットワーク構造の入力から出力までの間の各層の計算手法の組み合わせを複数決定する。例えば、第一層が第一計算手法MA1、第二層が第二計算手法MA2、第三層が第三計算手法MA3である場合、計算手法の組み合わせは、(MA1,MA2,MA3)となる。少なくとも1つの層の計算手法が複数存在する場合には、計算手法の組み合わせも複数存在することになる。
The
端末装置10の実行環境においては、ネットワーク構造に含まれる二層間が所定の関係を満たすとき、当該二層の間のデータのやり取りのための処理が自動で実行される。図6の(A)はネットワーク構造の二層を説明する図である。図6に示されるように、第一層L1と第二層L2とは互いに接続され、第一層L1の出力が第二層L2の入力となる。端末装置10は、第一層L1の計算手法と第二層L2の計算手法とが所定の関係を満たす場合に、適合層を自動挿入する。
In the execution environment of the
図6の(B)は図6の(A)の二層の間に適合層が挿入された例を説明する図である。図6の(B)に示されるように、第一層L1と第二層L2との間に適合層AL1が挿入されている。例えば、データを受け取る後段の第二層L2の計算手法が、前段の第一層L1の計算手法で用いられたデバイスとは異なるデバイスを用いる場合、異種デバイス間のデータ転送の処理が必要になる。より具体的な一例としては、第一層L1がGPUでデータを処理した場合であって、第二層L2がCPUでデータを処理する場合、デバイス間でデータ転送を行う適合層AL1が挿入される。 FIG. 6(B) is a diagram illustrating an example in which a matching layer is inserted between the two layers in FIG. 6(A). As shown in FIG. 6B, a matching layer AL1 is inserted between the first layer L1 and the second layer L2. For example, when the calculation method of the second layer L2 in the latter stage that receives data uses a device different from the device used in the calculation method of the first layer L1 in the previous stage, data transfer processing between different types of devices is required. . As a more specific example, when the first layer L1 processes data with a GPU and the second layer L2 processes data with a CPU, an adaptation layer AL1 that transfers data between devices is inserted. be.
あるいは、データを受け取る後段の第二層L2の計算手法が、前段の第一層L1の計算手法で用いられたデータ型とは異なるデータ型のデータを用いる場合、データ型の変換の処理が必要になる。より具体的な一例としては、第一層L1の計算手法として浮動小数点のビット数が64ビットで表現されたデータが処理され、第二層L2の計算手法として浮動小数点のビット数が32ビットで表現されたデータを処理する場合、64ビットから32ビットへのデータ型の変換を行う適合層AL1が挿入される。 Alternatively, when the calculation method of the second layer L2 in the latter stage that receives the data uses data of a data type different from the data type used in the calculation method of the first layer L1 in the previous stage, data type conversion processing is required. become. As a more specific example, as the calculation method of the first layer L1, the data represented by the number of floating-point bits is 64 bits, and as the calculation method of the second layer L2, the number of floating-point bits is 32 bits. When processing the represented data, an adaptation layer AL1 is inserted that performs a data type conversion from 64-bit to 32-bit.
あるいは、データを受け取る後段の第二層L2の計算手法が、前段の第一層L1の計算手法で用いられたチャネル位置とは異なるチャネル位置のデータを用いる場合、データレイアウトの変更の処理が必要になる。例えば、第一層L1の計算手法としてチャネルファーストデータが処理され、第二層L2の計算手法としてチャネルラストデータを処理する場合、チャネルラストデータからチャネルファーストデータへの変換、つまり、データレイアウトの変更を行う適合層AL1が挿入される。なお、上記の例示は、重複して発生することもある。例えば、状況に応じて、異種デバイス間のデータ転送の処理だけでなく、データレイアウトの変更の処理も同時に実行され得る。 Alternatively, if the calculation method of the second layer L2 in the subsequent stage that receives the data uses data at a channel position different from the channel position used in the calculation method of the first layer L1 in the previous stage, it is necessary to change the data layout. become. For example, when channel-first data is processed as the calculation method of the first layer L1 and channel-last data is processed as the calculation method of the second layer L2, conversion from channel-last data to channel-first data, that is, changing the data layout An adaptation layer AL1 is inserted that performs It should be noted that the above examples may occur redundantly. For example, depending on the situation, not only the process of transferring data between devices of different types but also the process of changing the data layout may be executed at the same time.
このように、ネットワーク構造に含まれる二層間が所定の関係を満たすとき、当該二層の間のデータのやり取りのための処理が自動で実行される。計算手法決定システム100は、自動で実行される適合層AL1の計算コストを考慮するために、適合部15を備える。適合部15は、組み合わせ決定部14によって決定された計算手法の組み合わせごとに、適合層AL1が自動挿入される箇所及び適合層AL1の処理内容を判定する。例えば、適合部15は、組み合わせ決定部14によって決定された複数の組み合わせごとに、データのやり取りを行う二層の計算手法が所定の関係を満たすか否かを判定する。所定の関係とは、二層の間のデータのやり取りのために処理が必要となる上述した関係である。
In this way, when two layers included in the network structure satisfy a predetermined relationship, processing for exchanging data between the two layers is automatically executed. The calculation
そして、適合部15は、所定の関係が満たされる場合には二層の間のデータのやり取りのために実行される適合層を決定する。適合層を決定とは、二層間で実施される処理を決定することである。適合部15は、使用されるデバイスが異なる関係である場合にはデバイス間のデータ転送を行う適合層AL1を決定する。適合部15は、データ型に違いが生じる関係である場合にはデータ型の変換を行う適合層AL1を決定する。適合部15は、チャネル位置に違いが生じる関係である場合にはデータレイアウトの変更を行う適合層AL1を決定する。
The
事前計算部12は、ネットワーク構造の層ごとに予め準備された計算手法TD1を用いて、所定データに対するネットワーク構造の各層の計算を実行する。所定データは、ニューラルネットワークで処理可能な予め定められたデータであれば何でもよく、事前に用意されたテストデータであってもよい。事前計算部12は、計算手法TD1を実行する。例えば、畳み込み層に3つの計算手法が準備されている場合、事前計算部12は、畳み込み層の計算をそれぞれの計算手法で1回または複数回実行する。
The
事前計算部12は、上述した適合層AL1についても計算コストを事前に取得すべく、処理を行う。事前計算部12は、計算手法TD1を参照して、挿入される適合層AL1を判定し、適合層AL1に関する処理を実行する。あるいは、事前計算部12は、適合部15から適合層AL1に係る情報を取得し、適合層AL1に関する処理を実行してもよい。
The
コスト取得部16は、事前計算部12の計算結果に基づいて、ネットワーク構造の層ごとに少なくとも1つの計算手法の計算コストを取得する。ネットワーク構造の層ごとに計算コストを取得するとは、上述したニューラルネットワークの層ごとのそれぞれ計算コストを取得することである。例えば、中間層112それぞれの計算コストが取得される。具体的な一例として、コスト取得部16は、第一の畳み込み層に対して準備された複数のアルゴリズムぞれぞれの計算コスト、第一の全結合層に対して準備された複数のアルゴリズムそれぞれの計算コスト、第二の畳み込み層に対して準備された1のアルゴリズムの計算コストなど、層ごとに準備された計算手法で、実際に処理を実行した結果から計算コストを取得する。さらに、コスト取得部16は、適合層AL1の計算コストも取得する。コスト取得部16は、層(適合層AL1を含む)と計算手法と計算コストとを対応させた結果リストTD2を生成する。一例として、コスト取得部16は、層と計算手法と演算速度とを関連付けた結果リストTD2を生成する。以下では、結果リストTD2をプロファイルともいう。
The
算出部17は、計算手法の計算コストと適合層の計算コストとに基づいて、複数の組み合わせごとに総コストを算出する。算出部17は、組み合わせ決定部14及び適合部15から、複数の組み合わせと、組み合わせごとの適合層AL1に関する情報を取得する。適合層AL1に関する情報とは、ネットワーク構造における挿入位置及び処理内容である。算出部17は、組み合わせ決定部14及び適合部15から取得された複数の組み合わせ及び適合層AL1に対応する計算コストを、結果リストTD2を参照して取得する。そして、複数の組み合わせごとに総コストを算出する。算出部17は、適合層AL1を含むネットワーク構造全体において実行される層の計算コストの総和を算出し、総コストとする。
The
選択部18は、組み合わせごとに算出された総コストに基づいて、複数の組み合わせの中から一つの組み合わせを選択する。例えば、選択部18は、複数の組み合わせの中から総コストが最小となる組み合わせを選択する。選択部18は、選択された組み合わせに係る計算手法を学習結果M1に付与した、学習結果M2を生成する。
The
認識部11は、学習結果M2を参照し、選択部18によりネットワーク構造の各層に対応付けられた計算手法を用いて、入力データに対するネットワーク構造の各層の計算を実行環境において実行する。これにより、認識処理効率が向上する。
The
(計算手法決定システムの動作:計算手法決定方法)
図7は、計計算手法決定システムの動作を示すフローチャートである。図7に示されるフローチャートは、端末装置10により実行される。
(Operation of calculation method determination system: calculation method determination method)
FIG. 7 is a flow chart showing the operation of the calculation method determination system. The flowchart shown in FIG. 7 is executed by the
図7に示されるように、端末装置10の組み合わせ決定部14は、組み合わせ決定処理(S10:決定ステップの一例)として、計算手法TD1からネットワーク構造の各層の計算手法を取得する。そして、組み合わせ決定部14は、複数の計算手法の組み合わせを決定する。続いて、端末装置10の適合部15は、判定処理(S12:適合ステップの一例)として、組み合わせ決定処理(S10)で決定された複数の組み合わせごとに、適合層AL1の挿入箇所及び内容を判定する。続いて、端末装置10の算出部17は、算出処理(S14:算出ステップの一例)として、結果リストTD2を参照して、組み合わせごとに総コストを算出する。続いて、端末装置10の選択部18は、選択処理(S16:選択ステップの一例)として、計算手法の組み合わせごとの総コストに基づいて、複数の組み合わせの中から一つの組み合わせを選択する。そして、選択部18は、記憶処理(S18)として、選択された組み合わせに係る計算手法を学習結果M1に記憶し、学習結果M2を生成する。記憶処理(S18)が終了すると、図7のフローチャートは終了する。図7に示されるフローチャートが実行されることで、学習モデルを効率良く実行可能な計算手法が認識部11へ提供される。
As shown in FIG. 7, the
(計算手法の組み合わせの総コスト算出の詳細)
計算手法の組み合わせはネットワーク構造が複雑になるほど増加し、総コストを算出するために多くの時間が必要になる。特に、適合層AL1を考慮することにより、組み合わせパターンが複雑となる。以下では、適合層AL1が考慮されたネットワーク構造の各層の最適な計算手法を決定するアルゴリズムを説明する。
(Details of calculating the total cost of a combination of calculation methods)
The number of combinations of calculation methods increases as the network structure becomes more complex, and it takes more time to calculate the total cost. In particular, consideration of the matching layer AL1 complicates the combination pattern. In the following, an algorithm is described for determining the optimal computational approach for each layer of the network structure given the adaptation layer AL1.
最初にネットワーク構造の形式的な定義を説明する。ネットワーク構造は、n個の層で構成され、1つの入力と1つの出力とを有する有向非巡回グラフ(DAG: directed acyclic graph)である。n個の層はL1,L2,…,Lnで識別され、L1が入力層であり、Lnが出力層である。各層Liは計算手法(ルーチン)の集合Riを有する。Ri(λ)は、計算手法の内容(スキーマ)λを持つルーチンを含む集合Riのサブセットである。サブセットRi(λ)に含まれるルーチンの中で最速のルーチンFi(λ)は、プロファイルから得られるルーチンrの処理時間、つまり実行環境でルーチンrを実行させて計測された処理時間をT(r)とすると、以下の数式(11)で定義される。
計算手法の組み合わせは、各層のルーチンを順に辿ることからルーチン経路ともいう。ルーチン経路Sは、以下の数式(12)で表現できる。
ここで、エッジの層(Li,Lj)がネットワーク構造に存在し、かつ、異なるスキーマを有する場合には、適合層のルーチンである適合ルーチンra
i、jは、ルーチン経路Sに含まれる。この定義に基づいて、最適なルーチン経路S*を定義する。最適なルーチン経路S*は、ネットワーク構造の全てのルーチン経路Sのうち、全体の処理時間が最小となる経路であり、以下の数式(13),(14)で表現される。
最適なルーチン経路S*は、数式(13)の組み合わせ最適化の解である。
The combination of calculation methods is also called a routine path because the routines of each layer are traced in order. The routine path S can be expressed by the following formula (12).
Here, if a layer of edges (L i , L j ) exists in the network structure and has a different schema, then the adaptation routine ra i,j , which is the routine of the adaptation layer, is included in the routine path S be Based on this definition, we define the optimal routine path S * . The optimal routine path S * is the path with the shortest overall processing time among all the routine paths S of the network structure, and is expressed by the following formulas (13) and (14).
The optimal routine path S * is the combinatorial optimization solution of Equation (13).
(直列構造)
最初に最も単純なネットワーク構造を説明する。図8の(A)は直列接続されたネットワーク構造の一例である。図8の(A)では、第一層L1、第二層L2、第三層L3を有するネットワーク構造が示される。ルーチン経路におけるスキーマの集合はΛ={α,β}とする。つまり、2つのスキーマα,βが存在する場合において、最適なルーチン経路S*を算出する。スキーマα,βは任意に設定される。例えば、スキーマαは、層で処理されるデータの浮動小数点のビット数が32ビットであることを意味し、スキーマβは、層で処理されるデータが8ビットで量子化されていることを意味してもよい。この場合、スキーマα,βを層nごとに実行することになるため、最適なルーチン経路S*の探索範囲のサイズは、O(2n)となる。探索範囲のサイズをO(n)に減らすために、動的計画法を採用することができる。
ここで、Fa
i,j(β→α)は、層Liから層Ljへ適合させるための最速のルーチンである。また、i=1のとき、S1(λ)={F1(λ)}であり、λは集合Λに含まれる(λ∈Λ)。数式(15)によれば、層Liの最速のルーチンを選択し、層Li-1において最適なルーチン経路を計算することによって、層Liにおける最適なルーチン経路が得られることを意味する。数式(15)の後半は、Si-1(α)またはSi-1(β)においてスキーマが変化したときに適応するための計算コストを含めている。なお、数式(15)はスキーマαについての数式であり、スキーマβに対しても同様の関係が成り立つ。数式(15)に基づいて、最適なルーチン経路S*=fastestλ∈ΛSn(λ)という命題が成立する。
(series structure)
First, the simplest network structure is described. FIG. 8A is an example of a network structure connected in series. In FIG. 8A, a network structure with a first layer L1, a second layer L2 and a third layer L3 is shown. Let the set of schemata in the routine path be Λ={α,β}. That is, the optimum routine path S * is calculated when there are two schemes α and β. Schemas α and β are set arbitrarily. For example, the scheme α means that the data processed by the layer has 32 floating-point bits, and the schema β means that the data processed by the layer is quantized by 8 bits. You may In this case, since the schemas α and β are executed for each layer n, the size of the search range for the optimal routine path S * is O(2 n ). Dynamic programming can be employed to reduce the size of the search range to O(n).
where F a i,j (β→α) is the fastest routine to fit from layer L i to layer L j . Also, when i=1, S 1 (λ)={F 1 (λ)} and λ is included in the set Λ (λεΛ). Equation (15) means that the optimal routine path in layer L i is obtained by choosing the fastest routine in layer L i and calculating the optimal routine path in layer L i −1 . The second half of Equation (15) includes the computational cost to adapt when the schema changes in S i-1 (α) or S i-1 (β). Note that the formula (15) is a formula for the schema α, and the same relationship holds for the schema β. Based on Equation (15), the proposition that the optimal routine path S * =fastest λ∈Λ S n (λ) holds.
(分岐構造)
次に、層の出力が2つに分岐している例を説明する。図8の(B)は分岐されたネットワーク構造を示す。分岐構造では、分岐元の層から複数の層に分岐し、分岐元の層から派生した複数の出力が合流層で合流する。図8の(B)に示される例では、第一層L1の出力が第二層L2と第四層L4とに分岐している。分岐された経路は第五層L5で合流する。分岐構造においては、直列構造の考え方を拡張することができる。第三層L3及び第四層L4を第五層L5に接続するための適合ルーチンを有するルーチン経路S3(λ3)及びS4(λ4)の和を計算することで、経路が合流する第五層L5における最適なルーチン経路S5(λ5)を得ることができる。ただし、この計算では、ルーチン経路S3(λ3)及びS4(λ4)に関して、分岐元である第一層L1のスキーマが同一であるという拘束条件が必要になる。分岐元である第一層L1のスキーマが同一でない場合、ルーチン経路S5(λ5)は第一層L1において二つのルーチンを持つという矛盾が生じるためである。この拘束条件を反映させるため、ルーチン経路をSi(λ;Ci)とし、制約Ciを含むようにルーチン経路Si(λ)の定義を修正することができる。つまり、分岐元の層のルーチンを拘束条件とし、分岐元の層の後続の層が拘束条件を満たすように拘束条件ごとに組み合わせを決定するようにする。例えば、ルーチン経路S5(λ;λ1=α)は、第一層L1のルーチンがスキーマαを持つ必要があることを意味する。この拡張により、第五層L5における最適なルーチン経路は、以下の式(16)によって得られる。
第三層L3及び第四層L4における最適なルーチン経路S3(λ3)及びS4(λ4)の結合を考慮することで、最速となるルーチン経路を得られる。各経路には、選択されたスキーマに応じて二つの候補が存在する。したがって、最速となるルーチン経路は、合計で四つの候補を評価することで得ることができる。より一般化した議論においては、m個の制約層が存在する場合には、制約はスキーマの集合Λにおけるべき乗のm個目の要素とみなすことができる。A={a1,…,am}をm個の被制約層の集合とした場合、タプルλA=(λa1,…,λam)∈Λmとなり、タプルλAは層に対するスキーマの制約の組合せとなる。タプルλAが制約となる場合、スキーマλjを有する層jの最速ルーチンFj(λj)は、拘束条件を満たす最適なルーチン経路Si(λi;λA)に含まれなければならない。これにより、拘束条件を満たす最適なルーチン経路S*は、以下の式(17)となる。
Next, an example in which the output of the layer is bifurcated will be described. FIG. 8B shows a branched network structure. In the branching structure, a layer at the branching source branches into a plurality of layers, and a plurality of outputs derived from the layer at the branching source merge in a confluence layer. In the example shown in FIG. 8B, the output of the first layer L1 branches to the second layer L2 and the fourth layer L4. The branched paths merge at the fifth layer L5. In a branched structure, the concept of serial structure can be extended. The paths merge by computing the sum of the routine paths S 3 (λ 3 ) and S 4 (λ 4 ) with an adaptation routine for connecting the third layer L3 and the fourth layer L4 to the fifth layer L5. The optimal routine path S 5 (λ 5 ) in the fifth layer L5 can be obtained. However, this calculation requires a constraint that the schema of the first layer L1, which is the branch source, be the same for the routine paths S 3 (λ 3 ) and S 4 (λ 4 ). This is because if the schema of the first layer L1, which is the branch source, is not the same, the routine path S5 ( λ5 ) has two routines in the first layer L1, which is a contradiction. To reflect this constraint, let the routine path be S i (λ; C i ) and modify the definition of routine path S i (λ) to include the constraint C i . In other words, the routine of the branch source layer is used as a constraint condition, and the combination is determined for each constraint condition so that the layer subsequent to the branch source layer satisfies the constraint condition. For example, the routine path S 5 (λ; λ 1 =α) means that the routines of the first layer L1 must have the schema α. With this extension, the optimal routine path in the fifth layer L5 is obtained by Equation (16) below.
The fastest routine path is obtained by considering the combination of the optimal routine paths S 3 (λ 3 ) and S 4 (λ 4 ) in the third layer L3 and the fourth layer L4. For each path there are two candidates depending on the schema chosen. Therefore, the fastest routine path can be obtained by evaluating a total of four candidates. In a more generalized discussion, if there are m constraint layers, a constraint can be viewed as the m-th element of the power in the set Λ of schemata. Let A = {a 1 ,..., a m } be the set of m constrained layers, then tuple λ A = (λ a1 ,..., λ am )∈Λ m , where tuple λ A is the schema for the layers. It becomes a combination of constraints. If a tuple λ A is a constraint, then the fastest routine F j (λ j ) in layer j with schema λ j must be included in the optimal routine path S i (λ i ; λ A ) that satisfies the constraint. . As a result, the optimal routine path S * that satisfies the constraint condition is given by the following equation (17).
(複数の分岐構造)
次に、ネットワーク構造が複数の分岐構造を有する場合を説明する。図8の(C)は複数分岐されたネットワーク構造を示す。図8の(C)に示される例では、第一層L1の出力が第二層L2と第六層L6とに分岐している。さらに、第二層L2の出力が第三層L3と第四層L4とに分岐している。第二層L2から分岐された経路は、第五層L5で合流する。そして、第一層L1から分岐された経路は、第八層L8で合流する。上述した単一の分岐構造の考え方を拡張すると、分岐元である第一層L1及び第二層L2に基づいて拘束条件が設定される。スキーマは2つであるとする。まず、第二層L2の下流に位置する層の最適なルーチン経路を計算する。第二層L2の下流に位置する層は、ここでは、第三層L3、第四層L4、第五層L5及び第八層L8の4つの層である。このため、合計で8つの候補が評価される。候補数は、図8の(B)と比較すると2倍になる。簡易的に一般化すると、b個の分岐を持つネットワーク構造には、2b個のスキーマの組み合わせが得られることになる。
(multiple branched structures)
Next, a case where the network structure has a plurality of branch structures will be described. FIG. 8C shows a network structure with multiple branches. In the example shown in FIG. 8C, the output of the first layer L1 branches to the second layer L2 and the sixth layer L6. Furthermore, the output of the second layer L2 branches to the third layer L3 and the fourth layer L4. The paths branched from the second layer L2 merge at the fifth layer L5. Then, the paths branched from the first layer L1 merge at the eighth layer L8. Expanding the idea of the single branch structure described above, the constraint conditions are set based on the first layer L1 and the second layer L2, which are branch sources. Suppose there are two schemas. First, the optimal routine path for the layer located downstream of the second layer L2 is calculated. The layers located downstream of the second layer L2 are here four layers: a third layer L3, a fourth layer L4, a fifth layer L5 and an eighth layer L8. Thus, a total of 8 candidates are evaluated. The number of candidates is doubled when compared with (B) of FIG. A simple generalization is that for a network structure with b branches, there are 2 b schema combinations.
分岐の個数に応じて指数関数的に組み合わせの個数が増大するため、演算のためのコストを低減させる工夫が必要になる。一例として、分岐がマージされる場合、つまり分岐が合流する場合には制約を緩和することが考えられる。例えば、第五層L5と第七層L7の経路を第八層L8にマージする場合、必要な制約は第一層L1のスキーマのみである。なぜなら、第三層L3と第四層L4とをマージするときに、第二層L2の拘束条件が第五層L5においてすでに満たされている必要があるためである。したがって、第二層L2の拘束条件は、以下の式(18)のように、第五層L5で緩和することができる。
式(18)においては、高速な経路を選択することによってスキーマλ2の制約を除去する。同様の緩和はS5(α;λ1=β)、S5(β;λ1=α)、S5(β;λ1=β)にも適用することができる。より一般化した内容は、以下のとおりである。分岐層Liの全ての下流の経路が通過する層の集合をAiとする。層Ljにおける層Liに対する制約は、層Ljが集合Aiに属する場合のみ、緩和することができる。例えば、Lj∈Aiである場合、層Liの全ての下流の経路は層Ljを通ることになる。層Ljの下流では、層Liに対する制約とのマージは発生しない。よって、層Ljに対する制約を緩和することができる。しかしながら、Lj∈Aiではない場合、層Ljを通らずに層Liに至る経路ρが存在する。つまり、層Ljの下流には層Lk(j<k<=n)で経路ρと交差する経路が存在することになる。この場合、層Ljにおける拘束を緩和することはできない。
Since the number of combinations increases exponentially according to the number of branches, it is necessary to devise ways to reduce the cost of operations. One example would be to relax the constraint when branches are merged, that is, when branches merge. For example, if the routes of the fifth layer L5 and the seventh layer L7 are merged into the eighth layer L8, the only constraint required is the schema of the first layer L1. This is because the constraint condition of the second layer L2 must already be satisfied in the fifth layer L5 when merging the third layer L3 and the fourth layer L4. Therefore, the constraint condition of the second layer L2 can be relaxed by the fifth layer L5 as shown in the following formula (18).
In equation (18), we remove the constraint of schema λ2 by choosing the fast path. Similar relaxations can be applied to S 5 (α; λ 1 =β), S 5 (β; λ 1 =α), S 5 (β; λ 1 =β). The more general content is as follows. Let A i be the set of layers through which all the downstream paths of the branching layer L i pass. A constraint on layer L i in layer L j can be relaxed only if layer L j belongs to set A i . For example, if L j εA i , then all downstream paths of layer L i will pass through layer L j . Downstream of layer Lj , no merging with constraints on layer L i occurs. Therefore, the constraint on layer Lj can be relaxed. However, if L j ∈ A i , then there exists a path ρ to layer L i that does not pass through layer L j . That is, downstream of layer L j , there exists a route crossing route ρ at layer L k (j<k<=n). In this case, the constraint on layer Lj cannot be relaxed.
(複数の入出力)
次に、ネットワーク構造が複数の入力又は複数の出力を有する場合を説明する。図8の(D)は、複数の入出力を有するネットワーク構造である。図8の(D)に示されるように、第一層L1及び第二層L2の二つの層が入力層として機能する。第四層L4及び第五層L5の二つの層が出力層として機能する。上述した議論を適用させるために、ネットワーク構造に対して、補助入力層AU1及び補助出力層AU2の概念が導入される。補助入力層AU1は、第一層L1及び第二層L2よりも上流側に擬似的に導入される。補助入力層AU1は、第一層L1及び第二層L2のデータの入力条件を揃えるために導入される。つまり、補助入力層AU1の計算手法を拘束条件とし、第一層L1及び第二層L2の計算手法が補助入力層AU1の計算手法となるようにスキーマ経路が決定される。このようなスキーマ経路の決定は、補助入力層AU1が擬似的に導入されることで実現するこれにより、上述した分岐構造の考え方と同様の議論が可能となり、第一層L1及び第二層L2が個々に最速となる計算手法を選択したために第一層L1及び第二層L2のデータのデータ型や取り扱うデバイスが異なる、という不整合が生じることを回避することができる。
(multiple inputs and outputs)
Next, we describe the case where the network structure has multiple inputs or multiple outputs. FIG. 8D is a network structure with multiple inputs and outputs. As shown in FIG. 8D, two layers, a first layer L1 and a second layer L2, function as input layers. Two layers, the fourth layer L4 and the fifth layer L5, function as output layers. To apply the discussion above, the concept of an auxiliary input layer AU1 and an auxiliary output layer AU2 is introduced for the network structure. The auxiliary input layer AU1 is artificially introduced upstream of the first layer L1 and the second layer L2. The auxiliary input layer AU1 is introduced to match the data input conditions of the first layer L1 and the second layer L2. That is, the schema path is determined such that the calculation method of the auxiliary input layer AU1 is a constraint condition, and the calculation methods of the first layer L1 and the second layer L2 are the calculation methods of the auxiliary input layer AU1. Determination of such a schema path is achieved by artificially introducing the auxiliary input layer AU1. This enables discussion similar to the branching structure concept described above, and the first layer L1 and the second layer L2 It is possible to avoid the inconsistency that the data types of the data of the first layer L1 and the data of the second layer L2 and the devices to be handled are different due to the individual selection of the fastest calculation method.
補助出力層AU2は、第四層L4及び第五層L5よりも下流側に擬似的に導入される。補助出力層AU2は、第四層L4及び第五層L5のデータの入力条件を揃えるために導入される。言い換えれば、第四層L4及び第五層L5よりも前段の層において分岐している層(ここでは第三層L3)において第四層L4及び第五層L5によって要求される計算手法が異なるという不整合を回避するために導入される。第三層L3の計算手法を拘束条件とし、第四層L4及び第五層L5の計算手法が補助出力層AU2の計算手法となるようにスキーマ経路が決定される。このようなスキーマ経路の決定は、補助出力層AU2が擬似的に導入されることで実現する。これにより、上述した分岐構造の考え方と同様の議論が可能となり、第四層L4及び第五層L5が個々に最速となる計算手法を選択したために第四層L4及び第五層L5のデータのデータ型や取り扱うデバイスが異なる、という不整合が生じることを回避することができる。 The auxiliary output layer AU2 is artificially introduced downstream of the fourth layer L4 and the fifth layer L5. The auxiliary output layer AU2 is introduced to match the input conditions of the data of the fourth layer L4 and the fifth layer L5. In other words, the calculation method required by the fourth layer L4 and the fifth layer L5 is different in the layer (here, the third layer L3) branching in the layer preceding the fourth layer L4 and the fifth layer L5. Introduced to avoid inconsistencies. The schema path is determined such that the computation method of the third layer L3 is a constraint condition, and the computation methods of the fourth layer L4 and the fifth layer L5 are the computation methods of the auxiliary output layer AU2. Determination of such a schema path is realized by artificially introducing the auxiliary output layer AU2. As a result, the same discussion as the idea of the branching structure described above is possible, and since the calculation method that makes the fourth layer L4 and the fifth layer L5 individually selected the fastest calculation method, the data of the fourth layer L4 and the fifth layer L5 It is possible to avoid inconsistencies caused by different data types and different devices to be handled.
次に、計算手法決定システム100として機能させるための計算手法決定プログラムを説明する。計算手法決定プログラムは、メインモジュール、決定モジュール、適合モジュール、算出モジュール及び選択モジュールを備えている。メインモジュールは、装置を統括的に制御する部分である。決定モジュール、適合モジュール、算出モジュール及び選択モジュールを実行させることにより実現される機能は、上述した組み合わせ決定部14、適合部15、算出部17及び選択部18の機能とそれぞれ同様である。
Next, a calculation method determination program for functioning as the calculation
プログラムは、例えば、ROM又は半導体メモリなどの非一時的な記録媒体によって提供される。また、プログラムは、ネットワークなどの通信を介して提供されてもよい。 A program is provided by non-temporary recording media, such as ROM or semiconductor memory, for example. Also, the program may be provided via communication such as a network.
(第一実施形態のまとめ)
計算手法決定システム100では、適合層AL1の計算コストを考慮して各層の計算手法の組み合わせの総コストが算出される。このため、計算手法決定システム100は、各層の計算コストを加算する場合と比べて、ネットワーク構造全体の計算コストをより正確に算出することができる。よって、計算手法決定システム100は、ネットワーク構造の各層の計算手法をより適切に決定することができる。これにより、認識部11の計算負荷を軽減することができる。
(Summary of the first embodiment)
In calculation
計算手法決定システム100によれば、同一結果を出力するものの演算方法がそれぞれ異なる複数のアルゴリズムを実行環境にて実際に動作させ、得られた計算コストに基づいて最適なアルゴリズムを決定することができる。計算手法決定システム100によれば、異種デバイス間のデータ転送の処理の計算コストを総コストに含めることにより、ネットワーク構造の各層の計算手法をより適切に決定することができる。計算手法決定システム100によれば、データ型の変換の処理の計算コストを総コストに含めることにより、ネットワーク構造の各層の計算手法をより適切に決定することができる。計算手法決定システム100によれば、データレイアウトの変更の処理の計算コストを総コストに含めることにより、ネットワーク構造の各層の計算手法をより適切に決定することができる。計算手法決定システム100によれば、複数の組み合わせの中から総コストが最小となる組み合わせを選択することにより、ネットワーク構造の各層の計算手法を最も適切に決定することができる。
According to the calculation
計算手法決定システム100によれば、分岐元の層の後続の層については分岐元の層の計算手法を拘束条件として計算手法を決定し、拘束条件ごとに組み合わせを決定することにより、不整合が発生することを抑制できる。計算手法決定システム100によれば、複数の入力層を有するネットワーク構造において補助入力層を生成することにより、不整合が発生することを抑制できる。計算手法決定システム100によれば、複数の出力層を有するネットワーク構造において補助出力層を生成することにより、不整合が発生することを抑制できる。
According to the calculation
[第二実施形態]
第二実施形態に係る計算手法決定システム100Aは、第一実施形態に係る計算手法決定システム100と比較して、組み合わせ決定部14、適合部15、算出部17及び選択部18の機能が提供装置40側に存在する点が相違し、その他は同一である。第二実施形態においては、第一実施形態と重複する説明は繰り返さない。
[Second embodiment]
Compared to the calculation
図9は、第二実施形態に係る計算手法決定システム100Aの機能ブロック図である。図9に示されるように、計算手法決定システム100Aは、提供装置40A及び端末装置10Aを備える。提供装置40Aは、提供装置40と比較して、組み合わせ決定部14、適合部15、算出部17及び選択部18を備える点が相違する。組み合わせ決定部14、適合部15、算出部17及び選択部18の各機能は、第一実施形態において説明された内容と同一である。また、計算手法決定システム100Aのその他の構成は、計算手法決定システム100と同一である。
FIG. 9 is a functional block diagram of the calculation
(第二実施形態のまとめ)
計算手法決定システム100Aでは、適合層AL1の計算コストを考慮して各層の計算手法の組み合わせの総コストが算出される。このため、計算手法決定システム100Aは、各層の計算コストを加算する場合と比べて、ネットワーク構造全体の計算コストをより正確に算出することができる。よって、計算手法決定システム100Aは、ネットワーク構造の各層の計算手法をより適切に決定することができる。これにより、認識部11の計算負荷を軽減することができる。また、計算手法決定システム100Aは、計算手法決定システム100と比べて、端末装置10Aに導入される機能を最小限にすることができる。これにより、システムのメンテナンス性が向上する。
(Summary of the second embodiment)
Calculation
なお、本開示は上記実施形態に限定されるものではない。本開示は、その要旨を逸脱しない範囲で様々な変形が可能である。 Note that the present disclosure is not limited to the above embodiments. Various modifications can be made to the present disclosure without departing from the gist thereof.
計算手法決定システム100はハードウェアとして端末装置10及び提供装置40を含むことが例示されたが、これに限定されない。例えば、計算手法決定システム100は、機能ごとに用意された装置が通信ネットワークを介して接続されてなる集合体として構成されてもよい。あるいは、計算手法決定システム100は、全ての機能を発揮可能な単一のハードウェアで構成されていてもよい。計算手法決定システム100Aも同様に、種々のハードウェアで構成されてもよいし、単一のハードウェアで構成されてもよい。
Although the computing
計算手法決定システム100は認識部11の層ごとに最適な計算手法を決定しているため、1の認識部11に対して最適な計算手法のセットが1つ提供されることになる。しかしながら、提供される最適な計算手法のセットの数は1つに限定されず、2セット以上提供されてもよい。この場合、認識部11は、例えば、提供された複数のセットをそれぞれ実行し、最も速く処理することができたセットを選択すればよい。
Since the calculation
計算手法決定システム100は、同一環境を有する他の端末に最適な計算手法を展開してもよい。例えば、端末装置10と同一の環境を有する端末装置10Xが存在するとする。端末装置10Xは、例えば端末装置10と同一機種である。計算手法決定システム100は、端末装置10Xに対して、選択部18により選択された計算手法を提供する提供部をさらに備えてもよい。この場合、計算手法決定システム100は、同一環境の端末には、実際にその端末で計算することなく、同一環境を有する他の端末で決定した計算手法を適用させることができる。
The calculation
10,10A…端末装置、11…認識部、12…事前計算部、13…候補決定部、14…組み合わせ決定部、15…適合部、16…コスト取得部、17…算出部、18…選択部、100,100A…計算手法決定システム。
10,
Claims (11)
前記層ごとに予め準備された少なくとも1つの計算手法に基づいて、前記ネットワーク構造の入力から出力までの間の各層の計算手法の組み合わせを複数決定する決定部であって、少なくとも1つの層の計算手法が複数存在する、前記決定部と、
複数の組み合わせごとに、データのやり取りを行う二層の計算手法が所定の関係を満たすか否かを判定し、前記所定の関係が満たされる場合には前記二層の間のデータのやり取りのために実行される適合層を決定する適合部と、
前記計算手法の計算コストと前記適合層の計算コストとに基づいて、前記複数の組み合わせごとに総コストを算出する算出部と、
前記組み合わせごとに算出された前記総コストに基づいて、前記複数の組み合わせの中から一つの前記組み合わせを選択する選択部と、
を備える計算手法決定システム。 A calculation method determination system that determines a calculation method for each layer of the network structure in an execution environment in which calculations are performed to process input data using the network structure and weight data,
a determination unit that determines a plurality of combinations of calculation methods for each layer from input to output of the network structure based on at least one calculation method prepared in advance for each layer, wherein calculation of at least one layer the determining unit, in which a plurality of methods exist ;
For each of a plurality of combinations, it is determined whether or not a two-layer calculation method that exchanges data satisfies a predetermined relationship, and if the predetermined relationship is satisfied, for data exchange between the two layers. an adaptation part that determines the adaptation layer to be performed on
a calculation unit that calculates a total cost for each of the plurality of combinations based on the calculation cost of the calculation method and the calculation cost of the adaptive layer;
a selection unit that selects one of the plurality of combinations based on the total cost calculated for each combination;
A computational method determination system comprising:
前記適合層は、異種デバイス間のデータ転送の処理を実行する、
請求項1又は2に記載の計算手法決定システム。 the at least one computational technique comprises a plurality of algorithms executable in the execution environment, each performing the same function using a different device;
the adaptation layer performs the processing of data transfer between heterogeneous devices;
The calculation method determination system according to claim 1 or 2.
前記適合層は、データ型の変換の処理を実行する、
請求項1~3の何れか一項に記載の計算手法決定システム。 the at least one computational technique is executable in the execution environment and includes a plurality of algorithms each performing the same operation on the data of different data types;
the adaptation layer performs a process of data type conversion;
The calculation method determination system according to any one of claims 1 to 3.
前記適合層は、データレイアウトの変更の処理を実行する、
請求項1~4の何れか一項に記載の計算手法決定システム。 the at least one computational technique comprises a plurality of algorithms executable in the execution environment, each algorithm performing the same operation on the data at different channel locations;
the adaptation layer performs processing of data layout changes;
A calculation method determination system according to any one of claims 1 to 4.
前記決定部が、前記層ごとに予め準備された少なくとも1つの計算手法に基づいて、前記ネットワーク構造の入力から出力までの間の各層の計算手法の組み合わせを複数決定する決定ステップであって、少なくとも1つの層の計算手法が複数存在する、前記決定ステップと、
前記適合部が、 複数の組み合わせごとに、データのやり取りを行う二層の計算手法が所定の関係を満たすか否かを判定し、前記所定の関係が満たされる場合には前記二層の間のデータのやり取りのために実行される適合層を決定する適合ステップと、
前記算出部が、 前記計算手法の計算コストと前記適合層の計算コストとに基づいて、前記複数の組み合わせごとに総コストを算出する算出ステップと、
前記選択部が、 前記組み合わせごとに算出された前記総コストに基づいて、前記複数の組み合わせの中から一つの前記組み合わせを選択する選択ステップと、
を備える計算手法決定方法。 A calculation method determination method for determining a calculation method for each layer of the network structure in an execution environment in which calculations are performed for processing input data using a network structure and weight data,the determination unit, the adaptation unit, the calculation unit, and the selection unit are implemented in a computer;
The decision unitA determination step of determining a plurality of combinations of calculation methods for each layer from the input to the output of the network structure based on at least one calculation method prepared in advance for each layer.wherein there is a plurality of at least one layer of computational methods, the determining stepWhen,
The adapting part is For each of a plurality of combinations, it is determined whether or not a two-layer calculation method that exchanges data satisfies a predetermined relationship, and if the predetermined relationship is satisfied, for data exchange between the two layers. a fitting step that determines a matching layer to be performed on
The calculation unit a calculation step of calculating a total cost for each of the plurality of combinations based on the calculation cost of the calculation method and the calculation cost of the adaptive layer;
The selection unit a selection step of selecting one of the plurality of combinations based on the total cost calculated for each combination;
A computational method determination method comprising:
前記コンピュータを、
前記層ごとに予め準備された少なくとも1つの計算手法に基づいて、前記ネットワーク構造の入力から出力までの間の各層の計算手法の組み合わせを複数決定する決定部であって、少なくとも1つの層の計算手法が複数存在する、前記決定部、
複数の組み合わせごとに、データのやり取りを行う二層の計算手法が所定の関係を満たすか否かを判定し、前記所定の関係が満たされる場合には前記二層の間のデータのやり取りのために実行される適合層を決定する適合部、
前記計算手法の計算コストと前記適合層の計算コストとに基づいて、前記複数の組み合わせごとに総コストを算出する算出部、及び、
前記組み合わせごとに算出された前記総コストに基づいて、前記複数の組み合わせの中から一つの前記組み合わせを選択する選択部として機能させる、計算手法決定プログラム。 A calculation method determination program that causes a computer to determine a calculation method for each layer of the network structure in an execution environment where calculations are performed to process input data using the network structure and weight data,
said computer,
a determination unit that determines a plurality of combinations of calculation methods for each layer from input to output of the network structure based on at least one calculation method prepared in advance for each layer, wherein calculation of at least one layer The decision unit, wherein there are a plurality of methods ,
For each of a plurality of combinations, it is determined whether or not a two-layer calculation method that exchanges data satisfies a predetermined relationship, and if the predetermined relationship is satisfied, for data exchange between the two layers. an adaptation part that determines the adaptation layer to be performed on
a calculation unit that calculates a total cost for each of the plurality of combinations based on the calculation cost of the calculation method and the calculation cost of the adaptive layer; and
A calculation method determination program functioning as a selection unit that selects one of the plurality of combinations based on the total cost calculated for each combination.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021105479A JP7187065B1 (en) | 2021-06-25 | 2021-06-25 | Calculation method determination system, calculation method determination method, and calculation method determination program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021105479A JP7187065B1 (en) | 2021-06-25 | 2021-06-25 | Calculation method determination system, calculation method determination method, and calculation method determination program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP7187065B1 true JP7187065B1 (en) | 2022-12-12 |
JP2023004024A JP2023004024A (en) | 2023-01-17 |
Family
ID=84418194
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2021105479A Active JP7187065B1 (en) | 2021-06-25 | 2021-06-25 | Calculation method determination system, calculation method determination method, and calculation method determination program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7187065B1 (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2019128831A (en) | 2018-01-25 | 2019-08-01 | 株式会社モルフォ | Calculation technique determining system, calculation technique determining device, processing device, calculation technique determining method, processing method, calculation technique determining program, and processing program |
JP2019164793A (en) | 2018-03-19 | 2019-09-26 | エスアールアイ インターナショナル | Dynamic adaptation of deep neural networks |
-
2021
- 2021-06-25 JP JP2021105479A patent/JP7187065B1/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2019128831A (en) | 2018-01-25 | 2019-08-01 | 株式会社モルフォ | Calculation technique determining system, calculation technique determining device, processing device, calculation technique determining method, processing method, calculation technique determining program, and processing program |
JP2019164793A (en) | 2018-03-19 | 2019-09-26 | エスアールアイ インターナショナル | Dynamic adaptation of deep neural networks |
Non-Patent Citations (1)
Title |
---|
LANE,D.Nicholas et al.,DEEPX: A Software Accelerator for Low-Power Deep Learning Inference on Mobile Devices,2016 15th ACM/IEEE International Conference on Information Processing in Sensor Networks(IPSN),IEEE[online],2016年04月28日,[検索日:2022年08月19日],インターネット<URL: https://ieeexplore.ieee.org/document/7460664/> |
Also Published As
Publication number | Publication date |
---|---|
JP2023004024A (en) | 2023-01-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2024114399A1 (en) | Optimization method for distributed execution of deep learning task, and distributed system | |
US20080249966A1 (en) | Method and system of classifying, ranking and relating information based on networks | |
US11720788B2 (en) | Calculation scheme decision system, calculation scheme decision device, calculation scheme decision method, and storage medium | |
US11366806B2 (en) | Automated feature generation for machine learning application | |
Babichev et al. | Objective clustering inductive technology of gene expression sequences features | |
US11727256B2 (en) | Hardware architecture for processing data in neural network | |
CN117216227B (en) | Tobacco enterprise intelligent information question-answering method based on knowledge graph and large language model | |
Yan et al. | Data envelopment analysis classification machine | |
CN116227565A (en) | Compiling optimization system and neural network accelerator with variable precision | |
WO2012111235A1 (en) | Information processing device, information processing method, and storage medium | |
Hasanpour et al. | Improving rule-based classification using Harmony Search | |
Li et al. | An ensemble clustering framework based on hierarchical clustering ensemble selection and clusters clustering | |
Patel et al. | Quantum inspired binary neural network algorithm | |
Zhao et al. | Distributed optimization of graph convolutional network using subgraph variance | |
Buongiorno Nardelli | MUSICNTWRK: data tools for music theory, analysis and composition | |
Govada et al. | Distributed multi-class rule based classification using ripper | |
Brito et al. | GPU-enabled back-propagation artificial neural network for digit recognition in parallel | |
JP7187065B1 (en) | Calculation method determination system, calculation method determination method, and calculation method determination program | |
Escobar et al. | Improving memory accesses for heterogeneous parallel multi-objective feature selection on eeg classification | |
Šíma et al. | Energy complexity model for convolutional neural networks | |
CN111612164A (en) | Non-iterative big data semi-supervised learning method, system, storage medium and terminal | |
Kennedy et al. | Accelerated deep learning on hpcc systems | |
Vanderheyden et al. | Ordinal Hyperplane Loss | |
Verma et al. | Unleashing the power of deep neural networks: An interactive exploration of static and dynamic architectures | |
Rajput et al. | Genetic Algorithm-Based Clustering with Neural Network Classification for Software Fault Prediction |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20210625 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20220830 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20221026 |
|
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: 20221108 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20221122 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7187065 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |