JP6794854B2 - Arithmetic processing unit and control method of arithmetic processing unit - Google Patents

Arithmetic processing unit and control method of arithmetic processing unit Download PDF

Info

Publication number
JP6794854B2
JP6794854B2 JP2017017668A JP2017017668A JP6794854B2 JP 6794854 B2 JP6794854 B2 JP 6794854B2 JP 2017017668 A JP2017017668 A JP 2017017668A JP 2017017668 A JP2017017668 A JP 2017017668A JP 6794854 B2 JP6794854 B2 JP 6794854B2
Authority
JP
Japan
Prior art keywords
data
processing unit
unit
arithmetic processing
element data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2017017668A
Other languages
Japanese (ja)
Other versions
JP2018124867A (en
Inventor
仁 ▲高▼橋
仁 ▲高▼橋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2017017668A priority Critical patent/JP6794854B2/en
Priority to US15/877,444 priority patent/US20180217962A1/en
Publication of JP2018124867A publication Critical patent/JP2018124867A/en
Application granted granted Critical
Publication of JP6794854B2 publication Critical patent/JP6794854B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • G06F17/153Multidimensional correlation or convolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30032Movement instructions, e.g. MOVE, SHIFT, ROTATE, SHUFFLE
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30036Instructions to perform operations on packed data, e.g. vector, tile or matrix operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30181Instruction operation extension or modification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models
    • G06N5/046Forward inferencing; Production systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining

Description

本発明は、演算処理装置及び演算処理装置の制御方法に関する。 The present invention relates to an arithmetic processing unit and a control method for the arithmetic processing unit.

演算処理装置に用いられるGPU(Graphic Processing Unit)は、元々は画像処理用のプロセッサであるが、多数の和積演算器を備えることにより行列計算に最適化されているため、機械学習用の処理を行うプロセッサとしても用いられることが多い。そして、深層学習(ディープラーニング)を行う処理においても、GPUが用いられることが一般的である。 The GPU (Graphic Processing Unit) used in the arithmetic processing unit is originally a processor for image processing, but since it is optimized for matrix calculation by having a large number of sum-product arithmetic units, it is a process for machine learning. It is often used as a processor that performs. The GPU is also generally used in the process of performing deep learning.

深層学習では、ニューラルネットワークを用いて処理が行われることが多い。例えば、画像認識の深層学習の場合、与えられた画像が何か判断するフォワード処理及び判断するためのニューラルネットワークのパラメータを更新するためのバックワード処理の2つの処理を有する。深層学習を行う演算処理装置は、フォワード処理での計算結果と期待値との差分を用いてバックワード処理を行い、ニューラルネットワークのパラメータを更新する。そして、演算処理装置は、更新したパラメータを用いてフォワード処理の精度を向上させる。 In deep learning, processing is often performed using a neural network. For example, in the case of deep learning of image recognition, it has two processes, a forward process for determining what a given image is and a backward process for updating the parameters of the neural network for determining. The arithmetic processing unit that performs deep learning performs backward processing using the difference between the calculation result in the forward processing and the expected value, and updates the parameters of the neural network. Then, the arithmetic processing unit improves the accuracy of the forward processing by using the updated parameters.

ニューラルネットワークは複数の層で構成される場合がある。フォワード処理が行われる順伝播では、入力データに対して各層で特徴量の抽出などの演算処理が行われ出力結果となる。そして、バックワード処理が行われる逆伝播では、それぞれの層において、順伝播の結果と期待値との差分を用いて各パラメータを更新する学習が順伝播と逆方向に繰り返される。このように、ニューラルネットワークは、それぞれの層で実施される異なる演算処理が行われる多層の構造を有する。このような構造を有することから、層毎のパラメータの更新を行うために、後の層の計算結果と期待値との差分を求め、その差分を1つ前の層に、その層の差分計算の結果をさらに1つ前の層に伝搬しながら学習が行われる。ここでの説明における1つ前及び1つ先は、順伝播の方向を基準とする。 A neural network may consist of multiple layers. In the forward propagation in which the forward processing is performed, arithmetic processing such as extraction of features is performed on the input data in each layer, and the output result is obtained. Then, in the back propagation in which the backward processing is performed, learning to update each parameter using the difference between the result of the forward propagation and the expected value is repeated in the opposite direction to the forward propagation in each layer. As described above, the neural network has a multi-layer structure in which different arithmetic processes performed in each layer are performed. Since it has such a structure, in order to update the parameters for each layer, the difference between the calculation result of the subsequent layer and the expected value is obtained, and the difference is set to the previous layer and the difference calculation of that layer is performed. Learning is performed while propagating the result of the above to the previous layer. The one before and one ahead in the explanation here are based on the direction of forward propagation.

さらに、深層学習の中で主に画像認識で用いられる演算処理として、畳み込みニューラルネットワークという処理がある。畳み込みニューラルネットワークでは、畳み込み(convolution)と呼ばれる演算が多用される。以下では、「畳込演算」という。例えば、画像認識を行う場合、入力画像上の領域に予め決められたパラメータを各要素として有するフィルタを元画像に配置する。順伝播における入力側はボトムと呼び、出力側はトップと呼ぶ。逆伝播においても位置関係は変わらず出力側をボトムと呼び、入力側をトップと呼ぶ。元画像を含む順伝播方向のときの各層の入力データは、「ボトムデータ」と呼ぶ。深層学習の画像認識において畳込演算を行う場合、入力データは、ビットマップ形式となっており、データを順番に並べて積んでいくと見た目の画像と同じになる。また、入力データを構成する各要素データは、グレースケールの場合であれば濃淡を表し、RGB(Read Green Blue)であれば3色分のデータを表す。また、フィルタは、「重みデータ」と呼ばれる。 Further, as an arithmetic process mainly used in image recognition in deep learning, there is a process called a convolutional neural network. In a convolutional neural network, an operation called convolution is often used. Hereinafter, it is referred to as "convolution operation". For example, in the case of image recognition, a filter having predetermined parameters as each element is arranged in the area on the input image. In forward propagation, the input side is called the bottom and the output side is called the top. Even in back propagation, the positional relationship does not change, and the output side is called the bottom and the input side is called the top. The input data of each layer in the forward propagation direction including the original image is called "bottom data". When the convolution operation is performed in the image recognition of deep learning, the input data is in a bitmap format, and when the data are arranged in order and stacked, the input data becomes the same as the apparent image. Further, each element data constituting the input data represents a shade in the case of gray scale, and represents data for three colors in the case of RGB (Read Green Blue). The filter is also called "weight data".

そして、フィルタが配置された入力データの各要素と、フィルタの各要素とを乗算したものを合計することで、入力データにおけるフィルタが配置された領域の特徴量を算出する。この元画像へのフィルタの配置を予め決められたフィルタの移動幅を用いて入力データ全体に行い、算出した特徴量をまとめたものが、畳込演算の結果として出力される出力データとなる。このフォワード処理における畳込演算の結果である出力データは、「トップデータ」と呼ぶ。 Then, by multiplying each element of the input data in which the filter is arranged and each element of the filter, the feature amount of the area in which the filter is arranged in the input data is calculated. The arrangement of the filter on the original image is performed on the entire input data using the predetermined movement width of the filter, and the calculated feature amount is summarized as the output data output as the result of the convolution operation. The output data that is the result of the convolution operation in this forward processing is called "top data".

バックワード処理における畳込演算には、2つの演算が存在する。1つは、フォワード処理の計算結果であるトップデータと期待値との差分と、元画像とを用いて差分パラメータを算出する演算である。フォワード処理の計算結果であるトップデータと期待値との差分は、「トップ差分データ」と呼ばれる。また、算出される差分パラメータは、「重み差分データ」とよばれる。この重み差分データは、重みデータを更新してフォワード処理における計算精度を上げるために用いられる。もう1つは、トップ差分データと重みデータとを使用して、1つ前のバックワード処理の演算用の差分を算出する演算である。1つ前のバックワード処理の演算用の差分は、「ボトム差分データ」と呼ばれる。このボトム差分データが、1つ前の層におけるトップ差分データとして用いられる。 There are two operations in the convolution operation in backward processing. One is an operation of calculating the difference parameter using the difference between the top data and the expected value, which is the calculation result of the forward processing, and the original image. The difference between the top data and the expected value, which is the calculation result of the forward processing, is called "top difference data". Further, the calculated difference parameter is called "weight difference data". This weight difference data is used to update the weight data to improve the calculation accuracy in the forward processing. The other is an operation of calculating the difference for the operation of the previous backward processing by using the top difference data and the weight data. The difference for the calculation of the previous backward processing is called "bottom difference data". This bottom difference data is used as the top difference data in the previous layer.

特開2011−113168号公報Japanese Unexamined Patent Publication No. 2011-13168

しかしながら、畳込演算の総演算数は、以下のように計算できる。例えば、ボトムデータの要素データの数がC’×C’であり、ボトムデータの数がN個あり、重みデータの要素データの数がK×Kであり、トップ差分データの要素数がC×Cであり、トップデータの数をPの場合を考える。さらに、フォワード処理における1つの畳込演算が1つの乗算と1つの加算であるとする。この場合、フォワード処理の総演算数は、P×C×C×N×K×K×2となる。例えば、C=13、N=256、K=3、C=13及びP=256の場合、フォワード処理における総演算数は、256×13×13×256×3×3×2=1990360512である。ここで、重みデータのサイズが大きい場合などでは、高速フーリエ変換(FFT:Fast Fourier Transform)による高速化手法が有効であるが、その条件を満たさない場合、FFTによる演算拘束かの効果を得ることは困難である。そのため、特定の条件に縛られない畳込演算において、画像認識精度制度を維持しつつ演算数を軽減させることは困難である。 However, the total number of convolution operations can be calculated as follows. For example, the number of element data of bottom data is C'× C', the number of bottom data is N, the number of element data of weight data is K × K, and the number of elements of top difference data is C ×. Consider the case where C is and the number of top data is P. Further, it is assumed that one convolution operation in the forward processing is one multiplication and one addition. In this case, the total number of operations in the forward processing is P × C × C × N × K × K × 2. For example, in the case of C = 13, N = 256, K = 3, C = 13 and P = 256, the total number of operations in the forward processing is 256 × 13 × 13 × 256 × 3 × 3 × 2 = 1990360512. Here, when the size of the weight data is large, the speed-up method by Fast Fourier Transform (FFT) is effective, but when the condition is not satisfied, the effect of calculation constraint by FFT is obtained. It is difficult. Therefore, it is difficult to reduce the number of operations while maintaining the image recognition accuracy system in the convolution operation that is not bound by a specific condition.

開示の技術は、上記に鑑みてなされたものであって、画像認識精度制度を維持しつつ演算数を軽減させる演算処理装置及び演算処理装置の制御方法を提供することを目的とする。 The disclosed technique has been made in view of the above, and an object of the present invention is to provide an arithmetic processing unit and a control method of the arithmetic processing unit that reduce the number of arithmetic operations while maintaining an image recognition accuracy system.

本願の開示する演算処理装置及び演算処理装置の制御方法の一つの態様において、記憶部は、行列を形成する要素データを有する第1データ及び行列を形成する要素データから所定数の要素データを除いた配置形状を有する第2データを記憶する。変換部は、前記第2データの配置形状を基に前記第1データを変換する。畳込演算部は、前記変換部により変換された前記第1データに対して前記第2データをフィルタとして用いて畳み込み演算を行う。 In one embodiment of the arithmetic processing apparatus and the control method of the arithmetic processing apparatus disclosed in the present application, the storage unit excludes a predetermined number of element data from the first data having the element data forming the matrix and the element data forming the matrix. The second data having the arranged shape is stored. The conversion unit converts the first data based on the arrangement shape of the second data. The convolution calculation unit performs a convolution calculation on the first data converted by the conversion unit using the second data as a filter.

1つの側面では、本発明は、画像認識精度制度を維持しつつ演算数を軽減させることができる。 In one aspect, the present invention can reduce the number of operations while maintaining the image recognition accuracy system.

図1は、畳み込みニューラルネットにおける処理の全体的な流れを説明するための図である。FIG. 1 is a diagram for explaining the overall flow of processing in a convolutional neural network. 図2は、フォワード畳込演算及びバックワード畳込演算を説明するための図である。FIG. 2 is a diagram for explaining a forward convolution operation and a backward convolution operation. 図3は、演算処理層の詳細を表すブロック図である。FIG. 3 is a block diagram showing details of the arithmetic processing layer. 図4は、実施例1に係るフォワード畳込演算を行う畳込演算部の詳細を表すブロック図である。FIG. 4 is a block diagram showing details of a convolution calculation unit that performs a forward convolution operation according to the first embodiment. 図5は、フィルタ定義の一例を示す図である。FIG. 5 is a diagram showing an example of a filter definition. 図6は、ボトムデータの変換の一例を説明するための図である。FIG. 6 is a diagram for explaining an example of conversion of bottom data. 図7は、変換後のボトムデータの見た目を表す図である。FIG. 7 is a diagram showing the appearance of the bottom data after conversion. 図8は、ボトムデータの変換の一例を表す図である。FIG. 8 is a diagram showing an example of conversion of bottom data. 図9は、ボトムデータの変換の他の例を表す図である。FIG. 9 is a diagram showing another example of bottom data conversion. 図10は、新フィルタ定義を用いる場合のフォワード畳込演算を説明するための図である。FIG. 10 is a diagram for explaining a forward convolution operation when the new filter definition is used. 図11は、新フィルタ定義を用いる場合のバックワード畳込ボトム差分演算を説明するための図である。FIG. 11 is a diagram for explaining the backward convolution bottom difference operation when the new filter definition is used. 図12は、新フィルタ定義を用いる場合のバックワード畳込重み差分演算を説明するための図である。FIG. 12 is a diagram for explaining the backward convolution weight difference calculation when the new filter definition is used. 図13は、新フィルタ定義を使用する場合の演算処理層における処理のフローチャートである。FIG. 13 is a flowchart of processing in the arithmetic processing layer when the new filter definition is used. 図14は、実施例1に係る畳込演算部によるフォワード畳込演算のフローチャートである。FIG. 14 is a flowchart of the forward convolution calculation by the convolution calculation unit according to the first embodiment. 図15は、実施例1に係る畳込演算部によるバックワード畳込演算のフローチャートである。FIG. 15 is a flowchart of a backward convolution calculation by the convolution calculation unit according to the first embodiment. 図16は、実施例2に係るプーリング処理部によるストライド数が2の場合のプーリング処理を説明するための図である。FIG. 16 is a diagram for explaining a pooling process when the number of strides by the pooling process unit according to the second embodiment is 2. 図17は、実施例2に係るプーリング処理部によるストライド数が1の場合のプーリング処理を説明するための図である。FIG. 17 is a diagram for explaining a pooling process when the number of strides by the pooling process unit according to the second embodiment is 1. 図18は、実施例3に係る畳込演算部によるフォワード畳込演算を説明するための図である。FIG. 18 is a diagram for explaining a forward convolution operation by the convolution operation unit according to the third embodiment. 図19は、実施例4に係る畳込演算部による新フィルタ定義を用いたフォワード畳込演算の一例を説明するための図である。FIG. 19 is a diagram for explaining an example of a forward convolution operation using a new filter definition by the convolution operation unit according to the fourth embodiment. 図20は、実施例4に係る畳込演算部による新フィルタ定義を用いたフォワード畳込演算の他の例を説明するための図である。FIG. 20 is a diagram for explaining another example of the forward convolution operation using the new filter definition by the convolution operation unit according to the fourth embodiment. 図21は、フォワード畳込演算のプログラムの記述例を説明するための図である。FIG. 21 is a diagram for explaining a description example of a program for forward convolution operation. 図22は、バックワード畳込重み差分演算のプログラムの記述例を説明するための図である。FIG. 22 is a diagram for explaining a description example of a program for backward convolution weight difference calculation. 図23は、バックワード畳込ボトム差分演算のプログラムの記述例を説明するための図である。FIG. 23 is a diagram for explaining a description example of a program for backward convolution bottom difference calculation. 図24は、演算処理装置のハードウェア構成図である。FIG. 24 is a hardware configuration diagram of the arithmetic processing unit.

以下に、本願の開示する演算処理装置及び演算処理装置の制御方法の実施例を図面に基づいて詳細に説明する。なお、以下の実施例により本願の開示する演算処理装置及び演算処理装置の制御方法が限定されるものではない。 Hereinafter, examples of the arithmetic processing unit and the control method of the arithmetic processing unit disclosed in the present application will be described in detail with reference to the drawings. The following examples do not limit the arithmetic processing unit and the control method of the arithmetic processing unit disclosed in the present application.

図1は、畳み込みニューラルネット(CNN:Convolutional Neural Network)における処理の全体的な流れを説明するための図である。ここで、本実施例では、画像認識のためのCNNにおける処理について説明する。図1に示すように、演算処理装置1は、入力データ2の入力を受ける。演算処理装置1は、CNNにおいて複数の演算処理層11〜13による処理を実行する。以下では、各演算処理層11〜13を区別しない場合、単に「演算処理層10」という。 FIG. 1 is a diagram for explaining the overall flow of processing in a convolutional neural network (CNN). Here, in this embodiment, the processing in CNN for image recognition will be described. As shown in FIG. 1, the arithmetic processing unit 1 receives the input of the input data 2. The arithmetic processing unit 1 executes processing by a plurality of arithmetic processing layers 11 to 13 in the CNN. In the following, when the arithmetic processing layers 11 to 13 are not distinguished, they are simply referred to as “arithmetic processing layer 10”.

各演算処理層10では、矢印P1方向である伝播方向に向かって、特徴点の抽出などの演算処理を行う。以下では、演算処理装置1による矢印P1へ向かう方向の演算処理を、「フォワード演算」という場合がある。また、各演算処理層10では、矢印P2方向である逆伝播方向に向かって、各層における特徴点の抽出の精度を上げるために、矢印P2方向である逆伝播方向に向かって2種類の演算処理を行う。以下では、演算処理装置1による矢印P2へ向かう方向の演算処理を「バックワード演算」という場合がある。 In each arithmetic processing layer 10, arithmetic processing such as extraction of feature points is performed in the propagation direction which is the direction of arrow P1. In the following, the arithmetic processing in the direction toward the arrow P1 by the arithmetic processing unit 1 may be referred to as “forward arithmetic”. Further, in each arithmetic processing layer 10, two types of arithmetic processing are performed in the back propagation direction in the arrow P2 direction in order to improve the accuracy of extraction of feature points in each layer in the back propagation direction in the arrow P2 direction. I do. In the following, the arithmetic processing in the direction toward the arrow P2 by the arithmetic processing unit 1 may be referred to as “backward arithmetic”.

各演算処理層10は、それぞれ特徴量の抽出に用いるフィルタである重みデータをメモリなどの記憶装置から取得する。さらに、第1層である演算処理層11は、メモリなどの記憶装置から入力データ2を取得する。そして、演算処理層11は、入力データ2をボトムデータとして、ボトムデータに対して重みデータを用いて畳込演算を実行する。次に、第2層である演算処理層12は、演算処理層11からの出力データをボトムデータとして、そのボトムデータ及び重みデータを用いて畳込演算を行う。演算処理装置1は、このように各演算処理層10で演算処理を順次行い、第n層である演算処理層13での重みデータを用いた畳込演算の演算結果に対して正規化処理などを施した特徴量を表すデータを出力データ3として出力する。以下では、フォワード演算においてボトムデータと重みデータとを用いた畳込演算を、「フォワード畳込演算」という。 Each arithmetic processing layer 10 acquires weight data, which is a filter used for extracting a feature amount, from a storage device such as a memory. Further, the arithmetic processing layer 11, which is the first layer, acquires the input data 2 from a storage device such as a memory. Then, the arithmetic processing layer 11 executes the convolution operation using the input data 2 as the bottom data and the weight data for the bottom data. Next, the arithmetic processing layer 12, which is the second layer, uses the output data from the arithmetic processing layer 11 as bottom data, and performs the convolution operation using the bottom data and the weight data. In this way, the arithmetic processing device 1 sequentially performs arithmetic processing in each arithmetic processing layer 10, and normalizes the arithmetic result of the convolution operation using the weight data in the nth arithmetic processing layer 13. The data representing the feature amount subjected to the above is output as the output data 3. Hereinafter, the convolution operation using the bottom data and the weight data in the forward operation is referred to as a “forward convolution operation”.

さらに、各演算処理層10は、バックワード演算における畳込み演算の1つとして、期待値と出力データ3との差分であるトップ差分データを用いて重み差分データを求める。例えば、第n層である演算処理層13は、予め決められた期待値を有し、出力データ3と期待値とを比較する。そして、演算処理層13は、出力データ3と期待値との差分であるトップ差分データを求め、その求めたトップ差分データを入力データとして取得する。次に、演算処理層13は、入力データ及び第n層におけるフォワード畳込演算で用いたボトムデータを用いて重みデータの重みデータの期待値との差分である重み差分データを求める。そして、演算処理層13は、求めた重み差分データを用いて第n層における重みデータを修正する。さらに、演算処理層13は、もう1つのバックワード演算における畳込み演算として、修正した重みデータと出力データ3と期待値との差分とを用いてボトムデータとボトムデータの期待値との差分であるボトム差分データを算出する。 Further, each arithmetic processing layer 10 obtains the weight difference data by using the top difference data which is the difference between the expected value and the output data 3 as one of the convolution operations in the backward operation. For example, the arithmetic processing layer 13, which is the nth layer, has a predetermined expected value, and compares the output data 3 with the expected value. Then, the arithmetic processing layer 13 obtains the top difference data which is the difference between the output data 3 and the expected value, and acquires the obtained top difference data as input data. Next, the arithmetic processing layer 13 obtains the weight difference data which is the difference from the expected value of the weight data of the weight data by using the input data and the bottom data used in the forward convolution operation in the nth layer. Then, the arithmetic processing layer 13 corrects the weight data in the nth layer by using the obtained weight difference data. Further, the arithmetic processing layer 13 uses the difference between the corrected weight data, the output data 3, and the expected value as a convolution operation in another backward arithmetic, and uses the difference between the bottom data and the expected value of the bottom data. Calculate some bottom difference data.

次に、第n−1層の演算処理層10は、演算処理層13において算出されたボトム差分データに逆プーリング処理や逆正規化処理が施されたデータをトップ差分データとして取得する。次に、第n−1層の演算処理層10は、第n−1層におけるフォワード畳込演算で用いたボトムデータとトップ差分データとを用いて重み差分データを算出する。そして、第n−1層の演算処理層10は、求めた重み差分データを用いて第n−1層における重みデータを修正する。さらに、第n−1層の演算処理層10は、修正した重みデータとトップ差分データとを用いて第n−1層におけるボトム差分データを算出する。演算処理装置1は、上述したバックワード演算における畳込演算を第1層まで繰り返す。以下では、バックワード演算における畳込演算を、「バックワード畳込演算」という。 Next, the arithmetic processing layer 10 of the n-1th layer acquires data obtained by subjecting the bottom difference data calculated in the arithmetic processing layer 13 to reverse pooling processing or denormalization processing as top difference data. Next, the arithmetic processing layer 10 of the n-1th layer calculates the weight difference data using the bottom data and the top difference data used in the forward convolution operation in the n-1th layer. Then, the arithmetic processing layer 10 of the n-1th layer corrects the weight data in the n-1th layer by using the obtained weight difference data. Further, the arithmetic processing layer 10 of the n-1th layer calculates the bottom difference data in the n-1th layer by using the modified weight data and the top difference data. The arithmetic processing unit 1 repeats the convolution operation in the backward operation described above up to the first layer. Hereinafter, the convolution operation in the backward operation is referred to as "backword convolution operation".

すなわち、矢印P1方向を各層の並び方向として、演算処理装置1は、特定の演算処理層10の1つ先の層の演算処理層10において特定の演算処理層10におけるトップ差分データを算出する。そして、演算処理装置1は、算出したトップ差分データと1つ前の演算処理層10の出力データであるボトムデータとを用いて、特定の演算処理層10における重み差分データを求める。そして、演算処理装置1は、求めた特定の演算処理層10における重み差分データを用いて特定の演算処理層10が使用する重みデータを修正する。さらに、演算処理装置1は、トップ差分データと特定の演算処理層10におけるボトム差分データを算出する。 That is, with the arrow P1 direction as the arrangement direction of each layer, the arithmetic processing unit 1 calculates the top difference data in the specific arithmetic processing layer 10 in the arithmetic processing layer 10 which is one layer ahead of the specific arithmetic processing layer 10. Then, the arithmetic processing unit 1 obtains the weight difference data in the specific arithmetic processing layer 10 by using the calculated top difference data and the bottom data which is the output data of the previous arithmetic processing layer 10. Then, the arithmetic processing unit 1 corrects the weight data used by the specific arithmetic processing layer 10 by using the weight difference data in the specific arithmetic processing layer 10 obtained. Further, the arithmetic processing unit 1 calculates the top difference data and the bottom difference data in the specific arithmetic processing layer 10.

以下では、バックワード畳込演算において、トップ差分データとボトムデータとを用いて重み差分データを求める演算を、「バックワード畳込重み差分演算」という。さらに、修正された重みデータとトップ差分データとを用いてボトム差分データを算出する演算を、「バックワード畳込ボトム差分演算」という。 In the following, in the backward convolution operation, the operation of obtaining the weight difference data by using the top difference data and the bottom data is referred to as "backward convolution weight difference operation". Further, the operation of calculating the bottom difference data using the corrected weight data and the top difference data is called "backward convolution bottom difference calculation".

演算処理装置1は、各演算処理層10における重みデータの修正及び1つ前の演算処理層におけるトップ差分データの算出を順次繰り返ことにより、各演算処理層10の全ての層の重みデータを演算処理層13の出力データ3の期待値に合わせて修正する。 The arithmetic processing unit 1 sequentially repeats the correction of the weight data in each arithmetic processing layer 10 and the calculation of the top difference data in the previous arithmetic processing layer 10 to obtain the weight data of all the layers of each arithmetic processing layer 10. It is modified according to the expected value of the output data 3 of the arithmetic processing layer 13.

演算処理装置1は、各層で取得した特徴量を用いて繰り返しパラメータ更新する学習することで、画像認識の精度を向上させ、精度の高い画像認識を行うことができる。また、例えば、音声認識の場合には、入力データ2は音声データとなり、テキストマイニングの場合には入力データ2は単語となる。 The arithmetic processing unit 1 can improve the accuracy of image recognition and perform highly accurate image recognition by learning to repeatedly update parameters using the feature amounts acquired in each layer. Further, for example, in the case of voice recognition, the input data 2 becomes voice data, and in the case of text mining, the input data 2 becomes a word.

ここで、本実施例では、画像データで有るボトムデータを方形に行列として並んだ要素データを有する場合で説明する。以下では、フォワード畳込演算における重みデータの1回の移動量を「ストライド数」という場合がある。 Here, in this embodiment, the case where the bottom data, which is the image data, has the element data arranged as a matrix in a square will be described. In the following, the amount of movement of weight data at one time in the forward convolution operation may be referred to as “the number of strides”.

ここで、図2を参照して、係るフォワード畳込演算及びバックワード演算をさらに説明する。図2は、フォワード畳込演算及びバックワード畳込演算を説明するための図である。図2は、入力データ2を用いて演算処理を始める第1層から出力データ206と期待値207からトップ差分データ203を生成する第n層までを表す。ここでは、演算処理層11を第1層とし、演算処理層14を第n−1層とし、演算処理層13を第n層として、第n層まで各演算処理層11〜14における演算を例に記載した。また、図2中の円で記載した処理は演算処理を表す。演算処理F1は、フォワード畳込演算を表す。演算処理F2は、バックワード畳込重み差分演算を表す。また、演算処理F3は、バックワード畳込ボトム差分演算を表す。 Here, with reference to FIG. 2, the forward convolution operation and the backward operation will be further described. FIG. 2 is a diagram for explaining a forward convolution operation and a backward convolution operation. FIG. 2 shows from the first layer that starts arithmetic processing using the input data 2 to the nth layer that generates the top difference data 203 from the output data 206 and the expected value 207. Here, the arithmetic processing layer 11 is the first layer, the arithmetic processing layer 14 is the n-1th layer, the arithmetic processing layer 13 is the nth layer, and the arithmetic operations in the arithmetic processing layers 11 to 14 up to the nth layer are examples. Described in. Further, the processing described by the circle in FIG. 2 represents an arithmetic processing. The arithmetic processing F1 represents a forward convolution operation. The calculation process F2 represents a backward convolution weight difference calculation. Further, the calculation process F3 represents a backward convolution bottom difference calculation.

演算処理装置1は、演算処理層11において入力データ2及び第1層での重みデータ202に対して演算処理F1で表されるフォワード畳込演算を行い、トップデータ209を算出する。その後は、図示しないが、同様に次の第2層において、前の層において算出されたトップデータ209から取得したボトムデータ201及び第2層での重みデータ202に対して同様に演算処理F1で表されるフォワード畳込演算を行う。各演算処理層10は同様のフォワード演算を繰り返す。そして、最後の第n層である演算処理層13は、同様に演算処理層14において算出されたトップデータ209から取得したボトムデータ201及び第n層での重みデータ202に対して演算処理F1で表されるフォワード畳込演算を行う。 The arithmetic processing unit 1 performs a forward convolution operation represented by the arithmetic processing F1 on the input data 2 and the weight data 202 in the first layer in the arithmetic processing layer 11, and calculates the top data 209. After that, although not shown, similarly, in the next second layer, the bottom data 201 acquired from the top data 209 calculated in the previous layer and the weight data 202 in the second layer are similarly subjected to the arithmetic processing F1. Perform the represented forward convolution operation. Each arithmetic processing layer 10 repeats the same forward arithmetic. Then, the final nth layer, the arithmetic processing layer 13, is subjected to the arithmetic processing F1 with respect to the bottom data 201 acquired from the top data 209 calculated in the arithmetic processing layer 14 and the weight data 202 in the nth layer. Perform the represented forward convolution operation.

さらに、演算処理層13は、出力データ3と期待値207とを比較して、トップ差分データ203を算出する。ここで、入力データ2は、第2層〜第n層におけるボトムデータ201にあたるため、以下では、第1層のボトムデータ201として扱う。また、第n層の出力データ3は、第1層〜第n−1層におけるトップデータ209にあたる。 Further, the arithmetic processing layer 13 compares the output data 3 with the expected value 207 to calculate the top difference data 203. Here, since the input data 2 corresponds to the bottom data 201 in the second layer to the nth layer, it is treated as the bottom data 201 of the first layer below. Further, the output data 3 of the nth layer corresponds to the top data 209 in the first layer to the n-1th layer.

バックワード演算の場合、演算処理層13は、トップ差分データ203及びボトムデータ201に対して演算処理F2で表される畳み込みバックワードの重み差分演算を行い、重み差分データ204を算出する。さらに、演算処理層13は、重み差分データ204を用いて重みデータ202を更新する。ここで、図2における一点鎖線の矢印が重みデータ202の更新の処理を表す。具体的には、演算処理装置1は、重み差分データ204に学習率を乗算して、新たな重みデータ202を算出する。さらに、演算処理層13は、フォワード畳込演算で使用した重みデータ202及びトップ差分データ203に対して演算処理F3で表されるバックワード畳込ボトム差分演算を行い、ボトム差分データ205を算出する。 In the case of the backward calculation, the arithmetic processing layer 13 performs the weight difference calculation of the convolution backward represented by the arithmetic processing F2 on the top difference data 203 and the bottom data 201, and calculates the weight difference data 204. Further, the arithmetic processing layer 13 updates the weight data 202 by using the weight difference data 204. Here, the arrow of the alternate long and short dash line in FIG. 2 represents the process of updating the weight data 202. Specifically, the arithmetic processing unit 1 multiplies the weight difference data 204 by the learning rate to calculate new weight data 202. Further, the arithmetic processing layer 13 performs the backward convolution bottom difference calculation represented by the arithmetic processing F3 on the weight data 202 and the top difference data 203 used in the forward convolution operation, and calculates the bottom difference data 205. ..

演算処理層14は、演算処理層13が出力したボトム差分データ205から取得したトップ差分データ203及びボトムデータ201に対して演算処理F2で表される畳み込みバックワードの重み差分演算を行い、重み差分データ204を算出する。さらに、演算処理層14は、重み差分データ204を用いて重みデータ202を更新する。さらに、演算処理層14は、フォワード畳込演算で使用した重みデータ202及びトップ差分データ203に対して演算処理F3で表されるバックワード畳込ボトム差分演算を行い、ボトム差分データ205を算出する。各演算処理層10は同様のバックワード演算を繰り返す。そして、最後の第1層である演算処理層11は、同様に第2層で算出されたボトム差分データ205から取得したトップ差分データ203を用いて、バックワード畳込重み差分演算及びバックワード畳込ボトム差分演算を行う。 The arithmetic processing layer 14 performs a weight difference calculation of the convolution backward represented by the arithmetic processing F2 on the top difference data 203 and the bottom data 201 acquired from the bottom difference data 205 output by the arithmetic processing layer 13, and the weight difference. Data 204 is calculated. Further, the arithmetic processing layer 14 updates the weight data 202 by using the weight difference data 204. Further, the arithmetic processing layer 14 performs the backward convolution bottom difference calculation represented by the arithmetic processing F3 on the weight data 202 and the top difference data 203 used in the forward convolution operation, and calculates the bottom difference data 205. .. Each arithmetic processing layer 10 repeats the same backward arithmetic. Then, the arithmetic processing layer 11, which is the last first layer, uses the top difference data 203 acquired from the bottom difference data 205 similarly calculated in the second layer, and uses the backward convolution weight difference calculation and the backward tatami. Performs included bottom difference calculation.

図3は、演算処理層の詳細を表すブロック図である。演算処理層10は、フォワード演算を実行する機能部として、畳込演算部101、活性化処理部102及びプーリング処理部103を有する。また、演算処理層10は、バックワード演算を実行する機能部として、プーリング処理部104、活性化処理部105及び畳込演算部106を有する。 FIG. 3 is a block diagram showing details of the arithmetic processing layer. The arithmetic processing layer 10 has a convolution arithmetic unit 101, an activation processing unit 102, and a pooling processing unit 103 as functional units that execute forward operations. In addition, the arithmetic processing layer 10 has a pooling processing unit 104, an activation processing unit 105, and a convolution operation unit 106 as functional units for executing backward operations.

畳込演算部101は、前段の演算処理層10からの出力データを用いて後述する畳込演算を行う。ここで、図4を参照して、畳込演算部101についてさらに詳細に説明する。図4は、実施例1に係るフォワード畳込演算を行う畳込演算部の詳細を表すブロック図である。図4に示すように、畳込演算部101は、入力データ処理部111、乗算部112、加算部113、出力データ作成部114及び重みデータ記憶部115を有する。 The convolution calculation unit 101 performs a convolution calculation described later using the output data from the calculation processing layer 10 in the previous stage. Here, the convolution calculation unit 101 will be described in more detail with reference to FIG. FIG. 4 is a block diagram showing details of a convolution calculation unit that performs a forward convolution operation according to the first embodiment. As shown in FIG. 4, the convolution calculation unit 101 includes an input data processing unit 111, a multiplication unit 112, an addition unit 113, an output data creation unit 114, and a weight data storage unit 115.

重みデータ記憶部115は、フォワード畳込演算に使用する複数種類のフィルタ定義に対応する重みデータ202を記憶する。本実施例では、重みデータ記憶部115は、図5に示す新フィルタ定義301及びフィルタ定義302を使用して作成された重みデータ202を記憶する。図5は、フィルタ定義の一例を示す図である。フィルタ定義302は、3×3のサイズを有する従来のフィルタ定義である。新フィルタ定義301は、フィルタ定義302に対応する新しいフィルタ定義である。 The weight data storage unit 115 stores weight data 202 corresponding to a plurality of types of filter definitions used in the forward convolution operation. In this embodiment, the weight data storage unit 115 stores the weight data 202 created by using the new filter definition 301 and the filter definition 302 shown in FIG. FIG. 5 is a diagram showing an example of a filter definition. The filter definition 302 is a conventional filter definition having a size of 3 × 3. The new filter definition 301 is a new filter definition corresponding to the filter definition 302.

新フィルタ定義301は、軸311〜314に関して中心に対して対称性を有する。すなわち、新フィルタ定義301は、縦横斜めの方向に対称性を有しており、画像の縦横斜め方向に対する画像認識を精度良く行うことができる。したがって、新フィルタ定義301は、フィルタ定義302を用いた場合に比べて画像認識の精度の低下は少なく、十分に画像認識を行うことができる。 The new filter definition 301 has symmetry with respect to the center with respect to axes 31 to 314. That is, the new filter definition 301 has symmetry in the vertical, horizontal, and diagonal directions, and can accurately recognize the image in the vertical, horizontal, and diagonal directions. Therefore, the new filter definition 301 has less decrease in image recognition accuracy than the case where the filter definition 302 is used, and can sufficiently perform image recognition.

本実施例では、3×3の重みデータ202を用いたが、重みデータ記憶部115は、サイズの異なる重みデータ202を記憶してもよい。例えば、重みデータ記憶部115は、新フィルタ定義303及びフィルタ定義304を記憶してもよい。フィルタ定義304は、5×5のサイズを有する従来のフィルタ定義である。新フィルタ定義303は、フィルタ定義304に対応する新しいフィルタ定義である。新フィルタ定義303も、軸331〜334に関して中心に対して対称性を有する。すなわち、新フィルタ定義303は、フィルタ定義304を用いた場合に比べて画像認識の精度の低下は少なく、十分に画像認識を行うことができる。新フィルタ定義301や303は、行方向及び列方向に同数の要素データが配置された状態から真ん中の行から1つ離れるにしたがい行の含まれる要素データが1つずつのぞかれる。さらに、新フィルタ定義301や303は、要素データを除いた行の半分の位置と要素データを除く前の行の半分の位置とが一致するように行がずらされる。 In this embodiment, 3 × 3 weight data 202 is used, but the weight data storage unit 115 may store weight data 202 having different sizes. For example, the weight data storage unit 115 may store the new filter definition 303 and the filter definition 304. The filter definition 304 is a conventional filter definition having a size of 5 × 5. The new filter definition 303 is a new filter definition corresponding to the filter definition 304. The new filter definition 303 also has center symmetry with respect to axes 331-334. That is, the new filter definition 303 has less decrease in image recognition accuracy than the case where the filter definition 304 is used, and can sufficiently perform image recognition. In the new filter definitions 301 and 303, the element data including the row is peeked one by one according to the distance from the middle row from the state where the same number of element data are arranged in the row direction and the column direction. Further, in the new filter definitions 301 and 303, the rows are shifted so that the position of half of the row excluding the element data and the position of half of the row before excluding the element data match.

また、本実施例では、新フィルタ定義301及び303という2種類のフィルタ定義について説明したが、フィルタ定義302や304といった従来のフィルタ定義に比べて要素データの数が少ないものであれば新フィルタ定義はこれに限らない。ただし、新フィルタ定義は、縦横斜めの方向に中心に対して対称性を有することが好ましい。以下では、新フィルタ定義301を使用して作成された重みデータ202を「重みデータ221」という。 Further, in this embodiment, two types of filter definitions, the new filter definitions 301 and 303, have been described, but if the number of element data is smaller than that of the conventional filter definitions such as the filter definitions 302 and 304, the new filter definition is defined. Is not limited to this. However, it is preferable that the new filter definition has symmetry with respect to the center in the vertical, horizontal, and diagonal directions. In the following, the weight data 202 created by using the new filter definition 301 will be referred to as “weight data 221”.

入力データ処理部111は、フォワード演算における前段の演算処理層10からボトムデータ201の入力を受ける。このボトムデータ201が、「第1データ」の一例にあたる。そして、入力データ処理部111は、重みデータ記憶部115から重みデータ202を取得する。次に、入力データ処理部111は、図示しない入力装置から入力された操作者からの指示から画像判定に新フィルタ定義301を用いるか否かを判定する。新フィルタ定義301を用いない場合、入力データ処理部111は、フィルタ定義302を使用して作成された重みデータ202を用いることを乗算部112に伝えるとともに、ボトムデータを出力する。 The input data processing unit 111 receives the input of the bottom data 201 from the arithmetic processing layer 10 in the previous stage in the forward operation. This bottom data 201 corresponds to an example of "first data". Then, the input data processing unit 111 acquires the weight data 202 from the weight data storage unit 115. Next, the input data processing unit 111 determines whether or not to use the new filter definition 301 for image determination based on an instruction from an operator input from an input device (not shown). When the new filter definition 301 is not used, the input data processing unit 111 informs the multiplication unit 112 that the weight data 202 created by using the filter definition 302 is used, and outputs bottom data.

一方、新フィルタ定義301を用いる場合、入力データ処理部111は、入力されたボトムデータ201が新フィルタ定義301に対応するデータか否かを判定する。ボトムデータ201が新フィルタ定義301に対応するデータの場合、入力データ処理部111は、新フィルタ定義301を使用して作成された重みデータ221を用いることを乗算部112に伝えるとともに、ボトムデータを出力する。この重みデータ221が、「第2データ」の一例にあたる。 On the other hand, when the new filter definition 301 is used, the input data processing unit 111 determines whether or not the input bottom data 201 is data corresponding to the new filter definition 301. When the bottom data 201 is data corresponding to the new filter definition 301, the input data processing unit 111 informs the multiplication unit 112 that the weight data 221 created by using the new filter definition 301 is used, and also transmits the bottom data. Output. This weight data 221 corresponds to an example of "second data".

これに対して、ボトムデータ201が新フィルタ定義301に対応していないデータの場合、入力データ処理部111は、ボトムデータ201を新フィルタ定義301に合わせて変換する。図6は、ボトムデータの変換の一例を説明するための図である。 On the other hand, when the bottom data 201 does not correspond to the new filter definition 301, the input data processing unit 111 converts the bottom data 201 according to the new filter definition 301. FIG. 6 is a diagram for explaining an example of conversion of bottom data.

本実施例では、入力データ処理部111は、ボトムデータ201の隔行について、隣接する要素データとの平均を算出して、要素データの位置に格納する。例えば、図6に示す8×8の要素データb00〜b63を有するボトムデータ201の場合について説明する。入力データ処理部111は、1行目を飛ばして2行目を先頭に隔行を変更する行とする。 In this embodiment, the input data processing unit 111 calculates the average with the adjacent element data for the interval of the bottom data 201 and stores it at the position of the element data. For example, the case of bottom data 201 having 8 × 8 element data b00 to b63 shown in FIG. 6 will be described. The input data processing unit 111 skips the first line and sets the second line as the first line to change the interval.

まず、入力データ処理部111は、2行目の要素データb08と要素データb09との平均である要素データnb08を算出し、要素データb08の位置に格納する。次に、入力データ処理部111は、要素データb09と要素データb10との平均である要素データnbv09を算出し、要素データb09の位置に格納する。このように、入力データ処理部111は、隣合う2つの要素データの平均値を若番の要素データの位置に格納することを要素データb08〜b15まで繰り返す。ただし、要素データb15に関しては、右隣に次の要素データb16が存在しない。そこで、要素データb15の右隣りには、平均を出すための要素データとして値が0である要素データが隣に存在するものとして計算を行う。すなわち、入力データ処理部111は、要素データb15と0の要素データとの平均である要素データnb15を算出し、要素データb15の位置に格納する。このように、入力データ処理部111は、変換後の2行目の要素データnb08〜nb15を算出する。 First, the input data processing unit 111 calculates the element data nb08, which is the average of the element data b08 and the element data b09 in the second line, and stores the element data nb08 at the position of the element data b08. Next, the input data processing unit 111 calculates the element data nbv09, which is the average of the element data b09 and the element data b10, and stores it at the position of the element data b09. In this way, the input data processing unit 111 repeats storing the average value of the two adjacent element data at the position of the younger element data from the element data b08 to b15. However, regarding the element data b15, the next element data b16 does not exist on the right side. Therefore, on the right side of the element data b15, the calculation is performed assuming that the element data having a value of 0 exists next to the element data for calculating the average. That is, the input data processing unit 111 calculates the element data nb15, which is the average of the element data b15 and the element data of 0, and stores the element data nb15 at the position of the element data b15. In this way, the input data processing unit 111 calculates the element data nb08 to nb15 of the second line after conversion.

同様に、入力データ処理部111は、4,6及び8行目の要素データnb24〜nb31,nb40〜nb47及びnb56〜nb63を算出する。これにより、入力データ処理部111は、ボトムデータ201を変換したボトムデータ211を作成する。以下では、ボトムデータ211の全ての要素データを表す場合には要素データb00〜nb63と表記する。 Similarly, the input data processing unit 111 calculates the element data nb24 to nb31, nb40 to nb47, and nb56 to nb63 on the fourth, sixth, and eighth lines. As a result, the input data processing unit 111 creates the bottom data 211 obtained by converting the bottom data 201. In the following, when all the element data of the bottom data 211 is represented, it is expressed as element data b00 to nb63.

図7は、変換後のボトムデータの見た目を表す図である。ボトムデータ211の要素データb00〜nb63は、各ドットに割り当てた状態で配置される。すなわち、演算処理装置1は、変換したボトムデータ211を用いてフォワード畳込演算を行う。ただし、画像としての実際の見た目は、変換を行った各行の要素データnb08〜nb15,nb24〜nb31,nb40〜nb47及びnb56〜nb63が右側にドットの半分ずつずらされたボトムデータ210となる。すなわち、見た目は、図7に示すように、ボトムデータ211の見た目はボトムデータ210として表すことができる。以下では、分かり易いように、変換後のボトムデータ211を見た目のボトムデータ210を用いて説明する。 FIG. 7 is a diagram showing the appearance of the bottom data after conversion. The element data b00 to nb63 of the bottom data 211 are arranged in a state of being assigned to each dot. That is, the arithmetic processing unit 1 performs a forward convolution operation using the converted bottom data 211. However, the actual appearance as an image is the bottom data 210 in which the element data nb08 to nb15, nb24 to nb31, nb40 to nb47, and nb56 to nb63 of each converted line are shifted to the right by half a dot. That is, as shown in FIG. 7, the appearance of the bottom data 211 can be represented as the bottom data 210. In the following, for the sake of clarity, the converted bottom data 211 will be described using the apparent bottom data 210.

ここで、図8及び9を参照して、さらに具体的にボトムデータ201の変換について説明する。図8は、ボトムデータの変換の一例を表す図である。また、図9は、ボトムデータの変換の他の例を表す図である。 Here, the conversion of the bottom data 201 will be described more specifically with reference to FIGS. 8 and 9. FIG. 8 is a diagram showing an example of conversion of bottom data. Further, FIG. 9 is a diagram showing another example of conversion of bottom data.

例えば、図8のように、ボトムデータ201として漢数字の三が入力データ処理部111に入力された場合で説明する。この場合、ボトムデータ201の2行目に三の一番上の線が存在し、5行目に三の真ん中の線が存在し、8行目に三の一番下の線が存在する。各要素データb00〜b63は、濃淡情報30で表される値を有する。ボトムデータ201において三を表す要素データ以外の要素データは、白色を表す0を値として有する。さらに、ボトムデータ201において三を表す要素データは、黒を表す値255を有する。 For example, as shown in FIG. 8, the case where the Chinese numeral three is input to the input data processing unit 111 as the bottom data 201 will be described. In this case, the top line of the three exists in the second line of the bottom data 201, the middle line of the three exists in the fifth line, and the bottom line of the three exists in the eighth line. Each element data b00 to b63 has a value represented by the shade information 30. The element data other than the element data representing 3 in the bottom data 201 has 0 representing white as a value. Further, the element data representing three in the bottom data 201 has a value 255 representing black.

入力データ処理部111は、2行目の要素データb08〜b15の隣り合うデータの平均を算出して、変換後の要素データnb08〜nb15を算出する。この場合、要素データnb08は、値127を有する。また、要素データnb09〜nb13は、値255を有する。また、要素データnb14は、値127を有する。さらに、要素データnb15は、値として0を有する。 The input data processing unit 111 calculates the average of the adjacent data of the element data b08 to b15 of the second line, and calculates the element data nb08 to nb15 after conversion. In this case, the element data nb08 has a value of 127. Further, the element data nb09 to nb13 have a value of 255. Further, the element data nb14 has a value 127. Further, the element data nb15 has 0 as a value.

また、入力データ処理部111は、4及び6行目の要素データb24〜b31及びb40〜b47の隣り合うデータの平均を算出して、変換後の要素データnb24〜nb31及びnb40〜nb47を算出する。この場合、4及び6行目は要素データb24〜b31及びb40〜b47は全て値が0であるので、変換後の要素データnb24〜nb31及びnb40〜nb47も全て値が0である。 Further, the input data processing unit 111 calculates the average of adjacent data of the element data b24 to b31 and b40 to b47 in the 4th and 6th lines, and calculates the converted element data nb24 to nb31 and nb40 to nb47. .. In this case, since the values of the element data b24 to b31 and b40 to b47 are all 0 in the 4th and 6th lines, the values of the converted element data nb24 to nb31 and nb40 to nb47 are also 0.

さらに、入力データ処理部111は、8行目の要素データb56〜b63の隣り合うデータの平均を算出して、変換後の要素データnb56〜nb63を算出する。この場合、要素データnb56〜nb62は、値255を有する。また、要素データnb64は、値127を有する。 Further, the input data processing unit 111 calculates the average of the adjacent data of the element data b56 to b63 on the eighth line, and calculates the converted element data nb56 to nb63. In this case, the element data nb56 to nb62 have a value of 255. Further, the element data nb64 has a value 127.

入力データ処理部111は、漢数字の三を表す画像であるボトムデータ201を変換する。その場合、変換後のボトムデータ210は、図8に示すように、濃淡にわずかな違いが存在する漢数字の三を表す画像となる。 The input data processing unit 111 converts the bottom data 201, which is an image representing the three Chinese numerals. In that case, as shown in FIG. 8, the converted bottom data 210 is an image representing the three Chinese numerals having a slight difference in shading.

次に、図9のように、ボトムデータ201として対角線の画像が入力データ処理部111に入力された場合で説明する。この場合、ボトムデータ201の対角線に線が存在する。この場合も、各要素データb00〜b63は、図8における濃淡情報30で表される値を有する。対角線を表す要素データb00,b09,b18,b27,b36,b45,b54及びb63が、グレーを表す値を有し、他の要素データは値として0を有する。 Next, as shown in FIG. 9, a case where a diagonal image is input to the input data processing unit 111 as bottom data 201 will be described. In this case, a line exists on the diagonal line of the bottom data 201. Also in this case, each element data b00 to b63 has a value represented by the shade information 30 in FIG. The element data b00, b09, b18, b27, b36, b45, b54 and b63 representing the diagonal line have a value representing gray, and the other element data has a value of 0.

そして、入力データ処理部111は、要素データb08〜b15,b24〜b31,b40〜b47及びb56〜b63の隣り合うデータの平均を算出し、要素データnb08〜nb15,nb24〜nb31,nb40〜nb47及びnb56〜nb63を求める。この場合、要素データnb08,nb09,nb26,nb27nb44,nb45,nb62及びnb63は、要素データb08〜b15,b24〜b31,b40〜b47及びb56〜b63の半分の値を有する。また、要素データnb10〜nb15,nb24〜nb25,nb28〜nb31,nb40〜nb43,nb46〜nb47及びnb56〜nb61は値として0を有する。 Then, the input data processing unit 111 calculates the average of the adjacent data of the element data b08 to b15, b24 to b31, b40 to b47 and b56 to b63, and the element data nb08 to nb15, nb24 to nb31, nb40 to nb47 and Find nb56 to nb63. In this case, the element data nb08, nb09, nb26, nb27nb44, nb45, nb62 and nb63 have half the values of the element data b08 to b15, b24 to b31, b40 to b47 and b56 to b63. Further, the element data nb10 to nb15, nb24 to nb25, nb28 to nb31, nb40 to nb43, nb46 to nb47 and nb56 to nb61 have 0 as a value.

この場合、入力データ処理部111は、対角線を表す画像であるボトムデータ201を変換する。その場合、変換後のボトムデータ210は、図9に示すように、濃淡にわずかな違いが存在する対角線を表す画像となる。 In this case, the input data processing unit 111 converts the bottom data 201, which is an image representing the diagonal line. In that case, the converted bottom data 210 is an image representing a diagonal line in which there is a slight difference in shading, as shown in FIG.

このように、入力データ処理部111により変換されることで作成されるボトムデータ210は、縦横方向及び斜め方向に変換前のボトムデータ201と同じ画像として用いることが可能な画像となる。画像は縦線、横線及び斜め線の組み合わせでほぼ表すことが可能であるため、変換後のボトムデータ210は、変換前のボトムデータ201と同様の画像として使用可能である。 In this way, the bottom data 210 created by being converted by the input data processing unit 111 becomes an image that can be used as the same image as the bottom data 201 before conversion in the vertical and horizontal directions and the diagonal direction. Since the image can be substantially represented by a combination of vertical lines, horizontal lines, and diagonal lines, the converted bottom data 210 can be used as an image similar to the unconverted bottom data 201.

そして、入力データ処理部111は、変換後のボトムデータ210を乗算部112へ出力する。さらに、入力データ処理部111は、重みデータ221を用いることを乗算部112へ通知する。 Then, the input data processing unit 111 outputs the converted bottom data 210 to the multiplication unit 112. Further, the input data processing unit 111 notifies the multiplication unit 112 that the weight data 221 is used.

ここで、図1における第1層の演算処理層11においては、入力データ処理部111は、外部から入力された入力データ2をボトムデータ201として使用するため、ボトムデータ201が新フィルタ定義301に対応していない場合がある。その場合に、入力データ処理部111は、ボトムデータ201を新フィルタ定義301に合わせるために変換する。これに対して、図1における第2層以降の演算処理層12〜13では、前段の演算処理層10から出力されるトップデータ209は既に新フィルタ定義301に対応しているので、入力データ処理部111は、変換を行わずにそのまま乗算部112へボトムデータ201を出力することができる。この入力データ処理部111が、「変換部」の一例にあたる。 Here, in the arithmetic processing layer 11 of the first layer in FIG. 1, the input data processing unit 111 uses the input data 2 input from the outside as the bottom data 201, so that the bottom data 201 becomes the new filter definition 301. It may not be supported. In that case, the input data processing unit 111 converts the bottom data 201 to match the new filter definition 301. On the other hand, in the arithmetic processing layers 12 to 13 of the second and subsequent layers in FIG. 1, the top data 209 output from the arithmetic processing layer 10 in the previous stage already corresponds to the new filter definition 301, so that the input data processing The unit 111 can output the bottom data 201 to the multiplication unit 112 as it is without performing conversion. This input data processing unit 111 corresponds to an example of a “conversion unit”.

乗算部112は、新フィルタ定義301を用いない場合、フィルタ定義302を使用して作成された重みデータ202の使用の通知を入力データ処理部111から受ける。さらに、乗算部112は、変換を行っていないボトムデータ201の入力を受ける。 When the new filter definition 301 is not used, the multiplication unit 112 receives a notification from the input data processing unit 111 of the use of the weight data 202 created by using the filter definition 302. Further, the multiplication unit 112 receives the input of the bottom data 201 that has not been converted.

乗算部112は、フィルタ定義302を使用して作成された重みデータ202とボトムデータ201と用いて通常のフォワード畳込演算における各要素データの乗算を行う。そして、乗算部112は、乗算結果を加算部113へ出力する。 The multiplication unit 112 multiplies each element data in the normal forward convolution operation by using the weight data 202 and the bottom data 201 created by using the filter definition 302. Then, the multiplication unit 112 outputs the multiplication result to the addition unit 113.

また、新フィルタ定義301を用いる場合、乗算部112は、重みデータ221の使用の通知を入力データ処理部111から受ける。さらに、乗算部112は、新フィルタ定義301に対応したボトムデータ201又は新フィルタ定義301に対応するように変換されたボトムデータ210の入力を受ける。そして、乗算部112は、入力されたボトムデータ201又は210と重みデータ221とを用いてフォワード畳込演算における各要素データの乗算を行う。 Further, when the new filter definition 301 is used, the multiplication unit 112 receives a notification of the use of the weight data 221 from the input data processing unit 111. Further, the multiplication unit 112 receives the input of the bottom data 201 corresponding to the new filter definition 301 or the bottom data 210 converted so as to correspond to the new filter definition 301. Then, the multiplication unit 112 multiplies each element data in the forward convolution operation by using the input bottom data 201 or 210 and the weight data 221.

例えば、変換後とボトムデータ210を用いる場合の乗算方法を、図10を参照して説明する。図10は、新フィルタ定義を用いる場合のフォワード畳込演算を説明するための図である。ここでは、重みデータ221の1回の移動量であるストライド数が1の場合で説明する。また、以下では、図10におけるボトムデータ210の列が伸びる方向、すなわち縦の方向を「列方向」と言い、行が伸びる方向、すなわち横の方向を「行方向」と言う。 For example, the multiplication method after conversion and when the bottom data 210 is used will be described with reference to FIG. FIG. 10 is a diagram for explaining a forward convolution operation when the new filter definition is used. Here, the case where the number of strides, which is the amount of movement of the weight data 221 at one time, is 1, will be described. Further, in the following, the direction in which the columns of the bottom data 210 in FIG. 10 extend, that is, the vertical direction is referred to as "column direction", and the direction in which the rows extend, that is, the horizontal direction is referred to as "row direction".

乗算部112は、図10に示すボトムデータ210の入力を受ける。さらに、乗算部112は、図10に示す重みデータ221を重みデータ記憶部115から取得する。そして、乗算部112は、最初にボトムデータ210の1列目に重みデータ221の一列目を一致させ、且つ、重みデータ221の各要素データがボトムデータ210のより若い番号の要素データに重なるように重みデータ221を配置する。例えば、図10の場合、乗算部112は、要素データw00が要素データb01に一致し、要素データw02が要素データnb09に一致し、要素データw05が要素データb17に一致するように重みデータ221を配置する。そして、乗算部112は、ボトムデータ210と重みデータ221との重なった各要素データ同士を乗算し、各乗算結果を加算部113へ出力する。以下では、ボトムデータ210上の所定の位置に重みデータ221を配置し、重なった各要素データを乗算する計算を「トップデータ209の1つの要素データに対する乗算」という。 The multiplication unit 112 receives the input of the bottom data 210 shown in FIG. Further, the multiplication unit 112 acquires the weight data 221 shown in FIG. 10 from the weight data storage unit 115. Then, the multiplication unit 112 first matches the first column of the weight data 221 with the first column of the bottom data 210, and makes each element data of the weight data 221 overlap with the element data of the lower number of the bottom data 210. The weight data 221 is arranged in. For example, in the case of FIG. 10, the multiplication unit 112 sets the weight data 221 so that the element data w00 matches the element data b01, the element data w02 matches the element data nb09, and the element data w05 matches the element data b17. Deploy. Then, the multiplication unit 112 multiplies each overlapping element data of the bottom data 210 and the weight data 221 and outputs each multiplication result to the addition unit 113. In the following, the calculation of arranging the weight data 221 at a predetermined position on the bottom data 210 and multiplying each overlapping element data is referred to as "multiplication of one element data of the top data 209".

次に、乗算部112は、ストライド数である1つの要素データ分だけ重みデータ221をボトムデータ210上で行方向に移動する。そして、乗算部112は、移動した位置でトップデータ209の1つの要素データに対する乗算を行い、各乗算結果を加算部113へ出力する。このように、乗算部112は、計算完了後にストライド数ずつ行方向に重みデータ221を移動させ、トップデータ209の1つの要素データに対する乗算を繰返す。そして、重みデータ221が行方向の最後尾まで移動すると、次の計算では、乗算部112は、重みデータ221を列方向にストライド数である1つの要素データ分だけ移動させ、さらに、行方向の先頭の位置に重みデータ221を戻す。そして、乗算部112は、行方向に重みデータ221を移動させてトップデータ209の1つの要素データに対する乗算を繰返す。乗算部112は、重みデータ221の最下行がボトムデータ210の最下行に一致し、且つ、重みデータ221がボトムデータ210の最後尾に移動するまで、トップデータ209の1つの要素データに対する乗算を繰返す。 Next, the multiplication unit 112 moves the weight data 221 in the row direction on the bottom data 210 by one element data which is the number of strides. Then, the multiplication unit 112 performs multiplication on one element data of the top data 209 at the moved position, and outputs each multiplication result to the addition unit 113. In this way, after the calculation is completed, the multiplication unit 112 moves the weight data 221 in the row direction by the number of strides, and repeats the multiplication on one element data of the top data 209. Then, when the weight data 221 moves to the end in the row direction, in the next calculation, the multiplication unit 112 moves the weight data 221 in the column direction by one element data which is the number of strides, and further, in the row direction. The weight data 221 is returned to the head position. Then, the multiplication unit 112 moves the weight data 221 in the row direction and repeats the multiplication on one element data of the top data 209. The multiplication unit 112 multiplies one element data of the top data 209 until the bottom line of the weight data 221 matches the bottom line of the bottom data 210 and the weight data 221 moves to the end of the bottom data 210. Repeat.

例えば、図10におけるボトムデータ210の太線枠で囲まれた位置に重みデータ221を配置して計算を行う場合を説明する。ここでは、各要素データの乗算を符号のみで表す。乗算部112は、1つのトップデータ209に対する乗算として、w00×nb09,w01×nb10,w02×b17,w03×b18,w04×b19,w05×nb25及びw06×nb26を行う。そして、乗算部112は、各乗算結果を加算部113へ出力する。 For example, a case where the weight data 221 is arranged at the position surrounded by the thick line frame of the bottom data 210 in FIG. 10 and the calculation is performed will be described. Here, the multiplication of each element data is represented only by a sign. The multiplication unit 112 performs w00 × nb09, w01 × nb10, w02 × b17, w03 × b18, w04 × b19, w05 × nb25 and w06 × nb26 as multiplications for one top data 209. Then, the multiplication unit 112 outputs each multiplication result to the addition unit 113.

加算部113は、乗算結果の入力を乗算部112から受ける。そして、加算部113は、1つのトップデータ209に対する乗算の乗算結果それぞれを加算して合計を算出する。以下では、1つのトップデータ209に対する乗算の乗算結果の加算を、「トップデータ209の1つの要素データに対する加算」という。そして、加算部113は、加算結果を出力データ作成部114へ出力する。加算部113は、乗算部112が行ったトップデータ209の1つの要素データに対する乗算の全てに対して、トップデータ209の1つの要素データに対する加算を繰り返し、加算結果を出力データ作成部114へ出力する。 The addition unit 113 receives the input of the multiplication result from the multiplication unit 112. Then, the addition unit 113 adds each of the multiplication results of multiplication to one top data 209 to calculate the total. Hereinafter, the addition of the multiplication result of multiplication to one top data 209 is referred to as "addition to one element data of top data 209". Then, the addition unit 113 outputs the addition result to the output data creation unit 114. The addition unit 113 repeats the addition to one element data of the top data 209 for all the multiplications performed by the multiplication unit 112 to one element data of the top data 209, and outputs the addition result to the output data creation unit 114. To do.

例えば、図10におけるボトムデータ210の太線枠で囲まれた位置に重みデータ221を配置された場合について説明する。加算部113は、w00×nb09,w01×nb10,w02×n17,w03×b18,w04×b19,w05×nb25及びw06×nb26の入力を乗算部112から受ける。そして、加算部113は、w00×nb09+w01×nb10+w02×b17+w03×b18+w04×b19+w05×nb25+w06×nb26を算出する。 For example, a case where the weight data 221 is arranged at the position surrounded by the thick line frame of the bottom data 210 in FIG. 10 will be described. The addition unit 113 receives inputs of w00 × nb09, w01 × nb10, w02 × n17, w03 × b18, w04 × b19, w05 × nb25, and w06 × nb26 from the multiplication unit 112. Then, the addition unit 113 calculates w00 × nb09 + w01 × nb10 + w02 × b17 + w03 × b18 + w04 × b19 + w05 × nb25 + w06 × nb26.

出力データ作成部114は、トップデータ209の1つの要素データに対する加算の加算結果の入力を加算部113から受ける。そして、出力データ作成部114は、トップデータ209の先頭から順に、取得した加算結果の割り当てを繰り返す。例えば、出力データ作成部114は、図10におけるボトムデータ210の太線枠で囲まれた位置に重みデータ221を配置された場合、取得した加算結果を要素データt18とする。すなわち、w00×nb09+w01×nb10+w02×n17+w03×n18+w04×n19+w05×nb25+w06×nb26が、トップデータ209の要素データt18にあたる。出力データ作成部114は、このように取得した加算結果のトップデータ209の各要素データへの割当を繰り返してトップデータ209を生成する。そして、出力データ作成部114は、生成したトップデータ209を活性化処理部102へ出力する。以下では、トップデータ209の1つの要素データに対する乗算及び加算、並びに、その加算結果のトップデータ209の要素データの割当をまとめて、「トップデータ209の1つの要素データに対する和積演算」という。乗算部112、加算部113及び出力データ作成部114が、「畳込演算部」の一例にあたる。 The output data creation unit 114 receives the input of the addition result of the addition for one element data of the top data 209 from the addition unit 113. Then, the output data creation unit 114 repeats the allocation of the acquired addition results in order from the beginning of the top data 209. For example, when the weight data 221 is arranged at the position surrounded by the thick line frame of the bottom data 210 in FIG. 10, the output data creation unit 114 uses the acquired addition result as the element data t18. That is, w00 × nb09 + w01 × nb10 + w02 × n17 + w03 × n18 + w04 × n19 + w05 × nb25 + w06 × nb26 corresponds to the element data t18 of the top data 209. The output data creation unit 114 repeatedly assigns the top data 209 of the addition result acquired in this way to each element data to generate the top data 209. Then, the output data creation unit 114 outputs the generated top data 209 to the activation processing unit 102. Hereinafter, the multiplication and addition of the top data 209 to one element data and the allocation of the element data of the top data 209 of the addition result are collectively referred to as "sum product operation for one element data of the top data 209". The multiplication unit 112, the addition unit 113, and the output data creation unit 114 correspond to an example of the “convolution calculation unit”.

ここで、従来のフィルタ定義302を用いた場合、畳込演算部101は、トップデータ209の1つの要素データに対する和積演算において、9回の乗算と9個の乗算結果の加算を行う。これに対して、新フィルタ定義301を用いた場合、畳込演算部101は、トップデータ209の1つの要素データに対する和積演算において、7回の乗算と7個の乗算結果の加算を行う。したがって、乗算数及び加算する値の数共に、新フィルタ定義301を用いた場合の方が、従来のフィルタ定義302を用いた場合に比べて小さくなる。すなわち、フォワード畳込演算の場合、新フィルタ定義301を用いた場合の方が、従来のフィルタ定義302を用いた場合に比べて、使用する記憶領域を小さくすることができ、計算効率も向上させることができる。 Here, when the conventional filter definition 302 is used, the convolution calculation unit 101 performs 9 multiplications and addition of 9 multiplication results in the sum product calculation for one element data of the top data 209. On the other hand, when the new filter definition 301 is used, the convolution calculation unit 101 performs 7 multiplications and addition of 7 multiplication results in the sum product calculation for one element data of the top data 209. Therefore, both the number of multiplications and the number of values to be added are smaller when the new filter definition 301 is used than when the conventional filter definition 302 is used. That is, in the case of the forward convolution operation, the storage area used can be smaller and the calculation efficiency can be improved when the new filter definition 301 is used as compared with the case where the conventional filter definition 302 is used. be able to.

図3に戻って説明を続ける。畳込演算部106は、活性化処理部105により逆正規化処理が施されたデータに対してバックワード畳込演算を行う。ここで、畳込演算部106によるバックワード畳込演算についてさらに詳細に説明する。まず、図11を参照して、バックワード畳込ボトム差分演算について説明する。図11は、新フィルタ定義を用いる場合のバックワード畳込ボトム差分演算を説明するための図である。 The explanation will be continued by returning to FIG. The convolution calculation unit 106 performs a backward convolution operation on the data that has been denormalized by the activation processing unit 105. Here, the backward convolution operation by the convolution operation unit 106 will be described in more detail. First, the backward convolution bottom difference calculation will be described with reference to FIG. FIG. 11 is a diagram for explaining the backward convolution bottom difference operation when the new filter definition is used.

ここでは、図10で用いた8×8のボトムデータ201を変換したボトムデータ210と重みデータ221とを用いてフォワード畳込演算を行った場合で説明する。この場合、畳込演算部106は、フォワード畳込演算により求められた図10のトップデータ209の配置形状と同じ配置形状、すなわち隔行で1つ要素分ずつずれたデータの配置形状の見た目を有するトップ差分データ203の入力を活性化処理部105から受ける。ここで、トップ差分データ203も、トップデータ209の配置形状と同じ配置形状を有する。また、バックワード畳込ボトム差分演算で算出されるボトム差分データ205は、ボトムデータ201と同じ配置形状を有する。トップ差分データ203は、要素データtd00〜td63を有する。また、ボトム差分データ205は、要素データbd00〜nbd63を有する。 Here, the case where the forward convolution operation is performed using the bottom data 210 obtained by converting the 8 × 8 bottom data 201 used in FIG. 10 and the weight data 221 will be described. In this case, the convolution calculation unit 106 has the same arrangement shape as the arrangement shape of the top data 209 of FIG. 10 obtained by the forward convolution operation, that is, the appearance of the arrangement shape of the data shifted by one element at intervals. The input of the top difference data 203 is received from the activation processing unit 105. Here, the top difference data 203 also has the same arrangement shape as the arrangement shape of the top data 209. Further, the bottom difference data 205 calculated by the backward convolution bottom difference calculation has the same arrangement shape as the bottom data 201. The top difference data 203 has element data td00 to td63. Further, the bottom difference data 205 has element data bd00 to nbd63.

畳込演算部106は、図11に示すトップ差分データ203の入力を受ける。そして、畳込演算部106は、最初にトップ差分データ203の1列目に重みデータ221の一列目を一致させ、且つ、重みデータ221の各要素データがトップ差分データ203のより若い番号の要素データに重なるように重みデータ221を配置する。例えば、図11の場合、畳込演算部106は、要素データw00が要素データtd01に一致し、要素データw02が要素データtd09に一致し、要素データw05が要素データtd17に一致するように重みデータ221を配置する。そして、畳込演算部106は、トップ差分データ203と重みデータ221との重なった各要素データ同士を乗算する。さらに、畳込演算部106は、乗算結果のそれぞれを加算し合計を算出する。そして、畳込演算部106は、算出した加算結果をボトム差分データ205の要素データbd00とする。 The convolution calculation unit 106 receives the input of the top difference data 203 shown in FIG. Then, the convolution calculation unit 106 first matches the first column of the weight data 221 with the first column of the top difference data 203, and each element data of the weight data 221 is an element having a lower number than the top difference data 203. The weight data 221 is arranged so as to overlap the data. For example, in the case of FIG. 11, the convolution calculation unit 106 uses weight data such that the element data w00 matches the element data td01, the element data w02 matches the element data td09, and the element data w05 matches the element data td17. Place 221. Then, the convolution calculation unit 106 multiplies each overlapping element data of the top difference data 203 and the weight data 221. Further, the convolution calculation unit 106 adds each of the multiplication results to calculate the total. Then, the convolution calculation unit 106 sets the calculated addition result as the element data bd00 of the bottom difference data 205.

次に、畳込演算部106は、ストライド数である1つの要素データ分だけ重みデータ221をトップ差分データ203上で行方向に移動する。そして、畳込演算部106は、移動した位置で1つのボトム差分データ205に対する乗算を行い、乗算結果を加算して合計を算出する。このように、畳込演算部106は、計算完了後にストライド数ずつ行方向に重みデータ221を移動させ、乗算及び加算を繰返す。そして、重みデータ221が行方向の最後尾まで移動すると、次の計算では、畳込演算部106は、重みデータ221を列方向にストライド数である1つの要素データ分だけ移動させ、さらに、行方向の先頭の位置に重みデータ221を戻す。そして、畳込演算部106は、行方向に重みデータ221を移動させつつ乗算及び加算を繰返す。畳込演算部106は、重みデータ221の最下行がトップ差分データ203の最下行に一致し、且つ、重みデータ221がトップ差分データ203の最後尾に移動するまで、乗算及び加算を繰返す。そして、畳込演算部106は、乗算及び加算結果をボトム差分データ205の要素データb01〜nb63の番号順に割り当てていく。以下では、トップ差分データ203上の所定の位置に重みデータ221を配置した状態での、乗算及び加算、並びに、ボトム差分データ205の要素データb00〜nb63に割り当てる演算を、まとめて「ボトム差分データ205の1つの要素データに対する和積演算」という。 Next, the convolution calculation unit 106 moves the weight data 221 in the row direction on the top difference data 203 by the amount of one element data which is the number of strides. Then, the convolution calculation unit 106 multiplies one bottom difference data 205 at the moved position, adds the multiplication results, and calculates the total. In this way, the convolution calculation unit 106 moves the weight data 221 in the row direction by the number of strides after the calculation is completed, and repeats multiplication and addition. Then, when the weight data 221 moves to the end in the row direction, in the next calculation, the convolution calculation unit 106 moves the weight data 221 in the column direction by one element data which is the number of strides, and further, the row The weight data 221 is returned to the position at the beginning of the direction. Then, the convolution calculation unit 106 repeats multiplication and addition while moving the weight data 221 in the row direction. The convolution calculation unit 106 repeats multiplication and addition until the bottom line of the weight data 221 matches the bottom line of the top difference data 203 and the weight data 221 moves to the end of the top difference data 203. Then, the convolution calculation unit 106 allocates the multiplication and addition results in the numerical order of the element data b01 to nb63 of the bottom difference data 205. In the following, multiplication and addition in a state where the weight data 221 is arranged at a predetermined position on the top difference data 203, and operations assigned to the element data b00 to nb63 of the bottom difference data 205 are collectively referred to as "bottom difference data". It is called "sum product operation for one element data of 205".

例えば、図11におけるトップ差分データ203の太線枠で囲まれた位置に重みデータ221を配置して計算を行う場合を説明する。ここでは、各要素データの乗算を符号のみで表す。畳込演算部106は、ボトム差分データ205の1つの要素データに対する和積演算として、w00×td09+w01×td10+w02×td17+w03×td18+w04×td19+w05×td25+w06×td26を要素データbd18とする。 For example, a case where the weight data 221 is arranged at the position surrounded by the thick line frame of the top difference data 203 in FIG. 11 and the calculation is performed will be described. Here, the multiplication of each element data is represented only by a sign. The convolution calculation unit 106 sets w00 × td09 + w01 × td10 + w02 × td17 + w03 × td18 + w04 × td19 + w05 × td25 + w06 × td26 as element data bd18 as a sum product operation for one element data of the bottom difference data 205.

ここで、従来のフィルタ定義302を用いた場合、畳込演算部101は、ボトム差分データ205の1つの要素データに対する和積演算において、9回の乗算と9個の乗算結果の加算を行う。これに対して、新フィルタ定義301を用いた場合、畳込演算部101は、ボトム差分データ205の1つの要素データに対する和積演算において、7回の乗算と7個の乗算結果の加算を行う。したがって、乗算数及び加算する値の数共に、新フィルタ定義301を用いた場合の方が、従来のフィルタ定義302を用いた場合に比べて小さくなる。すなわち、バックワード畳込ボトム差分演算の場合も、新フィルタ定義301を用いた場合の方が、従来のフィルタ定義302を用いた場合に比べて、使用する記憶領域を小さくすることができ、計算効率も向上させることができる。 Here, when the conventional filter definition 302 is used, the convolution calculation unit 101 performs 9 multiplications and addition of 9 multiplication results in the sum product calculation for one element data of the bottom difference data 205. On the other hand, when the new filter definition 301 is used, the convolution calculation unit 101 performs 7 multiplications and addition of 7 multiplication results in the sum product calculation for one element data of the bottom difference data 205. .. Therefore, both the number of multiplications and the number of values to be added are smaller when the new filter definition 301 is used than when the conventional filter definition 302 is used. That is, even in the case of the backward convolution bottom difference calculation, the storage area used can be smaller when the new filter definition 301 is used than when the conventional filter definition 302 is used, and the calculation can be performed. Efficiency can also be improved.

次に、図12を参照して、バックワード畳込重み差分演算を説明する。図12は、新フィルタ定義を用いる場合のバックワード畳込重み差分演算を説明するための図である。フォワード畳込重差分演算で算出される重み差分データ204は、重みデータ221の配置形状と同じ配置形状を有する。重み差分データ204は、要素データwd00〜wd07を有する。 Next, the backward convolution weight difference calculation will be described with reference to FIG. FIG. 12 is a diagram for explaining the backward convolution weight difference calculation when the new filter definition is used. The weight difference data 204 calculated by the forward convolution weight difference calculation has the same arrangement shape as the arrangement shape of the weight data 221. The weight difference data 204 has element data wd00 to wd07.

畳込演算部106は、フォワード畳込演算で使用したボトムデータ210を取得する。また、畳込演算部106は、図12に示すトップ差分データ203の入力を受ける。次に、畳込演算部106は、ボトムデータ210が重み差分データ204を算出するサイズを有するか否かを判定する。サイズが小さい場合、畳込演算部106は、ボトムデータ210の周りに値が0の要素データ212を付加する。以下では、要素データ212を付加したボトムデータ210を単にボトムデータ210という。 The convolution calculation unit 106 acquires the bottom data 210 used in the forward convolution calculation. Further, the convolution calculation unit 106 receives the input of the top difference data 203 shown in FIG. Next, the convolution calculation unit 106 determines whether or not the bottom data 210 has a size for calculating the weight difference data 204. When the size is small, the convolution calculation unit 106 adds element data 212 having a value of 0 around the bottom data 210. In the following, the bottom data 210 to which the element data 212 is added is simply referred to as the bottom data 210.

次に、畳込演算部106は、最初にボトムデータ210の1列目にトップ差分データ203の一列目を一致させ、且つ、トップ差分データ203の各要素データがボトムデータ210のより若い番号の要素データに重なるようにトップ差分データ203を配置する。例えば、畳込演算部106は、ボトムデータ210の太線枠に一致するようにトップ差分データ203を配置する。そして、畳込演算部106は、ボトムデータ210とトップ差分データ203との重なった各要素データ同士を乗算する。さらに、畳込演算部106は、乗算結果のそれぞれを加算し合計を算出する。そして、畳込演算部106は、算出した加算結果を重み差分データ204の要素データw00とする。 Next, the convolution calculation unit 106 first matches the first column of the top difference data 203 with the first column of the bottom data 210, and each element data of the top difference data 203 has a lower number of the bottom data 210. The top difference data 203 is arranged so as to overlap the element data. For example, the convolution calculation unit 106 arranges the top difference data 203 so as to match the thick line frame of the bottom data 210. Then, the convolution calculation unit 106 multiplies each overlapping element data of the bottom data 210 and the top difference data 203. Further, the convolution calculation unit 106 adds each of the multiplication results to calculate the total. Then, the convolution calculation unit 106 sets the calculated addition result as the element data w00 of the weight difference data 204.

次に、畳込演算部106は、ストライド数である1つの要素データ分だけトップ差分データ203をボトムデータ210上で行方向に移動する。そして、畳込演算部106は、移動した位置で要素データ同士の乗算を行い、乗算結果を加算して合計を算出する。このように、畳込演算部106は、計算完了後にストライド数ずつ行方向にトップ差分データ203を移動させ、乗算及び加算を繰返す。そして、トップ差分データ203が行方向の最後尾まで移動すると、次の計算では、畳込演算部106は、トップ差分データ203を列方向にストライド数である1つの要素データ分だけ移動させ、さらに、行方向の先頭の位置にトップ差分データ203を戻す。そして、畳込演算部106は、行方向にトップ差分データ203を移動させつつ乗算及び加算を繰返す。畳込演算部106は、トップ差分データ203の最下行がボトムデータ210の最下行に一致し、且つ、トップ差分データ203がボトムデータ210の最後尾に移動するまで、乗算及び加算を繰返す。そして、畳込演算部106は、乗算及び加算結果を重み差分データ204の要素データw01〜w07の番号順に割り当てていく。以下では、ボトムデータ210上の所定の位置にトップ差分データ203を配置した状態での、乗算及び加算、並びに、重み差分データ204の要素データw00〜w07に割り当てる演算を、まとめて「重み差分データ204の1つの要素データに対する和積演算」という。 Next, the convolution calculation unit 106 moves the top difference data 203 in the row direction on the bottom data 210 by one element data which is the number of strides. Then, the convolution calculation unit 106 multiplies the element data at the moved position, adds the multiplication results, and calculates the total. In this way, the convolution calculation unit 106 moves the top difference data 203 in the row direction by the number of strides after the calculation is completed, and repeats multiplication and addition. Then, when the top difference data 203 moves to the end in the row direction, in the next calculation, the convolution calculation unit 106 moves the top difference data 203 in the column direction by one element data which is the number of strides, and further. , The top difference data 203 is returned to the first position in the row direction. Then, the convolution calculation unit 106 repeats multiplication and addition while moving the top difference data 203 in the row direction. The convolution calculation unit 106 repeats multiplication and addition until the bottom line of the top difference data 203 matches the bottom line of the bottom data 210 and the top difference data 203 moves to the end of the bottom data 210. Then, the convolution calculation unit 106 allocates the multiplication and addition results in the numerical order of the element data w01 to w07 of the weight difference data 204. In the following, multiplication and addition, and operations assigned to the element data w00 to w07 of the weight difference data 204 in a state where the top difference data 203 is arranged at a predetermined position on the bottom data 210 are collectively referred to as "weight difference data". It is called "sum product operation for one element data of 204".

例えば、図12におけるボトムデータ210の太線枠で囲まれた位置にトップ差分データ203を配置して計算を行う場合を説明する。ここでは、各要素データの乗算を符号のみで表す。畳込演算部106は、重み差分データ204の1つの要素データに対する和積演算として、以下の計算を行う。畳込演算部106は、td00×0+・・・+td07×0+td08×b00+・・・+td15×b07+td16×0+td17×nb08+・・・+td23×nb14+・・・+td56×b48+・・・td63×b55を算出する。そして、畳込演算部106は、演算結果を要素データwd00とする。 For example, a case where the top difference data 203 is arranged at the position surrounded by the thick line frame of the bottom data 210 in FIG. 12 and the calculation is performed will be described. Here, the multiplication of each element data is represented only by a sign. The convolution calculation unit 106 performs the following calculation as a sum product calculation for one element data of the weight difference data 204. The convolution calculation unit 106 calculates td00 × 0 + ... + td07 × 0 + td08 × b00 + ... + td15 × b07 + td16 × 0 + td17 × nb08 + ・ ・ ・ + td23 × nb14 + ・ ・ ・ + td56 × b48 + ... Then, the convolution calculation unit 106 sets the calculation result as the element data wd00.

ここで、従来のフィルタ定義302を用いた場合、畳込演算部101は、重み差分データ204の1つの要素データに対する和積演算を9回行う。これに対して、新フィルタ定義301を用いた場合、畳込演算部101は、重み差分データ204の1つの要素データに対する和積演算は7回で済む。したがって、新フィルタ定義301を用いた場合の方が、従来のフィルタ定義302を用いた場合に比べて計算回数を減らすことができる。すなわち、バックワード畳込重み差分演算の場合も、新フィルタ定義301を用いた場合の方が、従来のフィルタ定義302を用いた場合に比べて、使用する記憶領域を小さくすることができ、計算効率も向上させることができる。 Here, when the conventional filter definition 302 is used, the convolution calculation unit 101 performs the sum product calculation on one element data of the weight difference data 204 nine times. On the other hand, when the new filter definition 301 is used, the convolution calculation unit 101 only needs to perform the sum product operation for one element data of the weight difference data 204 seven times. Therefore, the number of calculations can be reduced when the new filter definition 301 is used as compared with the case where the conventional filter definition 302 is used. That is, even in the case of the backward convolution weight difference calculation, the storage area used can be made smaller when the new filter definition 301 is used than when the conventional filter definition 302 is used, and the calculation can be performed. Efficiency can also be improved.

図3に戻って説明を続ける。活性化処理部102は、畳込演算部101から出力されたトップデータを正規化する。プーリング処理部103は、活性化処理部102により正規化されたトップデータに対して要素データの間引や統合を行うことで、微小な位置変化に対して応答を不変化する。このプーリング処理部103が行う処理をプーリング処理という。そして、プーリング処理部103は、プーリング処理を施したトップデータを次の段の演算処理層10へ出力する。プーリング処理部103は、データに加えた処理を表すタグ151をプーリング処理部104へ出力する。 The explanation will be continued by returning to FIG. The activation processing unit 102 normalizes the top data output from the convolution calculation unit 101. The pooling processing unit 103 does not change the response to a minute position change by thinning out or integrating the element data with respect to the top data normalized by the activation processing unit 102. The process performed by the pooling process unit 103 is called a pooling process. Then, the pooling processing unit 103 outputs the top data subjected to the pooling processing to the arithmetic processing layer 10 of the next stage. The pooling processing unit 103 outputs a tag 151 representing the processing added to the data to the pooling processing unit 104.

プーリング処理部104は、実施した応答のプーリング処理を表すタグ151の入力をプーリング処理部103から受ける。また、プーリング処理部104は、後段の演算処理層10からボトム差分データの入力を受ける。そして、プーリング処理部104は、取得したボトム差分データにタグ151により特定されるプーリング処理の逆処理を施す。このプーリング処理部104が行う処理を逆プーリング処理という。活性化処理部105は、プーリング処理部104により逆プーリング処理が施されたデータに対して活性化処理を施す。 The pooling processing unit 104 receives an input of a tag 151 representing the pooling processing of the executed response from the pooling processing unit 103. Further, the pooling processing unit 104 receives input of bottom difference data from the arithmetic processing layer 10 in the subsequent stage. Then, the pooling processing unit 104 performs the reverse processing of the pooling processing specified by the tag 151 on the acquired bottom difference data. The process performed by the pooling process unit 104 is called a reverse pooling process. The activation processing unit 105 performs activation processing on the data that has been reverse pooled by the pooling processing unit 104.

さらに、以上では、演算処理装置1の学習時の動作について説明したが、演算処理装置1は、学習により取得した重みデータ202を用いて入力データ2の認識を行う。そこで、各演算処理層10における認識の処理について説明する。 Further, although the operation of the arithmetic processing unit 1 at the time of learning has been described above, the arithmetic processing unit 1 recognizes the input data 2 by using the weight data 202 acquired by the learning. Therefore, the recognition process in each arithmetic processing layer 10 will be described.

畳込演算部101は、ボトムデータの入力を受ける。そして、学習で取得した重みデータを使用してフォワード畳込演算を行う。そして、活性化処理部102及びプーリング処理部103は、トップデータに対して正規化などのプーリング処理を行う。その後、プーリング処理部103は、処理を施したトップデータを次の演算処理層10へ出力する。このようなフォワード畳込演算を各演算処理層10で繰返して、演算処理装置1は、最終的に認識用の出力データ3を取得する。 The convolution calculation unit 101 receives the input of bottom data. Then, the forward convolution operation is performed using the weight data acquired in the learning. Then, the activation processing unit 102 and the pooling processing unit 103 perform pooling processing such as normalization on the top data. After that, the pooling processing unit 103 outputs the processed top data to the next arithmetic processing layer 10. By repeating such a forward convolution operation in each arithmetic processing layer 10, the arithmetic processing unit 1 finally acquires the output data 3 for recognition.

次に、図13を参照して、新フィルタ定義301を使用する場合の演算処理層における処理の流れについて説明する。図13は、新フィルタ定義を使用する場合の演算処理層における処理のフローチャートである。 Next, with reference to FIG. 13, the processing flow in the arithmetic processing layer when the new filter definition 301 is used will be described. FIG. 13 is a flowchart of processing in the arithmetic processing layer when the new filter definition is used.

第1層の演算処理層11における入力データ処理部111は、入力データ2に対して隔行の隣り合う要素データの平均を算出して一方の要素データとして、新フィルタ定義301に合うボトムデータ210を生成する(ステップS1)。そして、入力データ処理部111は、ボトムデータ210を乗算部112へ出力する。 The input data processing unit 111 in the arithmetic processing layer 11 of the first layer calculates the average of adjacent element data in intervals with respect to the input data 2, and uses the bottom data 210 that matches the new filter definition 301 as one element data. Generate (step S1). Then, the input data processing unit 111 outputs the bottom data 210 to the multiplication unit 112.

乗算部112は、ボトムデータ210の入力を入力データ処理部111から受ける。そして、乗算部112、加算部113及び出力データ作成部114は、トップデータ209の1つの要素データに対する和積演算を繰返してフォワード畳込演算を行う(ステップS2)。そして、出力データ作成部114は、演算結果であるトップデータ209を出力する。 The multiplication unit 112 receives the input of the bottom data 210 from the input data processing unit 111. Then, the multiplication unit 112, the addition unit 113, and the output data creation unit 114 repeat the sum product operation on one element data of the top data 209 to perform the forward convolution operation (step S2). Then, the output data creation unit 114 outputs the top data 209 which is the calculation result.

活性化処理部102及びプーリング処理部103は、出力データ作成部114から出力されたトップデータ209に対して正規化を施すプーリング処理といったフォワード他処理演算を行う(ステップS3)。そして、プーリング処理部103は、処理を施したデータを第2層の演算処理層12へ出力する。 The activation processing unit 102 and the pooling processing unit 103 perform forward and other processing operations such as a pooling process for normalizing the top data 209 output from the output data creation unit 114 (step S3). Then, the pooling processing unit 103 outputs the processed data to the arithmetic processing layer 12 of the second layer.

第2〜第n−1層の演算処理層10及び第n層の演算処理層13は、フォワード畳込演算及びフォワード他処理演算を含む同様の処理を実行する(ステップS4)。 The arithmetic processing layer 10 of the second to second n-1 layers and the arithmetic processing layer 13 of the nth layer execute the same processing including the forward convolution operation and the forward other processing operation (step S4).

次に、第n層の演算処理層13は、出力データ3と期待値207とを比較する(ステップS5)。 Next, the arithmetic processing layer 13 of the nth layer compares the output data 3 with the expected value 207 (step S5).

次に、第n層の演算処理層13のプーリング処理部104及び活性化処理部105は、比較結果に対して、逆プーリング処理を含むバックワード他処理演算を行う(ステップS6)。そして、活性化処理部105は、処理を施したデータをトップ差分データ203として畳込演算部106へ出力する。 Next, the pooling processing unit 104 and the activation processing unit 105 of the arithmetic processing layer 13 of the nth layer perform backward other processing operations including the reverse pooling processing on the comparison result (step S6). Then, the activation processing unit 105 outputs the processed data as the top difference data 203 to the convolution calculation unit 106.

次に、第n層の演算処理層13の畳込演算部106は、トップ差分データ203の入力を活性化処理部105から受ける。そして、畳込演算部106は、トップ差分データ203、重みデータ202及びボトムデータ210を用いてバックワード畳込演算を行う(ステップS7)。畳込演算部106は、重みデータ202を更新する。さらに、畳込演算部106は、求めたボトム差分データ205を第n−1層の演算処理層10へ出力する。 Next, the convolution calculation unit 106 of the calculation processing layer 13 of the nth layer receives the input of the top difference data 203 from the activation processing unit 105. Then, the convolution calculation unit 106 performs a backward convolution calculation using the top difference data 203, the weight data 202, and the bottom data 210 (step S7). The convolution calculation unit 106 updates the weight data 202. Further, the convolution calculation unit 106 outputs the obtained bottom difference data 205 to the calculation processing layer 10 of the n-1th layer.

第n−1〜3層の演算処理層10、第2層の演算処理層12及び第1層の演算処理層11は、バックワード他処理演算及びバックワード畳込演算を含む同様の処理を実行する(ステップS8)。これにより、第n−1〜3層の演算処理層10、第2層の演算処理層12及び第1層の演算処理層11の重みデータ202が更新される。 The arithmetic processing layer 10 of the first to third layers, the arithmetic processing layer 12 of the second layer, and the arithmetic processing layer 11 of the first layer execute the same processing including the backward other processing arithmetic and the backward convolution operation. (Step S8). As a result, the weight data 202 of the arithmetic processing layer 10 of the first to third layers, the arithmetic processing layer 12 of the second layer, and the arithmetic processing layer 11 of the first layer is updated.

次に、図14を参照して、畳込演算部101によるフォワード畳込演算の流れについて説明する。図14は、実施例1に係る畳込演算部によるフォワード畳込演算のフローチャートである。 Next, with reference to FIG. 14, the flow of the forward convolution calculation by the convolution calculation unit 101 will be described. FIG. 14 is a flowchart of the forward convolution calculation by the convolution calculation unit according to the first embodiment.

入力データ処理部111は、新フィルタ定義301を使用するか否かを判定する(ステップS101)。新フィルタ定義301を使用しない場合(ステップS101:否定)、入力データ処理部111は、入力データをそのままボトムデータ201として乗算部112へ出力する。乗算部112、加算部113及び出力データ作成部114は、通常のフォワード畳込演算を実行し(ステップS102)、フォワード畳込演算を終了する。 The input data processing unit 111 determines whether or not to use the new filter definition 301 (step S101). When the new filter definition 301 is not used (step S101: negation), the input data processing unit 111 outputs the input data as it is to the multiplication unit 112 as bottom data 201. The multiplication unit 112, the addition unit 113, and the output data creation unit 114 execute a normal forward convolution operation (step S102), and end the forward convolution operation.

これに対して、新フィルタ定義301を使用する場合(ステップS101:肯定)、入力データ処理部111は、新フィルタ定義301に対応する重みデータ221を重みデータ記憶部115から取得する(ステップS103)。 On the other hand, when the new filter definition 301 is used (step S101: affirmative), the input data processing unit 111 acquires the weight data 221 corresponding to the new filter definition 301 from the weight data storage unit 115 (step S103). ..

次に、入力データ処理部111は、入力データが新フィルタ定義301に対応するか否かを判定する(ステップS104)。入力データが新フィルタ定義301に対応しない場合(ステップS104:否定)、入力データ処理部111は、前層における処理結果の入力データを隔行で平均化したデータを演算に使用するボトムデータ201とする(ステップS105)。 Next, the input data processing unit 111 determines whether or not the input data corresponds to the new filter definition 301 (step S104). When the input data does not correspond to the new filter definition 301 (step S104: negation), the input data processing unit 111 uses the data obtained by averaging the input data of the processing results in the previous layer at intervals as the bottom data 201 used for the calculation. (Step S105).

入力データが新フィルタ定義301に対応する場合(ステップS104:肯定)、入力データ処理部111は、前層における処理結果の入力データをそのまま演算に使用するボトムデータ201とする(ステップS106)。 When the input data corresponds to the new filter definition 301 (step S104: affirmative), the input data processing unit 111 uses the input data of the processing result in the previous layer as the bottom data 201 (step S106).

入力データ処理部111は、新フィルタ定義301に対応するボトムデータ201を乗算部112へ出力する。乗算部112、加算部113及び出力データ作成部114は、入力されたボトムデータ201と新フィルタ定義301に対応した重みデータ221とを用いてフォワード畳込演算を実行する(ステップS107)。 The input data processing unit 111 outputs the bottom data 201 corresponding to the new filter definition 301 to the multiplication unit 112. The multiplication unit 112, the addition unit 113, and the output data creation unit 114 execute a forward convolution operation using the input bottom data 201 and the weight data 221 corresponding to the new filter definition 301 (step S107).

次に、図15を参照して、畳込演算部106によるバックワード畳込演算の流れについて説明する。図15は、実施例1に係る畳込演算部によるバックワード畳込演算のフローチャートである。 Next, with reference to FIG. 15, the flow of the backward convolution operation by the convolution operation unit 106 will be described. FIG. 15 is a flowchart of a backward convolution calculation by the convolution calculation unit according to the first embodiment.

畳込演算部106は、新フィルタ定義301を使用するか否かを判定する(ステップS201)。新フィルタ定義301を使用しない場合(ステップS201:否定)、畳込演算部106は、入力データをそのままボトムデータ201として、通常のバックワード畳込演算を実行し(ステップS202)、フォワード畳込演算を終了する。 The convolution calculation unit 106 determines whether or not to use the new filter definition 301 (step S201). When the new filter definition 301 is not used (step S201: negation), the convolution calculation unit 106 executes a normal backward convolution operation (step S202) using the input data as the bottom data 201 as it is, and performs a forward convolution operation. To finish.

これに対して、新フィルタ定義301を使用する場合(ステップS201:肯定)、畳込演算部106は、逆伝播方向の最初の層か否かを判定する(ステップS203)。逆伝播方向の最初の層の場合(ステップS203:肯定)、畳込演算部106は、フォワード演算による出力データ3と期待値207との差分に対してバックワード他処理が施されたデータをトップ差分データ203として取得する(ステップS204)。 On the other hand, when the new filter definition 301 is used (step S201: affirmative), the convolution calculation unit 106 determines whether or not it is the first layer in the back propagation direction (step S203). In the case of the first layer in the back propagation direction (step S203: affirmative), the convolution calculation unit 106 tops the data to which backward processing or the like is applied to the difference between the output data 3 by the forward calculation and the expected value 207. Acquired as difference data 203 (step S204).

これに対して、逆伝播方向の最初の層以外の層の場合(ステップS203:否定)、畳込演算部106は、前層から出力されたボトム差分データ205に対してバックワード他処理が施されたデータをトップ差分データ203として取得する(ステップS205)。 On the other hand, in the case of a layer other than the first layer in the back propagation direction (step S203: negation), the convolution calculation unit 106 performs backward and other processing on the bottom difference data 205 output from the previous layer. The obtained data is acquired as the top difference data 203 (step S205).

そして、畳込演算部106は、ボトムデータ201、新フィルタ定義301を使用した重みデータ221及びトップ差分データ203を用いてバックワード重み差分演算及びバックワードボトム差分演算を実行する(ステップS206)。 Then, the convolution calculation unit 106 executes the backward weight difference calculation and the backward bottom difference calculation using the bottom data 201, the weight data 221 using the new filter definition 301, and the top difference data 203 (step S206).

以上に説明したように、本実施例に係る演算処理装置は、従来の正方形の行列のフィルタ定義よりも要素データの数が少ない新フィルタ定義を用いてフォワード畳込演算及びバックワード畳込演算を行う。次の表はフィルタサイズに応じた従来のフィルタ定義と新フィルタ定義との演算量の比を表す表である。ここで、新フィルタ定義は、中央の行から端の行に向かって1つずつ要素データを減らし、且つ、各行の半分の位置が要素データを減らす前の半分の位置に一致するようにずらすことで生成される定義である。 As described above, the arithmetic processing apparatus according to the present embodiment performs forward convolution operations and backward convolution operations using a new filter definition in which the number of element data is smaller than that of the conventional filter definition of a square matrix. Do. The following table shows the ratio of the amount of calculation between the conventional filter definition and the new filter definition according to the filter size. Here, the new filter definition is to reduce the element data one by one from the center row to the edge row, and shift the half position of each row so that it matches the half position before reducing the element data. Is the definition generated by.

Figure 0006794854
Figure 0006794854

このように、本実施例に係る演算処理装置は、フォワード畳込演算及びバックワード畳込演算における演算量を削減することができる。ここで、本実施例に係る演算処理装置は、入力データを変換する演算を行うが、入力データを変換する演算数は、畳込演算において削減される演算数より少ないため、演算量を低減することができる。また、本実施例に係る演算処理装置は、データ量削減によってメモリスループットの削減にも寄与することができる。高速フーリエ変換による高速化手法を用いるための条件を満たさないフィルタを用いる場合でも、本実施例に係る演算処理装置は、フォワード畳込演算及びバックワード畳込演算における演算量を削減することができる。したがって、本実施例に係る演算処理装置は、深層学習の演算において、使用する記憶装置の容量を抑えつつ演算効率を向上させることができる。 As described above, the arithmetic processing unit according to the present embodiment can reduce the amount of arithmetic operations in the forward convolution operation and the backward convolution operation. Here, the arithmetic processing apparatus according to the present embodiment performs an operation for converting the input data, but the number of operations for converting the input data is smaller than the number of operations reduced in the convolution operation, so that the amount of calculation is reduced. be able to. In addition, the arithmetic processing unit according to this embodiment can also contribute to the reduction of memory throughput by reducing the amount of data. Even when a filter that does not satisfy the conditions for using the high-speed method by the fast Fourier transform is used, the arithmetic processing unit according to the present embodiment can reduce the amount of arithmetic operations in the forward convolution operation and the backward convolution operation. .. Therefore, the arithmetic processing unit according to the present embodiment can improve the arithmetic efficiency while suppressing the capacity of the storage device used in the arithmetic of deep learning.

特に、3×3のサイズのフィルタは、深層学習では多用されるフィルタであり、その3×3のサイズのフィルタにおいても実施例で説明したように演算数が削減される。 In particular, a filter having a size of 3 × 3 is a filter often used in deep learning, and a filter having a size of 3 × 3 also reduces the number of operations as described in the embodiment.

また、本実施例に係る演算処理装置では、重みデータを小さくすることができ、フォワード畳込演算及びバックワード畳込演算におけるデータ量を少なく抑えることができる。 Further, in the arithmetic processing unit according to the present embodiment, the weight data can be reduced, and the amount of data in the forward convolution operation and the backward convolution operation can be suppressed to be small.

次に、実施例2について説明する。本実施例に係る演算処理装置は、新フィルタ定義に合わせてボトムデータを変換した場合に、そのボトムデータを用いて算出されたデータをそのまま使用してプーリング処理を行う。本実例に係る演算処理装置も、図1及び2で表される。以下では、実施例1と同様の各部の機能については説明を省略する。 Next, Example 2 will be described. When the bottom data is converted according to the new filter definition, the arithmetic processing unit according to the present embodiment performs the pooling process by using the data calculated using the bottom data as it is. The arithmetic processing unit according to this example is also shown in FIGS. 1 and 2. In the following, description of the functions of the same parts as in the first embodiment will be omitted.

図16は、実施例2に係るプーリング処理部によるストライド数が2の場合のプーリング処理を説明するための図である。 FIG. 16 is a diagram for explaining a pooling process when the number of strides by the pooling process unit according to the second embodiment is 2.

プーリング処理部103は、畳込演算部101が出力したトップデータ209に対して活性化処理部102により正規化されたデータの入力を受ける。ここでは、8×8のボトムデータ201及び新フィルタ定義301を用いてフォワード畳込演算が行われた場合で説明する。すなわち、プーリング処理部103は、図16に示すデータ401の入力を受ける。ここでは、データ401は、要素データi00〜i63を有する。要素データi00〜i63は、それぞれトップデータ209の要素データt00〜t63に対応する。 The pooling processing unit 103 receives the input of the data normalized by the activation processing unit 102 to the top data 209 output by the convolution calculation unit 101. Here, the case where the forward convolution operation is performed using the 8 × 8 bottom data 201 and the new filter definition 301 will be described. That is, the pooling processing unit 103 receives the input of the data 401 shown in FIG. Here, the data 401 has element data i00 to i63. The element data i00 to i63 correspond to the element data t00 to t63 of the top data 209, respectively.

プーリング処理部103は、図16のデータ401上に示した太線枠411をプーリングサイズとして記憶する。そして、プーリング処理部103は、最初に、太線枠411の上の行がデータ401の1行目の最も若番の要素データに一致するように配置する。そして、太線枠411に含まれる要素データi00,i01,i08及びi09を取得し、取得した要素データの平均や最大値の選択などのプーリング処理を行い値を取得する。そして、プーリング処理部103は、取得した値を出力するデータ402の要素データp00とする。 The pooling processing unit 103 stores the thick line frame 411 shown on the data 401 in FIG. 16 as the pooling size. Then, the pooling processing unit 103 is first arranged so that the line above the thick line frame 411 matches the youngest element data in the first line of the data 401. Then, the element data i00, i01, i08 and i09 included in the thick line frame 411 are acquired, and the pooling process such as selection of the average or maximum value of the acquired element data is performed to acquire the value. Then, the pooling processing unit 103 sets the element data p00 of the data 402 that outputs the acquired value.

次に、プーリング処理部103は、太線枠411を要素データ2つ分だけ行方向に進めながら、プーリング処理を行い値を取得していく。そして、太線枠411がデータ410の行の最後尾に達すると、プーリング処理部103は、要素データ2つ分だけ列方向に太線枠411を移動し、且つ、行の先頭に太線枠411を戻す。その後、プーリング処理部103は、太線枠411を要素データ2つ分だけ行方向に進めながら、同様のプーリング処理を繰返して値を取得する処理を、太線枠411の下の行がデータ401の一番下の行の最後尾に達するまで繰返す。そして、プーリング処理部103は、取得した値をそれぞれ出力するデータ402の要素データp01〜p15としていく。 Next, the pooling processing unit 103 performs pooling processing and acquires a value while advancing the thick line frame 411 in the row direction by two element data. Then, when the thick line frame 411 reaches the end of the row of the data 410, the pooling processing unit 103 moves the thick line frame 411 in the column direction by two element data and returns the thick line frame 411 to the beginning of the row. .. After that, the pooling processing unit 103 repeats the same pooling process while advancing the thick line frame 411 in the row direction by two element data, and the line below the thick line frame 411 is one of the data 401. Repeat until the end of the bottom line is reached. Then, the pooling processing unit 103 sets the acquired values as the element data p01 to p15 of the data 402 for outputting each.

例えば、太線枠411が図16で示すデータ401上の位置に配置された場合、プーリング処理部103は、要素データi18,i19,i26及びi27を取得する。そして、プーリング処理部103は、要素データi18,i19,i26及びi27を用いてプーリング処理を行い値を取得する。その後、プーリング処理部103は、取得した値をデータ402の要素データp05とする。 For example, when the thick line frame 411 is arranged at the position on the data 401 shown in FIG. 16, the pooling processing unit 103 acquires the element data i18, i19, i26 and i27. Then, the pooling processing unit 103 performs pooling processing using the element data i18, i19, i26 and i27, and acquires a value. After that, the pooling processing unit 103 sets the acquired value as the element data p05 of the data 402.

プーリング処理部103は、要素データp00〜p15を取得してデータ402を完成させる。その後、プーリング処理部103は、データ402を次の演算処理層10へ出力する。 The pooling processing unit 103 acquires the element data p00 to p15 and completes the data 402. After that, the pooling processing unit 103 outputs the data 402 to the next arithmetic processing layer 10.

図17は、実施例2に係るプーリング処理部によるストライド数が1の場合のプーリング処理を説明するための図である。ストライド数が1の場合、プーリングの対象が1行ずつ下がるため、データ401のような配置形状の場合、2つの異なるプーリングサイズを用いる。 FIG. 17 is a diagram for explaining a pooling process when the number of strides by the pooling process unit according to the second embodiment is 1. When the number of strides is 1, the target of pooling is lowered line by line. Therefore, in the case of an arrangement shape such as data 401, two different pooling sizes are used.

プーリング処理部103は、図17のデータ401上に示した太線枠412及び413をプーリングサイズとして記憶する。そして、プーリング処理部103は、データ402の奇数行の要素データを算出する場合、太線枠413のプーリングサイズを用いる。また、データ402の奇数行の要素データを算出する場合、太線枠412のプーリングサイズを用いる。 The pooling processing unit 103 stores the thick line frames 412 and 413 shown on the data 401 in FIG. 17 as the pooling size. Then, the pooling processing unit 103 uses the pooling size of the thick line frame 413 when calculating the element data of the odd-numbered rows of the data 402. Further, when calculating the element data of the odd-numbered rows of the data 402, the pooling size of the thick line frame 412 is used.

具体定には、プーリング処理部103は、最初に、太線枠413の上の行がデータ401の1行目の最も若番の要素データに一致するように配置する。そして、太線枠413に含まれる要素データi00,i01,i08及びi09を取得し、取得した要素データの平均や最大値の選択などによるプーリング処理を行い値を取得する。そして、プーリング処理部103は、取得した値を出力するデータ402の要素データp00とする。その後、プーリング処理部103は、太線枠413がデータ401の行の最後尾に達するまで、太線枠413を要素データ分ずつ行方向に進めながら、プーリング処理による値の取得を行う。そして、プーリング処理部103は、取得した値をそれぞれ出力するデータ402の要素データp01〜p06とする。 Specifically, the pooling processing unit 103 is first arranged so that the line above the thick line frame 413 matches the youngest element data in the first line of the data 401. Then, the element data i00, i01, i08 and i09 included in the thick line frame 413 are acquired, and the pooling process is performed by selecting the average or maximum value of the acquired element data to acquire the value. Then, the pooling processing unit 103 sets the element data p00 of the data 402 that outputs the acquired value. After that, the pooling processing unit 103 acquires the value by the pooling process while advancing the thick line frame 413 in the row direction by the element data until the thick line frame 413 reaches the end of the line of the data 401. Then, the pooling processing unit 103 sets the element data p01 to p06 of the data 402 to output the acquired values, respectively.

次に、プーリング処理部103は、太線枠412の上の行がデータ401の2行目の最も若番の要素データに一致するように配置する。そして、太線枠411に含まれる要素データi08,i09,i16及びi17を取得し、取得した要素データの平均や最大値の選択などによるプーリング処理を行い値を取得する。そして、プーリング処理部103は、取得した値を出力するデータ402の要素データp07とする。その後、プーリング処理部103は、太線枠412がデータ401の行の最後尾に達するまで、太線枠412を要素データ分ずつ行方向に進めながら、プーリング処理による値の取得を行う。そして、プーリング処理部103は、取得した値をそれぞれ出力するデータ402の要素データp08〜p13とする。 Next, the pooling processing unit 103 is arranged so that the line above the thick line frame 412 matches the element data of the youngest number in the second line of the data 401. Then, the element data i08, i09, i16 and i17 included in the thick line frame 411 are acquired, and the pooling process is performed by selecting the average or maximum value of the acquired element data to acquire the value. Then, the pooling processing unit 103 sets the element data p07 of the data 402 that outputs the acquired value. After that, the pooling processing unit 103 acquires the value by the pooling process while advancing the thick line frame 412 in the row direction by the element data until the thick line frame 412 reaches the end of the line of the data 401. Then, the pooling processing unit 103 sets the element data p08 to p13 of the data 402 to output the acquired values, respectively.

プーリング処理部103は、1行ずつ対象とする行を下げつつ、プーリングサイズを交互に用いてプーリング処理による値の取得を繰返す。そして、プーリング処理部103は、取得した値をそれぞれ出力するデータ402の要素データp14〜p48としていく。 The pooling processing unit 103 repeats the acquisition of the value by the pooling processing by alternately using the pooling size while lowering the target line one by one. Then, the pooling processing unit 103 sets the acquired values as element data p14 to p48 of the data 402 for outputting each of them.

例えば、太線枠412が図17で示すデータ401上の位置に配置された場合、プーリング処理部103は、要素データi09,i10,i17及びi18を取得する。そして、プーリング処理部103は、要素データi09,i10,i17及びi18を用いてプーリング処理を行い値を取得する。その後、プーリング処理部103は、取得した値をデータ402の要素データp08とする。 For example, when the thick line frame 412 is arranged at the position on the data 401 shown in FIG. 17, the pooling processing unit 103 acquires the element data i09, i10, i17 and i18. Then, the pooling processing unit 103 performs pooling processing using the element data i09, i10, i17 and i18, and acquires a value. After that, the pooling processing unit 103 sets the acquired value as the element data p08 of the data 402.

また、太線枠413が図17で示すデータ401上の位置に配置された場合、プーリング処理部103は、要素データi32,i33,i40及びi41を取得する。そして、プーリング処理部103は、要素データi32,i33,i40及びi41を用いてプーリング処理を行い値を取得する。その後、プーリング処理部103は、取得した値をデータ402の要素データp28とする。 Further, when the thick line frame 413 is arranged at the position on the data 401 shown in FIG. 17, the pooling processing unit 103 acquires the element data i32, i33, i40 and i41. Then, the pooling processing unit 103 performs pooling processing using the element data i32, i33, i40 and i41, and acquires a value. After that, the pooling processing unit 103 sets the acquired value as the element data p28 of the data 402.

プーリング処理部103は、要素データp00〜p48を取得してデータ402を完成させる。その後、プーリング処理部103は、データ402を次の演算処理層10へ出力する。 The pooling processing unit 103 acquires the element data p00 to p48 and completes the data 402. After that, the pooling processing unit 103 outputs the data 402 to the next arithmetic processing layer 10.

以上に説明したように、本実施例に係る演算処理装置は、フォワード畳込演算の演算結果であるトップデータをそのまま用いてプーリング処理を行うことができる。したがって、新フィルタ定義に合わせてボトムデータを変換してフォワード畳込演算を行った場合でも、処理を増やさずにプーリング処理を行うことができ、ネットワーク全体として演算処理の効率を向上させることができる。 As described above, the arithmetic processing unit according to the present embodiment can perform the pooling processing by using the top data which is the arithmetic result of the forward convolution operation as it is. Therefore, even when the bottom data is converted according to the new filter definition and the forward convolution operation is performed, the pooling process can be performed without increasing the process, and the efficiency of the operation process can be improved for the entire network. ..

次に、実施例3について説明する。本実施例に係る演算処理装置は、新フィルタ定義に合わせてボトムデータを変換した場合に、入力されるデータと出力するデータとを同じ大きさにするパディングを行う。本実例に係る演算処理装置も、図1〜4で表される。以下では、実施例1と同様の各部の機能については説明を省略する。 Next, Example 3 will be described. The arithmetic processing unit according to this embodiment performs padding to make the input data and the output data the same size when the bottom data is converted according to the new filter definition. The arithmetic processing unit according to this example is also represented by FIGS. 1 to 4. In the following, description of the functions of the same parts as in the first embodiment will be omitted.

図18は、実施例3に係る畳込演算部によるフォワード畳込演算を説明するための図である。ここでは、8×8のボトムデータ201及び新フィルタ定義301を使用した重みデータ221を用いてフォワード畳込演算を行う場合で説明する。 FIG. 18 is a diagram for explaining a forward convolution operation by the convolution operation unit according to the third embodiment. Here, a case where the forward convolution operation is performed using the 8 × 8 bottom data 201 and the weight data 221 using the new filter definition 301 will be described.

入力データ処理部111は、ボトムデータ201の入力を受ける。そして、入力データ処理部111は、ボトムデータ201を新フィルタ定義221に合わせて変換しボトムデータ210とする。 The input data processing unit 111 receives the input of the bottom data 201. Then, the input data processing unit 111 converts the bottom data 201 according to the new filter definition 221 to obtain the bottom data 210.

そして、入力データ処理部111は、ボトムデータ210の周りに図18に示すように値が0である要素データ213を付加し、ボトムデータ214を生成する。このボトムデータ210の周りに値が0である要素データ213を付加する処理が0パディングである。これにより、入力データ処理部111は、トップ差分データ203のサイズをボトムデータ210のサイズと一致させる。そして、入力データ処理部111は、ボトムデータ214を乗算部112へ出力する。 Then, the input data processing unit 111 adds element data 213 having a value of 0 around the bottom data 210 as shown in FIG. 18 to generate the bottom data 214. The process of adding the element data 213 having a value of 0 around the bottom data 210 is 0 padding. As a result, the input data processing unit 111 matches the size of the top difference data 203 with the size of the bottom data 210. Then, the input data processing unit 111 outputs the bottom data 214 to the multiplication unit 112.

乗算部112は、ボトムデータ214の入力を入力データ処理部111から受ける。そして、乗算部112は、ボトムデータ214に対して、重みデータ221を用いてフォワード畳込演算を実行する。これにより、乗算部112は、ボトムデータ210の要素データb00〜nb63と同数のトップデータ209の要素データt00〜t63を算出する。 The multiplication unit 112 receives the input of the bottom data 214 from the input data processing unit 111. Then, the multiplication unit 112 executes a forward convolution operation on the bottom data 214 using the weight data 221. As a result, the multiplication unit 112 calculates the same number of element data t00 to t63 of the top data 209 as the element data b00 to nb63 of the bottom data 210.

ここで、8×8の行列のボトムデータ201の場合、0パディングを行うには36個の要素データ213を用いる。これに対して、ボトムデータ210の場合、0パディングを行うには34個の要素データ213を用いる。すなわち、ボトムデータ210を用いた方が、変換前のボトムデータ201に比べて、0パディングに用いる要素データ213が少なくて済む。 Here, in the case of the bottom data 201 of the 8 × 8 matrix, 36 element data 213 are used to perform 0 padding. On the other hand, in the case of the bottom data 210, 34 element data 213 are used to perform 0 padding. That is, when the bottom data 210 is used, the number of element data 213 used for 0 padding is smaller than that of the bottom data 201 before conversion.

以上に説明したように、本実施例に係る演算処理装置は、新フィルタ定義に合わせた変換後のボトムデータに対して0パディングを行いフォワード畳込演算を行う。この場合、変換前のボトムデータに対して0パディングを行うよりも少ない数の要素データの付加で済み、データ容量を小さくできるとともに演算効率を向上させることができる。 As described above, the arithmetic processing unit according to the present embodiment performs 0 padding on the converted bottom data according to the new filter definition and performs the forward convolution operation. In this case, it is sufficient to add a smaller number of element data than performing 0 padding on the bottom data before conversion, and the data capacity can be reduced and the calculation efficiency can be improved.

次に、実施例4について説明する。本実施例に係る演算処理装置は、3次元データに対して新フィルタ定義を用いてフォワード畳込演算及びバックワード畳込演算を行う。本実例に係る演算処理装置も、図1〜4で表される。本実施例に係る各部は、同様の符号を有する実施例1の各部と同様の処理を3次元データに対して実行する機能を有する。 Next, Example 4 will be described. The arithmetic processing unit according to this embodiment performs a forward convolution operation and a backward convolution operation on three-dimensional data using a new filter definition. The arithmetic processing unit according to this example is also represented by FIGS. 1 to 4. Each part according to the present embodiment has a function of executing the same processing as each part of the first embodiment having the same reference numerals to the three-dimensional data.

図19は、実施例4に係る畳込演算部による新フィルタ定義を用いたフォワード畳込演算の一例を説明するための図である。重みデータ記憶部115は、3次元の新フィルタ定義を使用した重みデータ222を記憶する。ここで、重みデータ222に対応する従来のフィルタ定義は、3×3×3に要素データが並んだ立方体である。重みデータ222は、x〜z方向の正面図が実施例1の新フィルタ定義301と同様のデータの配置形状を有する。 FIG. 19 is a diagram for explaining an example of a forward convolution operation using a new filter definition by the convolution operation unit according to the fourth embodiment. The weight data storage unit 115 stores weight data 222 using the new three-dimensional filter definition. Here, the conventional filter definition corresponding to the weight data 222 is a cube in which element data are arranged in 3 × 3 × 3. The weight data 222 has the same data arrangement shape as the new filter definition 301 of the first embodiment in the front view in the x to z directions.

入力データ処理部111は、8×8×8の立方体であるボトムデータ201の入力を受ける。そして、入力データ処理部111は、ボトムデータ201の図19の座標に対応するy軸方向及びz軸方向に並ぶ隣合う要素データを平均化する。これにより、入力データ処理部111は、ボトムデータ201のy軸方向及びz軸方向に隔行ずつ要素データの半分だけずらした見た目を有するボトムデータ210を生成する。そして、入力データ処理部111は、生成したボトムデータ210を乗算部112へ出力する。 The input data processing unit 111 receives the input of the bottom data 201, which is an 8 × 8 × 8 cube. Then, the input data processing unit 111 averages the adjacent element data arranged in the y-axis direction and the z-axis direction corresponding to the coordinates of FIG. 19 of the bottom data 201. As a result, the input data processing unit 111 generates the bottom data 210 having the appearance of the bottom data 201 shifted by half of the element data by intervals in the y-axis direction and the z-axis direction. Then, the input data processing unit 111 outputs the generated bottom data 210 to the multiplication unit 112.

乗算部112は、ボトムデータ210の入力を受ける。そして、乗算部112は、新フィルタ定義を使用した重みデータ222をボトムデータ210に対して用いて、フォワード畳込演算を行う。 The multiplication unit 112 receives the input of the bottom data 210. Then, the multiplication unit 112 uses the weight data 222 using the new filter definition for the bottom data 210 to perform a forward convolution operation.

また、畳込演算部106は、ボトムデータ210と重みデータ222とを用いたフォワード畳込演算で算出されたトップデータ209の配置形状と同様の配置形状を有するトップ差分データ203の入力を受ける。そして、畳込演算部106は、ボトムデータ210、重みデータ222及び取得したトップ差分データ203を用いてバックワード畳込演算を実行する。 Further, the convolution calculation unit 106 receives the input of the top difference data 203 having the same arrangement shape as the arrangement shape of the top data 209 calculated by the forward convolution operation using the bottom data 210 and the weight data 222. Then, the convolution calculation unit 106 executes a backward convolution operation using the bottom data 210, the weight data 222, and the acquired top difference data 203.

次に、図20を参照して、実施例4に係る畳込演算部106による新フィルタ定義を用いたフォワード畳込演算の他の例を説明する。図20は、実施例4に係る畳込演算部による新フィルタ定義を用いたフォワード畳込演算の他の例を説明するための図である。重みデータ記憶部115は、3次元の新フィルタ定義を使用した重みデータ223を記憶する。この、重みデータ223も、3×3×3に要素データが並んだ立方体に対応する新フィルタ定義である。重みデータ223も、x〜z方向の正面図が実施例1の新フィルタ定義301と同様のデータの配置形状を有する。 Next, with reference to FIG. 20, another example of the forward convolution operation using the new filter definition by the convolution operation unit 106 according to the fourth embodiment will be described. FIG. 20 is a diagram for explaining another example of the forward convolution operation using the new filter definition by the convolution operation unit according to the fourth embodiment. The weight data storage unit 115 stores weight data 223 using the new three-dimensional filter definition. This weight data 223 is also a new filter definition corresponding to a cube in which element data are arranged in 3 × 3 × 3. The weight data 223 also has the same data arrangement shape as the new filter definition 301 of the first embodiment in the front view in the x to z directions.

入力データ処理部111は、図19の場合と同様にボトムデータ210を生成する。乗算部112は、新フィルタ定義を使用した重みデータ223をボトムデータ210に対して用いて、フォワード畳込演算を行う。また、畳込演算部106は、ボトムデータ210と重みデータ223とを用いたフォワード畳込演算で算出されたトップデータ209と同様のデータの配置形状を有するトップ差分データ203を用いてバックワード畳込演算を行う。 The input data processing unit 111 generates the bottom data 210 as in the case of FIG. The multiplication unit 112 uses the weight data 223 using the new filter definition for the bottom data 210 to perform a forward convolution operation. Further, the convolution calculation unit 106 uses the back word tatami using the top difference data 203 having the same data arrangement shape as the top data 209 calculated by the forward convolution calculation using the bottom data 210 and the weight data 223. Performs inclusive operations.

以上に説明したように、本実施例に係る演算処理装置は、3次元データに対しても従来よりも要素データの少ない新フィルタ定義を使用してフォワード畳込演算及びバックワード畳込演算を行う。したがって、本実施例に係る演算処理装置は、3次元データを用いた深層学習の演算において、使用する記憶装置の容量を抑えつつ演算効率を向上させることができる。 As described above, the arithmetic processing unit according to the present embodiment performs forward convolution operation and backward convolution operation for three-dimensional data by using a new filter definition having less element data than before. .. Therefore, the arithmetic processing unit according to the present embodiment can improve the arithmetic efficiency while suppressing the capacity of the storage apparatus used in the deep learning arithmetic using the three-dimensional data.

(プログラムの記述例)
図21は、フォワード畳込演算のプログラムの記述例を説明するための図である。フォワード畳込演算は、図21に示すようにボトムデータ201(bottom_y)とトップデータ209(top_x)とを用いた演算は掛け算と足し算で表現できる。フォワード畳込演算は、ボトムデータ201のデータ数Ci、トップ差分データ203のデータ数Co、バッチ数mb、ストライド数W及びトップサイズを調節するためのパラメータとなるパッド数padを指定して行なわれる。ここで、トップサイズの調整とは、トップサイズの水増しにあたる。
(Program description example)
FIG. 21 is a diagram for explaining a description example of a program for forward convolution operation. As shown in FIG. 21, the forward convolution operation can be expressed by multiplication and addition in the operation using the bottom data 201 (bottom_y) and the top data 209 (top_x). The forward convolution operation is performed by designating the number of data Ci of the bottom data 201, the number of data Co of the top difference data 203, the number of batches mb, the number of strides W, and the number of pads as parameters for adjusting the top size. .. Here, adjusting the top size corresponds to inflating the top size.

図22は、バックワード畳込重み差分演算のプログラムの記述例を説明するための図である。バックワード畳込重み差分演算は、図22に示すようにボトムデータ201(bottom_y)とトップ差分データ203(top_x)とを用いた演算は掛け算と足し算で表現できる。この場合、重み差分データ(ew)が算出される。バックワード畳込重み差分演算は、ボトムデータ201のデータ数Ci、トップ差分データ203のデータ数Co、バッチ数mb、ストライド数W及びトップサイズを調節するためのパラメータとなるパッド数padを指定して行なわれる。ここで、トップサイズの調整とは、トップサイズの水増しにあたる。 FIG. 22 is a diagram for explaining a description example of a program for backward convolution weight difference calculation. As shown in FIG. 22, the backward convolution weight difference calculation can be expressed by multiplication and addition in the calculation using the bottom data 201 (bottom_y) and the top difference data 203 (top_x). In this case, the weight difference data (ew) is calculated. In the backward convolution weight difference calculation, the number of data Ci of the bottom data 201, the number of data Co of the top difference data 203, the number of batches mb, the number of strides W, and the number of pads as parameters for adjusting the top size are specified. Is done. Here, adjusting the top size corresponds to inflating the top size.

図23は、バックワード畳込ボトム差分演算のプログラムの記述例を説明するための図である。バックワード畳込ボトム差分演算は、図23に示すようにボトムデータ201(bottom_y)とトップ差分データ203(top_x)と用いた演算は掛け算と足し算で表現できる。この場合、ボトム差分データ205(bottom_ey)が算出される。バックワード畳込ボトム差分演算は、ボトムデータ201のデータ数Ci、トップ差分データ203のデータ数Co、バッチ数mb、ストライド数W及びトップサイズを調節するためのパラメータとなるパッド数padを指定して行なわれる。ここで、トップサイズの調整とは、トップサイズの水増しにあたる。 FIG. 23 is a diagram for explaining a description example of a program for backward convolution bottom difference calculation. As shown in FIG. 23, the backward convolution bottom difference operation can be expressed by multiplication and addition of the operation using the bottom data 201 (bottom_y) and the top difference data 203 (top_x). In this case, the bottom difference data 205 (bottom_ey) is calculated. In the backward convolution bottom difference calculation, the number of data Ci of the bottom data 201, the number of data Co of the top difference data 203, the number of batches mb, the number of strides W, and the number of pads as parameters for adjusting the top size are specified. Is done. Here, adjusting the top size corresponds to inflating the top size.

(ハードウェア構成)
図25は、演算処理装置のハードウェア構成図である。演算処理装置1は、CPU(Central Processing Unit)91、メモリ92、アクセラレータ93及びメモリ94を有する。メモリ92は、CPU91専用のメモリであり、CPU91に含まれてもよい。また、メモリ94は、アクセラレータ93のメモリであり、アクセラレータ93に含まれてもよい。
(Hardware configuration)
FIG. 25 is a hardware configuration diagram of the arithmetic processing unit. The arithmetic processing unit 1 includes a CPU (Central Processing Unit) 91, a memory 92, an accelerator 93, and a memory 94. The memory 92 is a memory dedicated to the CPU 91 and may be included in the CPU 91. Further, the memory 94 is a memory of the accelerator 93 and may be included in the accelerator 93.

メモリ92は、OS(Operating System)及び各演算処理層10で使用される学習プログラムを含む各種プログラムを記憶する。また、メモリ92は、入力データ2及び期待値207を記憶する。 The memory 92 stores various programs including an OS (Operating System) and a learning program used in each arithmetic processing layer 10. Further, the memory 92 stores the input data 2 and the expected value 207.

CPU91は、メモリ92に格納されたOSを実行する。さらに、CPU91は、メモリ92が有する学習プログラムを含む各種プログラム、並びに、入力データ2、重みデータ202及び期待値207を含む各種データをアクセラレータ93へ出力する。重みデータ202には、使用する新フィルタ定義に応じて重みデータ221などを含む。そして、CPU91は、深層学習の処理実行をアクセラレータ93に指示する。その後、CPU91は、学習後の重みデータ202をアクセラレータ93から取得し、メモリ92に格納された重みデータ202を更新する。 The CPU 91 executes the OS stored in the memory 92. Further, the CPU 91 outputs various programs including the learning program included in the memory 92, and various data including the input data 2, the weight data 202, and the expected value 207 to the accelerator 93. The weight data 202 includes weight data 221 and the like according to the new filter definition to be used. Then, the CPU 91 instructs the accelerator 93 to execute the deep learning process. After that, the CPU 91 acquires the trained weight data 202 from the accelerator 93 and updates the weight data 202 stored in the memory 92.

アクセラレータ93は、例えば、GPUやFPGA(Field Programmable Gate Array)などである。アクセラレータ93は、CPU91から入力された学習プログラムを含む各種プログラム、並びに、入力データ2及び期待値207を含む各種データをメモリ94に格納する。そして、アクセラレータ93は、メモリ94に格納した学習プログラムを含む各種プログラム及び各種データを用いて深層学習の処理を実行する。これにより、アクセラレータ93は、図2で例示した演算処理層10の畳込演算部101、活性化処理部102、プーリング処理部103、プーリング処理部104、活性化処理部105及び畳込演算部106の各機能を実現する。アクセラレータ93は、各演算処理層10における学習結果である重みデータ202をCPU91へ出力する。アクセラレータ93は、全ての演算処理層10について同様に処理を実行する。ここで、アクセラレータ93は、各演算処理層10の処理毎にCPU91からデータを取得してもよいし、各演算処理層10の処理に使用するデータをまとめて取得してもよい。 The accelerator 93 is, for example, a GPU, an FPGA (Field Programmable Gate Array), or the like. The accelerator 93 stores various programs including the learning program input from the CPU 91, and various data including the input data 2 and the expected value 207 in the memory 94. Then, the accelerator 93 executes the deep learning process using various programs including the learning program stored in the memory 94 and various data. As a result, the accelerator 93 includes the convolution calculation unit 101, the activation processing unit 102, the pooling processing unit 103, the pooling processing unit 104, the activation processing unit 105, and the convolution calculation unit 106 of the arithmetic processing layer 10 illustrated in FIG. Realize each function of. The accelerator 93 outputs weight data 202, which is a learning result in each arithmetic processing layer 10, to the CPU 91. The accelerator 93 executes processing in the same manner for all the arithmetic processing layers 10. Here, the accelerator 93 may acquire data from the CPU 91 for each processing of each arithmetic processing layer 10, or may collectively acquire data used for processing of each arithmetic processing layer 10.

1 演算処理装置
2 入力データ
3 出力データ
10〜14 演算処理層
101,106 畳込演算部
102,105 活性化処理部
103,104 プーリング処理部
111 入力データ処理部
112 乗算部
113 加算部
114 出力データ作成部
115 重みデータ記憶部
201,210,211 ボトムデータ
202,221,222,223 重みデータ
203 トップ差分データ
204 重み差分データ
205 ボトム差分データ
207 期待値
209 トップデータ
1 Arithmetic processing device 2 Input data 3 Output data 10 to 14 Arithmetic processing layer 101, 106 Convolution calculation unit 102, 105 Activation processing unit 103, 104 Pooling processing unit 111 Input data processing unit 112 Multiplying unit 113 Addition unit 114 Output data Creation unit 115 Weight data storage unit 2011,210,211 Bottom data 202,221,222,223 Weight data 203 Top difference data 204 Weight difference data 205 Bottom difference data 207 Expected value 209 Top data

Claims (6)

行列を形成する要素データを有する第1データ及び行列を形成する要素データから所定数の要素データを除いた配置形状を有する第2データを記憶する記憶部と、
前記第2データの配置形状を基に前記第1データを変換する変換部と、
前記変換部により変換された前記第1データに対して前記第2データをフィルタとして用いて畳み込み演算を行う畳込演算部と
を備えたことを特徴とする演算処理装置。
A storage unit that stores the first data having the element data forming the matrix and the second data having the arrangement shape obtained by excluding a predetermined number of element data from the element data forming the matrix.
A conversion unit that converts the first data based on the arrangement shape of the second data, and
A calculation processing unit including a convolution calculation unit that performs a convolution calculation using the second data as a filter for the first data converted by the conversion unit.
前記第2データは、縦、横及び斜め方向に関して対称な配置形状を有することを特徴とする請求項1に記載の演算処理装置。 The arithmetic processing unit according to claim 1, wherein the second data has a symmetrical arrangement shape in the vertical, horizontal, and diagonal directions. 前記第1データは、行方向及び列方向に同数の要素データを有し、
前記第2データは、行方向及び列方向に同数の要素データが配置された状態から真ん中の行から1つ離れるにしたがい行の含まれる要素データを1つずつ除き、且つ、要素データを除いた行の半分の位置と要素データを除く前の行の半分の位置とが一致するように要素データが配置された配置形状を有し、
前記変換部は、前記第1データの隔行の隣り合う要素データを平均化する変換を行う
ことを特徴とする請求項1又は2に記載の演算処理装置。
The first data has the same number of element data in the row direction and the column direction.
In the second data, the element data including the row was removed one by one according to the distance from the middle row from the state where the same number of element data was arranged in the row direction and the column direction, and the element data was excluded. It has an arrangement shape in which the element data is arranged so that the position of half of the row and the position of half of the previous row excluding the element data match.
The arithmetic processing unit according to claim 1 or 2, wherein the conversion unit performs conversion for averaging adjacent element data in intervals of the first data.
前記畳込演算部による演算結果に含まれる要素データの値をそのまま用いてプーリング処理を実行するプーリング処理部をさらに備えたことを特徴とする請求項1〜3のいずれか一つに記載の演算処理装置。 The operation according to any one of claims 1 to 3, further comprising a pooling processing unit that executes a pooling process by using the value of element data included in the calculation result by the convolution calculation unit as it is. Processing equipment. 前記畳込演算部は、前記第1データの周りを最小の数で囲むように0の値を有する要素データを付加し、0の値を有する要素データを付加した前記第1データに対して前記第2データをフィルタとして用いて畳み込み演算を行い、前記第1データと同数の要素データを有する演算結果を取得することを特徴とする請求項1〜4のいずれか一つに記載の演算処理装置。 The convolution calculation unit adds element data having a value of 0 so as to surround the first data with a minimum number, and the convolution calculation unit adds the element data having a value of 0 to the first data. The arithmetic processing apparatus according to any one of claims 1 to 4, wherein the convolution operation is performed using the second data as a filter, and an arithmetic result having the same number of element data as the first data is acquired. .. 行列を形成する要素データを有する第1データ及び行列を形成する要素データから所定数の要素データを除いた配置形状を有する第2データを記憶する演算処理装置の制御方法であって、
前記第2データの配置形状を基に前記第1データを変換させ、
変換された前記第1データに対して前記第2データをフィルタとして用いて畳込演算を行わせる
ことを特徴とする演算処理装置の制御方法。
A control method for an arithmetic processing unit that stores first data having element data forming a matrix and second data having an arrangement shape obtained by removing a predetermined number of element data from the element data forming a matrix.
The first data is converted based on the arrangement shape of the second data.
A control method of an arithmetic processing unit, characterized in that a convolution operation is performed on the converted first data by using the second data as a filter.
JP2017017668A 2017-02-02 2017-02-02 Arithmetic processing unit and control method of arithmetic processing unit Active JP6794854B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2017017668A JP6794854B2 (en) 2017-02-02 2017-02-02 Arithmetic processing unit and control method of arithmetic processing unit
US15/877,444 US20180217962A1 (en) 2017-02-02 2018-01-23 Operation processing apparatus and operation processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017017668A JP6794854B2 (en) 2017-02-02 2017-02-02 Arithmetic processing unit and control method of arithmetic processing unit

Publications (2)

Publication Number Publication Date
JP2018124867A JP2018124867A (en) 2018-08-09
JP6794854B2 true JP6794854B2 (en) 2020-12-02

Family

ID=62979883

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017017668A Active JP6794854B2 (en) 2017-02-02 2017-02-02 Arithmetic processing unit and control method of arithmetic processing unit

Country Status (2)

Country Link
US (1) US20180217962A1 (en)
JP (1) JP6794854B2 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11568223B2 (en) * 2017-04-14 2023-01-31 Semiconductor Energy Laboratory Co., Ltd. Neural network circuit
US20190392287A1 (en) 2018-06-22 2019-12-26 Samsung Electronics Co., Ltd. Neural processor
CN110096310B (en) * 2018-11-14 2021-09-03 上海寒武纪信息科技有限公司 Operation method, operation device, computer equipment and storage medium
CN110096309B (en) * 2018-11-14 2020-04-14 上海寒武纪信息科技有限公司 Operation method, operation device, computer equipment and storage medium
JP7026032B2 (en) * 2018-10-19 2022-02-25 Kddi株式会社 Recommendation system and recommendation method
US11671111B2 (en) 2019-04-17 2023-06-06 Samsung Electronics Co., Ltd. Hardware channel-parallel data compression/decompression
US11880760B2 (en) 2019-05-01 2024-01-23 Samsung Electronics Co., Ltd. Mixed-precision NPU tile with depth-wise convolution
CN112133342B (en) * 2019-06-25 2022-05-06 中电海康集团有限公司 Memory device
JP2021022235A (en) * 2019-07-29 2021-02-18 公益財団法人鉄道総合技術研究所 Blinking detection device and blinking detection method
WO2021168644A1 (en) * 2020-02-25 2021-09-02 深圳市大疆创新科技有限公司 Data processing apparatus, electronic device, and data processing method
JP2022165250A (en) * 2021-04-19 2022-10-31 富士通株式会社 Program, data processing method, and data processing apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5900321B2 (en) * 2012-02-08 2016-04-06 株式会社Jvcケンウッド Image processing apparatus, image processing method, and image processing program
JP6700712B2 (en) * 2015-10-21 2020-05-27 キヤノン株式会社 Convolution operation device

Also Published As

Publication number Publication date
US20180217962A1 (en) 2018-08-02
JP2018124867A (en) 2018-08-09

Similar Documents

Publication Publication Date Title
JP6794854B2 (en) Arithmetic processing unit and control method of arithmetic processing unit
US10642613B2 (en) Arithmetic processing device for deep learning and control method of the arithmetic processing device for deep learning
US11301546B2 (en) Spatial locality transform of matrices
KR102347119B1 (en) Accessing data in multi-dimensional tensors using adders
CN110520834B (en) Alternative cycle limiting
JP6972547B2 (en) Arithmetic processing unit and control method of arithmetic processing unit
US20190095776A1 (en) Efficient data distribution for parallel processing
TWI678617B (en) "system, computer-implemented method, and apparatus for accessing data in multi-dimensional tensors using adders"
JP6958027B2 (en) Arithmetic processing unit and control method of arithmetic processing unit
WO2019119301A1 (en) Method and device for determining feature image in convolutional neural network model
US20170206089A1 (en) Information processing apparatus and computational method
US11580369B2 (en) Inference apparatus, convolution operation execution method, and program
WO2019085709A1 (en) Pooling method and system applied to convolutional neural network
US11164032B2 (en) Method of performing data processing operation
JP2019095862A (en) Arithmetic processing device
JP2018197906A (en) Information processing apparatus, multithreaded matrix calculation method, and multithreaded matrix calculation program
CN114792124A (en) Implementing dilated convolutions in hardware
JP7419574B2 (en) Dilated convolution acceleration calculation method and device
US20170278214A1 (en) Image processing apparatus, image processing method, and vehicle control apparatus
JP2017027314A (en) Parallel arithmetic device, image processor and parallel arithmetic method
CN109726798B (en) Data processing method and device
JP6906622B2 (en) Arithmetic circuit and arithmetic method
US20210312279A1 (en) Information processing apparatus and information processing method
JP2007133710A (en) Preprocessing method and matrix reordering method in simultaneous linear equation iterative solution
JP2020080048A (en) Parallel processing apparatus and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20191008

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200930

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: 20201013

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20201026

R150 Certificate of patent or registration of utility model

Ref document number: 6794854

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150