WO2019168084A1 - 推論装置、畳み込み演算実行方法及びプログラム - Google Patents

推論装置、畳み込み演算実行方法及びプログラム Download PDF

Info

Publication number
WO2019168084A1
WO2019168084A1 PCT/JP2019/007756 JP2019007756W WO2019168084A1 WO 2019168084 A1 WO2019168084 A1 WO 2019168084A1 JP 2019007756 W JP2019007756 W JP 2019007756W WO 2019168084 A1 WO2019168084 A1 WO 2019168084A1
Authority
WO
WIPO (PCT)
Prior art keywords
input data
unit
layer
convolution operation
weight
Prior art date
Application number
PCT/JP2019/007756
Other languages
English (en)
French (fr)
Inventor
誠也 柴田
Original Assignee
日本電気株式会社
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 日本電気株式会社 filed Critical 日本電気株式会社
Priority to JP2020503604A priority Critical patent/JP6977864B2/ja
Priority to US16/977,349 priority patent/US11989639B2/en
Publication of WO2019168084A1 publication Critical patent/WO2019168084A1/ja

Links

Images

Classifications

    • 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
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • 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

Definitions

  • the present invention is based on the priority claim of Japanese patent application: Japanese Patent Application No. 2018-038029 (filed on Mar. 02, 2018), the entire contents of which are incorporated herein by reference. Shall.
  • the present invention relates to an inference device, a convolution operation execution method, and a program.
  • the convolutional neural network includes a convolutional layer, a pooling layer, and a fully connected layer. In the convolution layer, a process of convolving the kernel with the entire image is performed.
  • a set of features convolved in the image is obtained by the process of convolving the kernel over the entire image (processing for applying a filter to the image).
  • the set of features is also referred to as a feature map.
  • the feature map is obtained by applying an activation function to the convolved values. For example, in the field of image recognition, ReLU (Rectified Linear Unit) is often used as an activation function.
  • ReLU Rectified Linear Unit
  • a process of convolving the kernel (weight, filter) with the image (input image) is performed. At that time, many processes for multiplying each pixel of the image by the weight are performed.
  • Non-Patent Document 1 discloses a 1-bit conversion method of an input image suitable for BinaryCNN (Convolutional Neural Network). The technology of this document assumes that image data used for CNN inference is expressed by 1 bit, and an image is converted to 1 bit by branching a signal line of a circuit that handles an input signal. In the technique disclosed in Non-Patent Document 1, the meaning of input data changes, and weights used for CNN inference need to be relearned.
  • BinaryCNN Convolutional Neural Network
  • Non-Patent Documents 2 to 4 disclose techniques related to “quantization” in CNN inference.
  • Non-Patent Document 2 discloses a technique for converting the result of a convolution operation into a binary value.
  • Non-Patent Document 3 discloses a technique for converting a result of a convolution operation into a ternary value.
  • Non-Patent Document 4 discloses a technique for converting the result of a convolution operation into 4 bits.
  • Non-Patent Documents 2 and 3 limit the range that can be taken by the result of the convolution operation, and re-learn to determine the parameters.
  • the technique disclosed in Non-Patent Document 4 rounds the result of the convolution operation (integer, floating point, etc.) to a power of 2.
  • quantization for rounding the result of the convolution operation disclosed in Non-Patent Document 4 to a power of 2 is referred to as “logarithmic quantization”.
  • JP 2017-2111735 A Japanese Patent No. 6183980
  • Non-Patent Documents 1 to 4 in order to finish the computation of the convolutional layer within a realistic time even if the scale of hardware is suppressed or a processor with low computation processing capability is used. Technology is required.
  • the first stage (first layer) input data cannot be logarithmically quantized to perform a convolution operation. That is, the multiplication process in the first layer convolution operation cannot be completed by one shift operation. Specifically, for the first layer convolution operation, the result of multiplying the multiplicand by the lowest number of the multiplier and then multiplying the multiplicand by the next digit of the multiplier is added with the digits shifted. The process must be repeated (normal integer multiplication is required). That is, even if the input data of the second layer and later is logarithmically quantized and the multiplication of the convolution operation is simplified by the shift operation, the benefits can be enjoyed only by the convolution operation of the second layer and later. As for the calculation, it is necessary to repeat writing in binary numbers.
  • the above fact means that a circuit (integer multiplier) for executing the first layer convolution operation is required in addition to the circuit for executing the convolution operation for the second layer and thereafter (multiplier by shift operation).
  • the processing content (algorithm) of the convolution calculation is not different depending on the layer, and it cannot be said that preparing a plurality of circuits having different processings can effectively use resources such as FPGA (Field Programmable Gate Gate Array).
  • FPGA Field Programmable Gate Gate Array
  • preparing a plurality of different circuits requires a large-scale FPGA or the like, and has a great influence on power consumption and cost.
  • the main object of the present invention is to provide an inference device, a convolution operation execution method, and a program that contribute to sharing a circuit for executing a convolution operation using quantized input data in each layer.
  • a quantization unit that quantizes a result of a convolution operation in a convolutional neural network using input data and weights, and uses the quantized operation result as input data.
  • the first layer of input data so that the convolution unit can process the input data of the first layer and the input data quantized by the quantization unit in the same way.
  • An inference device is provided that includes an input data conversion unit that converts.
  • a quantization unit that quantizes a result of a convolution operation in a convolutional neural network using input data and weights, and uses the quantized operation result as input data.
  • a convolution operation unit that executes a convolution operation, and the step of acquiring the input data, and when the acquired input data is used in a first layer of convolution operation, the convolution operation A step of converting the input data of the first layer so that the unit can similarly process the input data of the first layer and the input data quantized by the quantization unit.
  • the quantization unit that quantizes the result of the convolution operation in the convolution neural network using the input data and the weight, and the quantized operation result is used as the input data.
  • a computer mounted in an inference device including a convolution operation unit that executes a convolution operation, and when the acquired input data is used in a first layer convolution operation Performs a process of converting the input data of the first layer so that the convolution operation unit can similarly process the input data of the first layer and the input data quantized by the quantization unit.
  • a program is provided. This program can be recorded on a computer-readable storage medium.
  • the storage medium may be non-transient such as a semiconductor memory, a hard disk, a magnetic recording medium, an optical recording medium, or the like.
  • the present invention can also be embodied as a computer program product.
  • an inference device a convolution operation execution method, and a program that contribute to sharing a circuit for executing a convolution operation using quantized input data in each layer.
  • connection lines between the blocks in each drawing include both bidirectional and unidirectional directions.
  • the unidirectional arrow schematically shows the main signal (data) flow and does not exclude bidirectionality.
  • an input port and an output port exist at each of an input end and an output end of each connection line, although they are not explicitly shown. The same applies to the input / output interface.
  • the inference apparatus 100 includes a quantization unit 101, a convolution operation unit 102, and an input data conversion unit 103 (see FIG. 1).
  • the quantization unit 101 quantizes the result of the convolution operation in the convolutional neural network using the input data and the weight.
  • the convolution operation unit 102 performs a convolution operation using the quantized operation result as input data.
  • the input data conversion unit 103 converts the first layer input data so that the convolution operation unit 102 can similarly process the first layer input data and the input data quantized by the quantization unit 101.
  • the inference apparatus 100 is configured such that multiplication processing in convolution calculation can be realized by shift calculation. More specifically, the convolution operation unit 102 is configured to complete the multiplication process of the convolution operation if the acquired weight is shifted to the left by a number corresponding to the input data.
  • the input data conversion unit 103 converts the input data so that the convolution operation unit 102 can be used regardless of the layer. As a result, a circuit (convolution operation unit 102) that performs a convolution operation using quantized input data can be shared by each layer.
  • FIG. 2 is a diagram for explaining the structure of an intermediate layer (hidden layer) in image recognition.
  • the input layer and the intermediate layer are connected, and the intermediate layer and the output layer are connected.
  • data input to the input layer is assumed to be image data.
  • the input data handled in the present disclosure is not limited to image data.
  • the input layer creates data for output to the intermediate layer from the acquired input data. For example, when the image data is composed of three channels of RGB (Red Green Blue), the input layer generates image data of each color and outputs it to the intermediate layer.
  • the intermediate layer combines the data from which the feature portion of the input data is extracted by a convolutional neural network (CNN (Convolutional Neural Network)) into one node, and outputs a feature variable.
  • CNN Convolutional Neural Network
  • the intermediate layer includes a plurality of “layers”, the first layer is connected to the input layer, and the last layer is connected to all the coupling layers.
  • Each layer constituting the intermediate layer may include a convolution layer, an activation function, and a pooling layer. Note that the configuration shown in FIG. 2 is merely an example, and is not intended to limit the configuration of the intermediate layer. In some cases, the activation function and the pooling layer may not be included in the intermediate layer.
  • the convolution layer extracts feature values from the acquired input data.
  • An activation function is applied to the extracted feature quantity, and the feature quantity after the activation function is applied is input to the pooling layer.
  • the acquired feature values are combined.
  • a process (a process for obtaining invariance) is performed so that the object can be determined to be the same even if the position of the object fluctuates. For example, a process for allowing the displacement of the object is performed in the pooling layer.
  • the layer for applying the “activation function” is described in a form independent of the convolution layer and the pooling layer, but actually, the “activation function” is the convolution layer and the pooling layer. The structure contained in any one of these may be sufficient.
  • the layers constituting the intermediate layer are connected in cascade, and the output of the previous layer corresponds to the input of the subsequent layer.
  • FIG. 3 is a diagram for explaining operations in the convolution layer.
  • the convolution layer outputs feature amounts by multiplying input data and weights (filters).
  • FIG. A size in one direction (vertical direction in FIG. 3) in the input data is expressed as “H”.
  • K shown in FIG. 3 is the number of output channels of the layer.
  • the number K of layer output channels and the number of types of weights are the same. For example, if the number of types of weights shown in FIG. 3 is “4”, the number of output channels K of the layer is also “4”.
  • One type of weight includes the same number of weights as the number of input channels C. For example, if the number of input channels C is “3”, one type of weight includes three weights.
  • the C weights included in one type of weight are associated with each of the C input data. For example, in FIG. 3, in the upper C weights, the foremost weight is associated with the foremost input data.
  • a set of weights divided for each input channel number C is referred to as a “weight group”.
  • Each weight group includes C weights. Since the number of types of weights matches the number of output channels K, the number of weights in the convolutional layer is K ⁇ C.
  • a direction toward another input data or weight with reference to one input data or one weight is referred to as “channel direction”.
  • a direction toward another weight group with one weight group as a reference is denoted as “kernel direction”.
  • the direction from the weight 501 to the weight 502 shown in FIG. 3 is the channel direction
  • the direction from the weight group 511 to the weight group 512 is the kernel direction.
  • the multiplication of the extracted input data and the weight is executed between the corresponding input data and the weight.
  • the weight corresponding to the input data 601 illustrated in the foreground is set to the weight 501 illustrated in the foreground.
  • the weight corresponding to the input data shown in the middle is the weight shown in the middle
  • the weight corresponding to the input data shown in the back is the weight 502 shown in the back.
  • the multiplication and addition process is repeated between the corresponding input data and the weight.
  • the result of the multiplication and addition process is added in the channel direction.
  • the multiplication / addition results in the three channels frontmost, middle, deepest are added.
  • the above multiplication / addition processing and subsequent addition processing are performed for each weight group.
  • the calculation using the weight group 511 and the input data shown in the upper stage is performed, and the same processing (the multiplication and addition process using the same input data and the subsequent addition) is performed for the weight group 512 shown in the lower stage. Process).
  • the above processing (multiplication addition processing and addition processing in the channel direction) is repeated while changing the input data to be extracted. For example, as shown in the foremost input data in FIG. 3, the input data is cut out while sliding the area to be extracted. The same processing as described above is applied to the extracted data.
  • each output data (vertical size, width size) is determined by the specifications when sliding the area (window) when extracting data from the input data.
  • data is extracted from the input data so that each output data includes 12 (4 ⁇ 3) elements.
  • the inference apparatus 10 executes the convolution operation described with reference to FIG. 3 in the process of inference.
  • the inference apparatus 10 includes therein an input layer execution unit 11 that realizes an input layer, an intermediate layer execution unit 12 that realizes an intermediate layer, and an output layer that realizes an output layer.
  • Execution unit 13 Further, the intermediate layer execution unit 12 includes a convolution layer execution unit 31 for realizing a convolution layer, an activation function execution unit 32 for executing an activation function, and a pooling layer execution unit 33 for realizing a pooling layer ( (See FIG. 5).
  • the convolution layer execution unit 31 among the various execution units shown in FIGS. 4 and 5 will be described in detail. Since the other execution units can be realized by a known algorithm or the like, description thereof is omitted.
  • the convolution layer execution unit 31 executes the convolution operation (multiplication / addition processing) described with reference to FIG.
  • FIG. 6 is a diagram illustrating an example of an internal configuration of the convolution layer execution unit 31.
  • the convolution layer execution unit 31 includes a convolution layer control unit 40, a weight processing unit 41, an input data processing unit 42, a convolution operation unit 43, a quantization unit 44, and various storage units. ,It is included.
  • the various storage units include a weight storage unit 51, an input data storage unit 52, and an operation result storage unit 53.
  • the input data storage unit 52 and the weight storage unit 51 store data (input data, weights) necessary for the convolution calculation of each layer.
  • the convolution layer execution unit 31 executes a convolution operation in the convolution neural network using the weights and input data, and stores the result in the operation result storage unit 53.
  • the result of the convolution operation stored in the operation result storage unit 53 is delivered to the activation function execution unit 32.
  • the result processed by the pooling layer execution unit 33 is stored in the input data storage unit 52, and the convolution layer execution unit 31 executes the convolution operation again.
  • the convolution layer control unit 40 is means for controlling the entire convolution layer execution unit 31.
  • the convolution layer control unit 40 realizes the convolution operation by controlling various modules (the convolution operation unit 43 and the like).
  • the weight used for the convolution calculation in each layer is stored in the weight storage unit 51.
  • the weight storage unit 51 stores a plurality of weight groups used in each layer by classifying them for each layer.
  • the weight stored in the weight storage unit 51 may be set in advance before the operation of the inference device 10, or may be received from the host device (for example, a learning device) each time and stored in the weight storage unit 51. Good.
  • the input data storage unit 52 stores input data used for the convolution operation. More precisely, the initial input data storage unit 52 stores input data used for the first layer convolution operation. When the other processing (activation processing and pooling processing) executed in the first layer is completed, the input data storage unit 52 stores input data (activation) used for the second layer convolution operation.
  • the weight processing unit 41 accesses the weight storage unit 51 in response to an instruction from the convolution layer control unit 40, and acquires a weight group suitable for the convolution operation of each layer (used for the convolution operation of each layer).
  • the input data processing unit 42 accesses the input data storage unit 52 in accordance with an instruction from the convolution layer control unit 40, and acquires input data used for the convolution calculation of each layer.
  • the convolution operation unit 43 performs a convolution operation using the weight and data (input data, activation) provided from the weight processing unit 41 and the input data processing unit 42. Although the details will be described later, the convolution operation unit 43 is configured to execute the convolution operation using the input data (activation) logarithmically quantized by the quantization unit 44. Further, the convolution operation unit 43 not only applies the logarithm quantized data by the quantizing unit 44 but also the input data for the first layer as well as the input data for the second and subsequent layers (logarithm quantized input data). To process. The convolution operation unit 43 outputs the result of the convolution operation to the quantization unit 44.
  • the quantization unit 44 performs logarithmic quantization on the result of the convolution operation performed by the convolution operation unit 43. More specifically, the quantization unit 44 rounds the acquired data to a power of 2, and expresses the power of 2 as a power exponent (a power exponent when the base is 2). For example, if the acquired data is “8”, the quantization unit 44 can express the value as 2 3, and thus converts the acquired data “8” into “3” that is a power exponent. Further, the quantization unit 44 represents the data after logarithmic quantization with 4 bits. Specifically, the logarithmically quantized 4-bit data has a power index when the base (base) is 2 or the logquantized data (logarithm quantization target data) is truly zero. Indicates that there is.
  • logarithmic quantized value a value (4-bit data) obtained by logarithmic quantization is referred to as “logarithmic quantized value”.
  • the quantization unit 44 expresses the power exponent using 3 bits out of 4 bits, the upper limit is “7 (0111b)”. In other words, a value larger than 128 (2 7 ) is rounded to “128” by logarithmic quantization processing by the quantization unit 44. In the present disclosure, when a binary number is expressed, b is added after the number.
  • the most significant bit among the 4 bits of the logarithmic quantization value is used as a flag indicating whether or not the logarithmic quantization value is truly zero. Specifically, if the most significant bit is “1”, the logarithmic quantized value is treated as truly indicating zero regardless of the value of other bits. On the other hand, if the most significant bit is “0”, the remaining 3 bits indicate a power exponent. For example, the logarithmic quantization value “1000b” is truly zero. The logarithmic quantized value “0000b” indicates that the power exponent is “0”. The logarithm quantized value “0111b” indicates that the power exponent is “7”.
  • the quantization unit 44 rounds the data to the power of 2, and converts the logarithm quantization target data into a power index or a value indicating whether it is truly zero.
  • the logarithmic quantization in the present disclosure is not limited to the technique disclosed in Non-Patent Document 4 or the above contents.
  • the logarithm quantization value may be data of 4 bits or more.
  • the usage of 4 bits when indicating logarithmically quantized data is not limited to the above. For example, “1111b” among values that can be expressed by 4 bits may be handled as data that truly indicates zero, and the power exponent may be expressed by the remaining numbers (0000b to 1110b).
  • the calculation method used when the logarithmic quantization target data is rounded to a power of 2 is not limited to the above method.
  • the quantization unit 44 may log-quantize the acquired data by setting the base to “2”, calculating the logarithm of the target value for logarithmic quantization, and rounding up after the decimal point.
  • Non-Patent Document 4 when the target value of logarithmic quantization is smaller than a certain value, it is converted into a specific minimum value, and when it is larger than a certain value, it is converted into a specific maximum value. ing. Further, in the logarithmic quantization, the logarithm is calculated when the target value is within a range defined by the specific minimum value and maximum value. The same processing is performed in the present disclosure.
  • the convolution operation unit 43 performs a convolution operation on logarithm-quantized input data and weights. Even if the activation function or the pooling process in each layer is applied, the input data input to the next layer maintains a logarithmically quantized state. For example, if ReLU is used as the activation function, a negative value is converted to “0”, and a positive value (a power index) is output as it is. Parameters that change due to the operation by the pooling layer (before and after pooling) are the sizes W and H of the input data. That is, the operation of the pooling layer does not change the value of the log-quantized input data itself. Therefore, logarithmic quantization of the input data is maintained even if the activation function or the pooling process is executed.
  • FIG. 7 is a diagram illustrating an example of an internal configuration of the convolution operation unit 43.
  • the convolution operation unit 43 includes a convolution operation control unit 201, a weight input / output unit 202, an input data input / output unit 203, a multiplication / addition unit 204, and various storage units.
  • the various storage units include a weight primary storage unit 211, an input data primary storage unit 212, and a calculation result primary storage unit 213.
  • the weight primary storage unit 211 and the input data primary storage unit 212 temporarily store data provided from the weight processing unit 41 and the input data processing unit 42, respectively.
  • the calculation result primary storage unit 213 stores the calculation result (result of one convolution calculation) by the multiplication / addition unit 204.
  • the convolution operation unit 43 performs a convolution operation using the data stored in the input data primary storage unit 212 and the weight stored in the weight primary storage unit 211.
  • the convolution operation control unit 201 is means for controlling the weight input / output unit 202, the input data input / output unit 203, and the multiplication / addition unit 204 to execute a convolution operation using weights and input data (activation).
  • the weight input / output unit 202 executes processing related to weight input / output.
  • the input data input / output unit 203 executes processing related to input / output of input data.
  • the multiplication / addition unit 204 performs multiplication / addition processing of data supplied from each of the weight input / output unit 202 and the input data input / output unit 203, and performs a convolution operation.
  • the convolution operation control unit 201 designates a weight group necessary for executing one convolution operation, and instructs the weight input / output unit 202 to read the weight group (step S01).
  • the convolution operation control unit 201 designates a range of input data for performing the convolution operation with the weight group, and instructs the input data input / output unit 203 to read the input data (step S02).
  • the convolution operation control unit 201 When the acquisition of data in the weight input / output unit 202 and the input data input / output unit 203 is completed, the convolution operation control unit 201 performs a “convolution operation” on the weight input / output unit 202, the input data input / output unit 203, and the multiplication / addition unit 204. An instruction relating to “execution start” is issued (step S03).
  • the weight input / output unit 202 and the input data input / output unit 203 that have received the instruction supply the previously obtained weight group and input data to the multiplication / addition unit 204, respectively.
  • the multiplication / addition unit 204 uses the data supplied from the weight input / output unit 202 and the input data input / output unit 203 to execute multiplication / addition processing related to the convolution calculation (step S04).
  • the configuration and operation of the multiplication / addition unit 204 will be described later in detail.
  • the multiplication / addition unit 204 notifies the convolution calculation control unit 201 of the completion of the convolution calculation (step S05).
  • the multiplication / addition unit 204 stores the result of the convolution operation (the result of one convolution operation) in the operation result primary storage unit 213.
  • the convolution operation control unit 201 determines whether or not the convolution operation using the weight group read out by the weight input / output unit 202 has been completed (step S06). For example, in the above-described example, if the weight group 511 has been read, it is determined whether or not all the convolution operations using the weight group 511 have been completed.
  • step S02 If all the convolution operations using the read weight group have not been completed (if there is input data to be subjected to the convolution operation with the weight group; step S06, No branch), the convolution operation control unit 201 performs step S02. Return to and continue processing. At this time, the convolution calculation control unit 201 instructs the input data input / output unit 203 to read the input data while designating an appropriate range (moves the sliding window and instructs to read the input data).
  • step S06 If all the convolution operations using the read weight groups have been completed (step S06, Yes branch), the convolution operation control unit 201 determines whether the convolution operations using all the weight groups have been completed. Is determined (step S07).
  • step S07 If a weight group that requires a convolution operation remains (step S07, No branch), the convolution operation control unit 201 returns to step S01 and continues the processing. At this time, the convolution operation control unit 201 designates the next weight group and executes a convolution operation using the weight group.
  • step S07, Yes branch If there is no remaining weight group that requires the convolution operation (step S07, Yes branch), the convolution operation control unit 201 ends the process.
  • the convolution operation control unit 201 When the convolution operation is completed, the convolution operation control unit 201 notifies the convolution layer control unit 40 to that effect.
  • the convolution layer control unit 40 that has received the notification determines that the convolution operation in the current layer has been completed, and notifies the subsequent layer (activation function) to that effect.
  • the convolution layer control unit 40 executes the convolution operation of the next layer.
  • FIG. 9 is a diagram illustrating an example of an internal configuration of the multiplication / addition unit 204.
  • multiplication / addition section 204 includes a plurality of shift arithmetic & adders 301-1 to 301-N (N is a positive integer, the same applies hereinafter) and adder 302.
  • shift calculators / adders 301-1 to 301-N when there is no particular reason for distinguishing the shift calculators / adders 301-1 to 301-N, they are simply referred to as “shift calculators / adders 301”.
  • other configurations are represented by the previous numbers separated by hyphens.
  • the shift operation & adder 301 performs a shift operation on the weight corresponding to each element of the channel forming the input data, and adds the result of the shift operation. More specifically, each of the shift calculation & adder 301 acquires input data corresponding to the weight from the weight input / output unit 202 and the input data input / output unit 203. For example, in the example of FIG. 3, the shift operation & adder 301-1 is supplied with input data 601 corresponding to the weight 501. Note that the numbers in parentheses “I (N)” and “W (N)” in FIG. 9 indicate the input data and weight channels supplied to the shift operation & adder 301.
  • Each of the shift arithmetic & adder 301 multiplies the supplied input data and the corresponding elements of the weights, and adds each multiplication result.
  • the shift operation & adder 301 is not a normal integer multiplication process. Multiplication processing is performed by shift operation. That is, the logarithm quantization value is a value indicating that the power exponent or the logarithm quantization value is truly zero. Therefore, if the shift operation & adder 301 shifts the weight to the left by the number of logarithm quantization values, This means that input data multiplication processing has been executed.
  • FIG. 10 is a diagram showing an example of the internal configuration of the shift operation & adder 301.
  • the shift calculator & adder 301 includes a shift calculator 311, an adder 312, and a register 313.
  • a register for temporarily storing the acquired weight and input data and a module (controller) for controlling the weight and input data to be input to the shift calculator 311 are omitted.
  • the shift computing unit 311 shifts the element value of the acquired weight to the left by a number corresponding to the element value (logarithm quantization value; power exponent) of the input data. For example, if the logarithmic quantization value is “0011b”, the obtained weight element value is shifted left by 3 bits and output to the adder 312. The adder 312 adds the value (initial value is zero) stored in the register 313 and the value output from the shift calculator 311, and stores the result in the register 313. If the logarithmic quantized value is “1000b”, the value indicates that the input data is truly zero, so that the input data is not multiplied by a weight (shift operation).
  • the shift operation & adder 301 calculates the left shift of the number corresponding to the element value (that is, logarithm quantization value) of the input data corresponding to each element of the acquired weight, and uses the adder 312 and the register 313. It repeats adding the multiplication result (the result of the left shift operation). The addition result (final holding value of the register 313) by each shift operation & adder 301 is output to the adder 302.
  • the adder 302 adds the addition results acquired from each shift calculation & adder 301 to obtain a calculation result by one convolution calculation.
  • the calculation result is stored in the calculation result primary storage unit 213.
  • the convolution operation unit 43 (multiplication / addition unit 204) realizes the multiplication process executed by the convolution operation by a shift operation according to the element value of each element constituting the acquired input data.
  • the input data processing unit 42 performs a predetermined conversion process on the acquired input data, and converts the input data after conversion into It supplies to the convolution operation part 43.
  • the input data processing unit 42 does not perform special processing and convolves the acquired data. It supplies to the calculating part 43.
  • the input data processing unit 42 has a configuration as shown in FIG. Referring to FIG. 11, the input data processing unit 42 includes an input data acquisition unit 401 and an input data conversion unit 402.
  • the input data acquisition unit 401 accesses the input data storage unit 52 in accordance with an instruction from the convolution layer control unit 40, and acquires data (input data, activation) necessary for the convolution calculation of each layer. At this time, if the layer instructed to acquire data is the first layer, the input data acquiring unit 401 supplies the acquired data to the input data converting unit 402. The input data acquisition unit 401 supplies the acquired data as it is to the convolution operation unit 43 if the layer instructed to acquire the data is the second or later layer.
  • the input data conversion unit 402 allows the convolution operation unit 43 to process the input data used for the first layer convolution operation and the input data logarithmically quantized by the quantization unit 44 in the same manner.
  • FIG. 12 shows input data (3 ⁇ 3 size) for one channel for easy understanding.
  • Each element value of the input data is represented by 8 bits (0 to 255).
  • the input data conversion unit 402 expands one channel included in the first layer of input data to the same number of subchannels as the number of bits of elements constituting the first layer of input data. For example, as shown in FIG. 12, when the element value of the input data is expressed by 8 bits, the input data conversion unit 402 generates eight subchannels CH1-1 to CH1-8.
  • the input data conversion unit 402 converts the digit of the value “1” into the value “1” when the element value is represented by “ It is converted into a value indicating the position (bit position) of the digit “1”. Further, the input data conversion unit 402 converts the digit having a value of 0 into a value indicating that the converted data is truly zero. In this way, the input data conversion unit 402 generates a data string including a plurality of elements from each element of the input data. For example, if the element value of the input data is “13”, the binary number notation is “00001101b”.
  • the input data conversion unit 402 For convenience, if the value indicating true zero is “ ⁇ 1”, the input data conversion unit 402 generates a data string ⁇ 1, ⁇ 1, ⁇ 1, ⁇ 1, 3, 2, ⁇ 1, 0 ⁇ . To do. In the processing of the input data conversion unit 402, the bit position of the least significant bit is set to “0”.
  • the input data conversion unit 402 generates a data string having the bit position of the digit set to “1” or a value indicating true zero as an element by the above processing.
  • the binary bit position included in the data string is treated as a power index when the base is 2 in the multiplier / adder 204. That is, the multiplication / addition unit 204 can handle the data (logarithm quantization value) generated by the quantization unit 44 and the data (conversion value) generated by the input data conversion unit 402 equally.
  • the input data conversion unit 402 assigns each element (bit position, value indicating true zero) forming the above data string to each element of the subchannel generated previously. At this time, the input data conversion unit 402 assigns each element forming the data string to the position of each sub-channel element corresponding to the position of each element of one channel included in the first-layer input data. For example, in FIG. 12, each element of the data string generated from the element located at the upper right of the input data before conversion (element value is 13) is distributed and arranged in the element located at the upper right of the generated subchannel. Is done.
  • the generated data string is ⁇ 1, ⁇ 1, ⁇ 1, ⁇ 1, 3, 2, ⁇ 1, 0 ⁇ . is there.
  • CH1-1 to CH1-8 are generated as subchannels of channel 1 (CH1).
  • the element value of the subchannel CH1-8 is “ ⁇ 1”.
  • the quantization unit 44 logarithmically quantizes the input data with 4 bits, and the true zero is expressed as “1000b”. Therefore, the element value of the subchannel CH1-8 is “1000b” according to the notation. It becomes.
  • the element values of the subchannels CH1-7 to CH-5 are also “1000b”.
  • the element value of the subchannel CH1-4 is “0011b” because the corresponding element value of the data string is “3”.
  • the element value of the subchannel CH1-3 is “0010b”
  • the element value of the subchannel CH1-2 is “1000b”
  • the subchannel CH1-1 is “0000b”.
  • the input data conversion unit 402 generates a corresponding data string by applying the process for generating the data string as described above to all elements of the acquired input data, and converts each element of the data string to each element of the subchannel. assign. Further, the input data conversion unit 402 applies the process for generating the subchannel, the process for generating the data string, and the process for assigning each element of the data string to each element of the subchannel to all channels of the acquired input data. .
  • the operation of the input data conversion unit 402 is summarized as shown in the flowchart of FIG.
  • the input data conversion unit 402 generates, for each channel of input data, a number of subchannels corresponding to the number of bits of each element value forming the input data before conversion (step S101).
  • the input data conversion unit 402 represents each element value of the input data in binary notation, and the number indicating the bit position or the data after logarithmic quantization is true according to the value (0, 1) of each bit.
  • a data string whose elements are numbers indicating zero is generated (step S102).
  • the input data conversion unit 402 assigns each element of the generated data string to each element of the subchannel while maintaining the position of each element of the input data and each element of the subchannel (step S103).
  • the input data conversion unit 402 supplies the subchannel generated as described above to the convolution operation unit 43 as logarithm-quantized input data (activation). For example, when the input data is image data composed of three RGB channels, one channel is expanded to eight subchannels, so that 24 (3 ⁇ 8) channels are convolution operation units 43. To be supplied.
  • each element of the subchannel indicates a power exponent or truly zero
  • multiplication necessary for the convolution operation in the convolution operation unit 43 can be realized by a shift operation.
  • the convolution operation the multiplication results are added after the elements corresponding to the channel and weight are multiplied. Therefore, the convolution operation using the input data before conversion and the convolution using the input data after conversion are performed. The result of the operation is the same.
  • Equation (1) w represents a weight element, and a represents an input data (activation) element.
  • n indicates the order of layers, and suffixes i and j indicate positions of input data, weight width direction, and height direction.
  • x and y indicate the position of the output data.
  • C, S, and R indicate the number of channels and the size of the weight as described above.
  • the input data a is as shown in the following equation (4).
  • L 8.
  • the input data is 3 channels of RGB, (7) and (3) are equivalent if the channel number is 3 ⁇ L.
  • the result of the convolution operation using the input data converted by the input data conversion unit 402 (the subchannel in which each element is a power exponent) is the same as the result of the convolution operation before the data conversion.
  • logarithm quantization value obtained by the logarithmic quantization process of the quantization unit 44 and the conversion value obtained by the conversion process of the input data conversion unit 402 have the same format (format). Is similar and not.
  • the logarithmic quantization processing of the quantizing unit 44 rounds the target data to the power of 2, and expresses the rounded data with a power exponent. Therefore, it is impossible in principle to obtain data before logarithmic quantization from the logarithmic quantization value by the quantizing unit 44. That is, it can be said that the processing by the quantization unit 44 is an irreversible conversion operation.
  • the conversion processing by the input data conversion unit 402 is a process of expressing target data as the sum of powers of 2, and distributing these powers of 2 to a plurality of subchannels. At that time, the input data conversion unit 402 expresses the power of 2 distributed to each subchannel by a power index. Therefore, the value before data conversion can be obtained by restoring the power of 2 from the elements distributed to the subchannels and adding the restoration results. That is, it can be said that the processing by the input data conversion unit 402 is a reversible conversion operation.
  • the weight processing unit 41 copies a predetermined number of the acquired weights and supplies them to the convolution operation unit 43.
  • the weight processing unit 41 supplies the acquired weight to the convolution operation unit 43 without performing special processing. .
  • the weight processing unit 41 has a configuration as shown in FIG. Referring to FIG. 14, the weight processing unit 41 includes a weight acquisition unit 411 and a weight duplication unit 412.
  • the weight acquisition unit 411 accesses the weight storage unit 51 in accordance with an instruction from the convolution layer control unit 40, and acquires weight groups (a plurality of weight groups) necessary for the convolution calculation of each layer. At this time, the weight acquisition unit 411 supplies the acquired weight to the weight duplication unit 412 if the layer instructed to acquire the weight is the first layer. The weight acquisition unit 411 supplies the acquired weight as it is to the convolution operation unit 43 if the layer instructed to acquire the weight is the second or later layer.
  • the weight duplication unit 412 duplicates a predetermined number of weights (weight groups) obtained for the first layer. Specifically, the weight duplication unit 412 inputs the first layer of input data so that the number of weights corresponding to one channel included in the first layer of input data is the same as the number of expanded subchannels. The weight corresponding to one channel included in is duplicated. That is, the weight duplicating unit 412 duplicates the corresponding weight so that the number is equal to the number of subchannels generated by the input data converting unit 402. For example, as described above, when the input data conversion unit 402 generates eight subchannels from one channel, the weight duplication unit 412 duplicates the corresponding weight of the first layer seven times. That is, the weight duplicating unit 412 prepares the same eight weights.
  • the weight duplicating unit 412 maintains the relationship between the input data before the data conversion and the weight and the relationship between the input data after the data conversion (subchannel) and the weight, so that the weight of the first layer is maintained. Duplicate.
  • the convolution operation unit 43 can perform processing uniformly without being aware of the layer of the provided data (input data, weight).
  • FIG. 15 is a diagram illustrating an example of a hardware configuration of the inference apparatus 10.
  • the inference apparatus 10 can be configured by a so-called information processing apparatus (computer), and has the configuration illustrated in FIG.
  • the inference apparatus 10 includes a CPU (Central Processing Unit) 91, a memory 92, an input / output interface 93, a NIC (Network Interface Card) 94 that is a communication unit, and the like that are connected to each other via an internal bus.
  • the configuration shown in FIG. 15 is not intended to limit the hardware configuration of the inference device 10.
  • the inference device 10 may include hardware (not shown).
  • the number of CPUs and the like included in the inference device 10 is not limited to the example illustrated in FIG. 15.
  • a plurality of CPUs may be included in the inference device 10.
  • the memory 92 is a RAM (Random Access Memory), a ROM (Read Only Memory), or an auxiliary storage device (such as a hard disk).
  • the input / output interface 93 is a means to be an interface of a display device and an input device (not shown).
  • the display device is, for example, a liquid crystal display.
  • the input device is a device that accepts user operations such as a keyboard and a mouse, for example.
  • the function of the inference device 10 is realized by the processing module described above.
  • the processing module is realized by the CPU 91 executing a program stored in the memory 92, for example.
  • a part of the processing module (for example, multiplication / addition unit 204) is realized by hardware specialized for a specific application such as FPGA (Field Programmable Gate Array) or ASIC (Application Specific Integrated Circuit) (implemented in hardware). May be.
  • the program can be downloaded via a network or updated using a storage medium storing the program.
  • the processing module may be realized by a semiconductor chip. That is, the function performed by the processing module may be realized by executing software in some kind of hardware.
  • the inference apparatus 10 converts the input data used in the first layer so that the data acquired by the convolution operation unit 43 can be uniformly processed regardless of the layer. To do.
  • the meaning of the conversion of the input data is not changed before and after the conversion, the accuracy of the convolution operation using the input data after the conversion does not deteriorate.
  • the technique disclosed in Non-Patent Document 1 changes the meaning.
  • re-learning of weights is necessary.
  • the meaning of input data does not change, so such re-learning is not performed. It is unnecessary.
  • the input data is a positive integer.
  • the first layer input data may be a negative value or a real number (floating point).
  • the convolution operation circuit can be shared even when these input data are expressed by negative values or floating point numbers.
  • a pre-calculated average value of the entire data set may be subtracted from the input data as pre-processing for convolution calculation.
  • the average values of the RGB three channels of the image R data set average value, G data set average value, and B data set average three values
  • an image obtained by subtracting the three average values from the pixel value of the image data may be used as an input for CNN inference.
  • a ′ x, y, c represents the pixel value after the average value subtraction, and is input data to the CNN.
  • a x, y, c represent pixel values of coordinates (x, y) in each RGB channel c.
  • ave c indicates a data set average value of each channel c.
  • the input data (input pixel value) to the CNN is not always a positive integer, and depending on the average value of the data set, a negative value or floating May be a decimal point (real number). In the configuration described in the first embodiment, these negative values and floating point numbers cannot be handled as they are. Therefore, in the second embodiment, a case will be described in which a process corresponding to the above-described pre-subtraction is executed after the convolution operation of the first layer is completed to share the convolution operation circuit.
  • the first embodiment does not mention the bias added to the input data. This is because the bias to be added to the input data is normally a fixed value (for example, “1”), and even if the bias is added, only the entire input data is shifted and does not affect the operation of the convolution operation.
  • Equation (9) b k is the bias.
  • b 1 k is the bias of the first layer.
  • the first layer bias b 1 k is a fixed value determined in advance at the time of design.
  • the second term on the right side Can is to replace them with a variable b '1 k which depends on k. Further, performed in equation (13), the second term, In other place the third term of -b '1 k + b 1 k bnew 1 k and the convolution operation (pre-subtraction represented by the formula after the substitution (13) The convolution operation can be regarded as equivalent to the equation (9).
  • CNN1 layer of input data Can be made positive. That is, the first term on the right side of Equation (13) is equivalent to the convolution operation using the input data before performing the pre-subtraction performed on a specific data set or the like, and the second and third terms on the right side are new. It can be seen as a bias. This is because the input data of the first layer is processed in the same manner as in the first embodiment (conversion of input data, execution of convolution operation), and then a new bias is added.
  • the input data conversion unit 402 performs the input corresponding to the data conversion by executing a process corresponding to the subtraction process performed in advance after the first layer convolution operation is completed. Data is guaranteed to be a positive integer.
  • FIG. 16 is a diagram illustrating an example of an internal configuration of the convolutional layer execution unit 31a according to the second embodiment. 6 and 16 are different in that a bias changing unit 45 is added between the convolution operation unit 43 and the quantization unit 44.
  • the bias changing unit 45 is configured to be able to acquire the weight stored in the weight storage unit 51 and the input data stored in the input data storage unit 52.
  • the bias change unit 45 changes the bias of data supplied to the quantization unit 44.
  • the bias changing unit 45 supplies the result of the convolution operation to the quantization unit 44 without changing the initial bias when acquiring the result of the convolution operation for the second and subsequent layers.
  • the bias changing unit 45 calculates bnew 1 k and adds it to the result of the convolution operation. More specifically, the bias changing unit 45 calculates the average value ave c of each channel from the input data of the first layer. Thereafter, the bias changing unit 45 multiplies all the elements of the weight group corresponding to the calculated average value ave c and each channel, for calculating the b '1 k by adding the multiplication results. Bias changing unit 45, -b '1 k + b 1 k ( initial bias; predetermined fixed value) is calculated is added to the first layer of the convolution operation result the calculated value as a new bias, The result is supplied to the quantization unit 44.
  • the operation of the bias changing unit 45 can be regarded as a normalization process in which the average of the layer output values is converted to “0” and the variance is converted to “1”.
  • the bias corresponding to the input data of the first layer is converted using the weight corresponding to the input data of the first layer and the input data of the first layer, and the conversion is performed.
  • the bias is added to the result of the first layer convolution operation.
  • the convolution operation of the first layer is executed before executing the pre-subtraction process of the input data, and then the average value of each channel is added (subtracted) with the value related to the pre-subtraction together with the bias.
  • the result of the convolution operation may be a floating point (real number) by the addition process
  • the real value is rounded by the logarithmic quantization process by the quantization unit 44 and converted to an integer.
  • the input data in the second and subsequent layers also become integers, and the convolution operation circuit can be shared.
  • the inference device 10 described in the first embodiment is an exemplification, and is not intended to limit the configuration and operation thereof. Hereinafter, various modifications will be described.
  • the logarithmic quantization process is executed by the convolution layer execution unit 31
  • the logarithmic quantization process may be executed in the pooling layer or the like.
  • the weight processing unit 41 and the input data processing unit 42 illustrated in FIG. 6 may be realized by one module.
  • the weight duplication unit 412 duplicates the weight of the first layer, but the convolution operation unit 43 performs the duplication processing by distinguishing the “layer” for executing the convolution operation. It can also be.
  • the weight input / output unit 202 may supply the same number of the same weights in the first layer to the multiplication / addition unit 204 as many times as necessary.
  • the weight input / output unit 202 may supply the same weight to the multiplication / addition unit 204 continuously eight times.
  • the input data input / output unit 203 detects that the value of the input data is “0”, transmits the fact to the weight input / output unit 202, and the weight corresponding to the input data whose value is “0”. The supply of values may be omitted.
  • the input data input / output unit 203 and the weight input / output unit 202 cooperate to supply the data and the corresponding weight to the multiplication / addition unit 204. You may stop it. As a result, processing in the multiplication / addition unit 204 is reduced, and high-speed convolution calculation can be expected.
  • the range that the logarithm quantized value by the quantizing unit 44 can take and the range that the converted value by the input data converting unit 402 can take is the same.
  • the logarithmic quantized value by the quantizing unit 44 and the converted value by the input data converting unit 402 are values that truly indicate zero or a power exponent of 0 to 7.
  • the range that the logarithm quantization value and the transform value can take may be different.
  • the power exponent included in the logarithmic quantized value may be 0 to 14, and the power exponent included in the converted value may be 0 to 7.
  • the convolution operation unit 43 can uniformly handle the data logarithmically quantized by the quantization unit 44 and the data supplied from the input data conversion unit 402. That is, as long as the convolution operation unit 43 can process two pieces of data in the same manner, the ranges that can be taken by the logarithmic quantized value and the exponent included in the converted value may be different.
  • one convolution operation unit 43 executes one convolution operation in order has been described, but a plurality of convolution operation units 43 may be provided to execute convolution operations in parallel.
  • a plurality of convolution operation units 43 each having the same configuration may be prepared, and each convolution operation unit 43 may execute the convolution operation independently.
  • a certain convolution operation unit 43 may execute a convolution operation related to the weight group 511, and another convolution operation unit 43 may execute a convolution operation related to the weight group 512 simultaneously (in parallel).
  • the element value of logarithm-quantized input data is a positive value
  • the element value of logarithm-quantized input data may be a negative value. That is, not only when the weight is shifted left (the element value of the logarithm quantized input data is a positive value), but also the weight is shifted right (the element value of the logarithm quantized input data is a negative value). Also good. For example, if the element value of the log-quantized input data is “ ⁇ 2”, this value means that the weight value is shifted to the right by 2 bits in the multiplication with the weight.
  • the input data is an integer, but it can be handled even if the input data is described in floating point by preprocessing for the input data and post processing for the convolution operation.
  • a convolution operation circuit can be shared.
  • the bias changing unit 45 calculates the average value ave c of each channel from the input data of the first layer.
  • the average value ave c of each channel is a value that can be pre-calculated once the input data is determined, the average value may be pre-calculated and registered in advance in the register of the bias changing unit 45 or the like.
  • the bias changing unit 45 multiplies the average value ave c calculated in advance by all the elements of the weight group corresponding to each channel, and adds the multiplication results to calculate the b ′ 1 k .
  • the bias changing unit 45 is provided inside the convolutional layer execution unit 31a has been described, but it is needless to say that the bias changing unit 45 may be provided in another location.
  • the bias changing unit 45 may be provided in the convolution operation unit 43 shown in FIG.
  • I is a value that does not depend on the (x, y) coordinates. Strictly speaking, however, the convolution calculation at the position of the image edge performs processing for padding out-of-screen pixels, and the above assumption may not be satisfied. However, in other words, the above assumption is not satisfied only in a special situation of an image edge, and does not have a great influence on the convolution calculation.
  • the present disclosure a circuit sharing method used for convolution calculation has been described by taking an inference device that infers (determines) a result from input data as an example.
  • the input data to the inference device is data to be inferred
  • the input data to the inference unit of the learning device is teacher data, but there is no difference from the viewpoint of “inference”.
  • the learning apparatus can be configured by adding an error back propagation unit for performing error back propagation, a weight update unit for performing weight update, and the like to the reasoning apparatus 10 described above.
  • the error back propagation unit and the weight update unit can be realized by a known algorithm or the like, and a description thereof will be omitted.
  • the input data converter is The reasoning apparatus according to the first aspect, which preferably converts the input data of the first layer while ensuring that the input data before and after conversion are equivalent.
  • the input data converter is The reasoning apparatus according to aspect 2, wherein one channel included in the first layer of input data is expanded to the same number of subchannels as the number of bits of elements constituting the first layer of input data.
  • the input data converter is For each element of one channel included in the input data of the first layer, when the element value is expressed in binary, the digit with a value of 1 is converted to a value indicating the position of the digit with the value of 1, A data string is generated by converting a digit with a value of 0 into a value indicating that the converted data is truly zero, Preferably, the reasoning device according to mode 3, wherein each element forming the data string is assigned to each element of the subchannel.
  • the input data converter is The reasoning apparatus according to mode 4, preferably assigning each element forming the data string to the position of each sub-channel element corresponding to the position of each element of one channel included in the input data of the first layer.
  • An input data storage unit for storing the input data; An input data acquisition unit that accesses the input data storage unit and acquires the input data; The input data acquisition unit When the acquired input data is used in a first layer convolution operation, the acquired input data is supplied to the input data conversion unit, The inference device according to any one of Embodiments 1 to 5, wherein the acquired input data is supplied to the convolution operation unit when the acquired input data is used in a convolution operation in the second and subsequent layers. .
  • [Form 7] Corresponds to one channel included in the first layer input data so that the number of weights corresponding to one channel included in the first layer input data is the same as the number of the extended subchannels.
  • the inference apparatus according to any one of aspects 3 to 5, further comprising a weight duplication unit that duplicates the weight to be performed.
  • a weight storage unit for storing the weight
  • a weight acquisition unit that accesses the weight storage unit and acquires the weight
  • the weight acquisition unit When the acquired weight is used in the first layer convolution operation, the acquired weight is supplied to the weight duplication unit, When the acquired weight is used in a convolution operation in the second and subsequent layers, the acquired weight is supplied to the convolution operation unit, preferably the inference device according to mode 7.
  • the convolution operation unit is: The inference apparatus according to any one of aspects 1 to 8, wherein the multiplication processing executed by the convolution operation is realized by a shift operation according to the element value of each element constituting the acquired input data.
  • the convolution operation unit is: A plurality of shift operations and adders that are provided for each channel forming the input data, perform the shift operation on each element of the channel and the weight corresponding to each element of the channel, and add the results of the shift operation When, An adder for adding the operation results of the plurality of shift operations &adders; and Preferably, the reasoning device according to aspect 9 is configured.
  • the quantization unit rounds the result of the convolution operation to the power of 2, and the value indicating whether the data to be quantized is a power exponent when the base is 2 or the data after quantization is truly zero
  • the inference apparatus according to any one of aspects 1 to 10, wherein [Form 12]
  • the bias corresponding to the input data of the first layer is converted using the input data of the first layer and the weight corresponding to the input data of the first layer, and the converted bias is convolved with the first layer
  • the inference apparatus according to any one of aspects 1 to 11, further comprising a bias changing unit that adds to a result of the calculation.
  • [Form 13] This is the same as the convolution calculation execution method according to the second viewpoint described above.
  • [Form 14] It is as the program which concerns on the above-mentioned 3rd viewpoint. Forms 13 and 14 can be developed like forms 2 to 12 in the same manner as form 1.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Algebra (AREA)
  • Neurology (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Complex Calculations (AREA)
  • Image Analysis (AREA)

Abstract

量子化された入力データを用いた畳み込み演算を実行する回路を各層にて共用する推論装置を提供する。推論装置は、量子化部と、畳み込み演算部と、入力データ変換部と、を備える。量子化部は、入力データと重みを用いた畳み込みニューラルネットワークにおける畳み込み演算の結果を量子化する。畳み込み演算部は、量子化された演算結果を入力データとして用いて畳み込み演算を実行する。入力データ変換部は、畳み込み演算部が1層目の入力データと量子化部により量子化された入力データを同様に処理できるように、1層目の入力データを変換する。

Description

推論装置、畳み込み演算実行方法及びプログラム
 (関連出願についての記載)
 本発明は、日本国特許出願:特願2018-038029号(2018年03月02日出願)の優先権主張に基づくものであり、同出願の全記載内容は引用をもって本書に組み込み記載されているものとする。
 本発明は、推論装置、畳み込み演算実行方法及びプログラムに関する。
 特許文献1及び2に示されるように、多層ニューラルネットワークによる画像認識等に関する技術開発が活発に行われている。このような技術は、深層学習(ディープラーニング)とも称される。とりわけ、画像認識等の技術分野において、畳み込みニューラルネットワークが多く用いられる。畳み込みニューラルネットワークには、後述するように、畳み込み層、プーリング層、全結合層が含まれる。畳み込み層では、カーネルを画像全体に畳み込む処理が行われる。
 画像全体にカーネルを畳み込む処理(画像にフィルタを適用する処理)により、画像に畳み込まれた特徴の集合が得られる。当該特徴の集合は、特徴マップとも称される。特徴マップは、畳み込んだ値に活性化関数を適用することで得られる。例えば、画像認識の分野では、ReLU(Rectified Linear Unit)が活性化関数として用いられることが多い。
 上述のように、畳み込み層では、画像(入力画像)にカーネル(重み、フィルタ)を畳み込む処理が行われる。その際、画像の各画素と重みを乗算する処理が数多く行われる。
 非特許文献1は、BinaryCNN(Convolutional Neural Network)に適した入力画像の1ビット化手法を開示している。当該文献の技術は、CNN推論に用いる画像データが1ビットで表現されることを前提とし、入力信号を取り扱う回路の信号線を分岐することで画像を1ビット化している。非特許文献1に開示された技術では、入力データの持つ意味が変化すると共にCNN推論に使用する重みの再学習が必要となる。
 非特許文献2乃至4は、CNN推論における「量子化」に関する技術を開示している。非特許文献2は、畳み込み演算の結果を2値(Binary)に変換する技術を開示している。非特許文献3は、畳み込み演算の結果を3値(Ternary)に変換する技術を開示している。非特許文献4は、畳み込み演算の結果を4ビットに変換する技術を開示している。
 非特許文献2及び3に開示された技術は、畳み込み演算の結果が取り得る範囲を制限し、再学習してパラメータを決定する。対して、非特許文献4に開示された技術は、畳み込み演算の結果(整数、浮動小数点等)を2の冪乗に丸め込む。本願開示において、非特許文献4に開示された畳み込み演算の結果を2の冪乗に丸め込む量子化を「対数量子化」と表記する。
特開2017-211735号公報 特許第6183980号公報
M. Shimoda, S. Sato, and H. Nakahara、"All Binarized Convolutional Neural Network and Its implementation on an FPGA"、The International Conference on Field-Programmable Technology (FPT 2017)、2017 Matthieu Courbariaux, etc、"Binarized Neural Networks: Training Neural Networks with Weights and Activations Constrained to +1 or -1"、2018年1月24日、[online]、[平成30年1月24日検索]、インターネット〈URL:https://arxiv.org/pdf/1602.02830〉 Fengfu Li and Bo Zhang, etc、"Ternary weight networks"、2018年1月24日、[online]、[平成30年1月24日検索]、インターネット〈URL:https://arxiv.org/pdf/1605.04711〉 Daisuke Miyashita, etc、"Convolutional Neural Networks using Logarithmic Data Representation"、2018年1月24日、[online]、[平成30年1月24日検索]、インターネット〈URL:https://arxiv.org/pdf/1603.01025〉
 なお、上記先行技術文献の各開示を、本書に引用をもって繰り込むものとする。以下の分析は、本発明者らによってなされたものである。
 上述のように、深層学習、とりわけ、畳み込み層の演算では膨大な数の乗算処理が必要となる。膨大な乗算処理は、大規模なハードウェアを要求したり、強力な演算処理能力を有するプロセッサを要求したりする。そのため、ハードウェアの規模を抑えつつ、或いは、演算処理能力が低いプロセッサを用いたとしても、畳み込み層の演算を現実的な時間内で終了させるために非特許文献1乃至4に開示されたような技術が必要となる。
 特に、特許文献4に開示された技術では、畳み込み演算における乗算対象である入力データを2の冪乗に丸め込み、当該丸め込まれた入力データと重みの乗算処理を1回のシフト演算として実行する。その結果、畳み込み演算に要する乗算の回数が減少し、畳み込み演算を実行するためのハードウェア規模の抑制が可能となる。
 このように、入力データを対数量子化し、2の冪乗に丸め込むことで乗算回数の削減等の利点が生じる。ここで、非特許文献4等に開示された技術に関し、発明者らが鋭意検討した結果、一度も畳み込み演算が適用されていない1層目の入力データを対数量子化してしまうと、認識精度が低下することが判明した。そのため、非特許文献4に開示されたような対数量子化は、2層目以降の入力データに適用することを前提とすると言える。
 換言すれば、初段(1層目)の入力データを対数量子化し、畳み込み演算を行うことはできない。つまり、1層目の畳み込み演算における乗算処理を1回のシフト演算で完了させることはできない。具体的には、1層目の畳み込み演算に限っては、被乗数に乗数の最下位の数を掛けて、次に、被乗数に乗数の次の桁を掛けた結果を、桁をずらして足し込む処理を繰り返し行う必要がある(通常の整数乗算が必要である)。即ち、2層目以降の入力データを対数量子化し畳み込み演算の乗算をシフト演算により簡略化したとしても、当該利益を享受できるのは2層目以降の畳み込み演算に限られ、1層目の畳み込み演算については2進数での筆算を繰り返す必要がある。
 上記事実は、2層目以降の畳み込み演算を実行する回路(シフト演算による乗算器)とは別に1層目の畳み込み演算を実行する回路(整数乗算器)が必要であることを意味する。しかし、畳み込み演算の処理内容(アルゴリズム)は層によって異なるものではなく、処理の異なる回路を複数用意することは、FPGA(Field Programmable Gate Array)等のリソースを有効利用できているとは言えない。あるいは、異なる回路を複数用意することは、規模の大きいFPGA等が必要となり消費電力やコストに対する影響が大きい。
 本発明は、量子化された入力データを用いた畳み込み演算を実行する回路を各層にて共用することに寄与する、推論装置、畳み込み演算実行方法及びプログラムを提供することを主たる目的とする。
 本発明乃至開示の第1の視点によれば、入力データと重みを用いた畳み込みニューラルネットワークにおける畳み込み演算の結果を量子化する、量子化部と、前記量子化された演算結果を入力データとして用いて畳み込み演算を実行する、畳み込み演算部と、前記畳み込み演算部が1層目の入力データと前記量子化部により量子化された入力データを同様に処理できるように、前記1層目の入力データを変換する、入力データ変換部と、を備える、推論装置が提供される。
 本発明乃至開示の第2の視点によれば、入力データと重みを用いた畳み込みニューラルネットワークにおける畳み込み演算の結果を量子化する、量子化部と、前記量子化された演算結果を入力データとして用いて畳み込み演算を実行する、畳み込み演算部と、を備える推論装置において、前記入力データを取得するステップと、前記取得した入力データが1層目の畳み込み演算で使用される場合には、前記畳み込み演算部が前記1層目の入力データと前記量子化部により量子化された入力データを同様に処理できるように、前記1層目の入力データを変換する、ステップと、を含む、畳み込み演算実行方法が提供される。
 本発明乃至開示の第3の視点によれば、入力データと重みを用いた畳み込みニューラルネットワークにおける畳み込み演算の結果を量子化する、量子化部と、前記量子化された演算結果を入力データとして用いて畳み込み演算を実行する、畳み込み演算部と、を備える推論装置に搭載されたコンピュータに、前記入力データを取得する処理と、前記取得した入力データが1層目の畳み込み演算で使用される場合には、前記畳み込み演算部が前記1層目の入力データと前記量子化部により量子化された入力データを同様に処理できるように、前記1層目の入力データを変換する、処理と、を実行させるプログラムが提供される。
 なお、このプログラムは、コンピュータが読み取り可能な記憶媒体に記録することができる。記憶媒体は、半導体メモリ、ハードディスク、磁気記録媒体、光記録媒体等の非トランジェント(non-transient)なものとすることができる。本発明は、コンピュータプログラム製品として具現することも可能である。
 本発明乃至開示の各視点によれば、量子化された入力データを用いた畳み込み演算を実行する回路を各層にて共用することに寄与する推論装置、畳み込み演算実行方法及びプログラムが提供される。
一実施形態の概要を説明するための図である。 画像認識における中間層(隠れ層)の構造を説明するための図である。 畳み込み層における演算を説明するための図である。 第1の実施形態に係る推論装置の内部構成の一例を示す図である。 第1の実施形態に係る推論装置に含まれる中間層実行部の内部構成の一例を示す図である。 第1の実施形態に係る畳み込み層実行部の内部構成の一例を示す図である。 第1の実施形態に係る畳み込み演算部の内部構成の一例を示す図である。 第1の実施形態に係る畳み込み演算部の動作の一例を示すフローチャートである。 第1の実施形態に係る乗加算部の内部構成の一例を示す図である。 第1の実施形態に係るシフト演算&加算器の内部構成の一例を示す図である。 第1の実施形態に係る入力データ処理部の内部構成の一例を示す図である。 入力データ変換部の動作を説明するための図である。 第1の実施形態に係る入力データ変換部の動作を説明するためのフローチャートである。 第1の実施形態に係る重み処理部の内部構成の一例を示す図である。 第1の実施形態に係る推論装置のハードウェア構成の一例を示す図である。 第2の実施形態に係る畳み込み層実行部の内部構成の一例を示す図である。
 初めに、一実施形態の概要について説明する。なお、この概要に付記した図面参照符号は、理解を助けるための一例として各要素に便宜上付記したものであり、この概要の記載はなんらの限定を意図するものではない。また、各図におけるブロック間の接続線は、双方向及び単方向の双方を含む。一方向矢印については、主たる信号(データ)の流れを模式的に示すものであり、双方向性を排除するものではない。さらに、本願開示に示す回路図、ブロック図、内部構成図、接続図などにおいて、明示は省略するが、入力ポート及び出力ポートが各接続線の入力端及び出力端のそれぞれに存在する。入出力インターフェイスも同様である。
 一実施形態に係る推論装置100は、量子化部101と、畳み込み演算部102と、入力データ変換部103と、を備える(図1参照)。量子化部101は、入力データと重みを用いた畳み込みニューラルネットワークにおける畳み込み演算の結果を量子化する。畳み込み演算部102は、量子化された演算結果を入力データとして用いて畳み込み演算を実行する。入力データ変換部103は、畳み込み演算部102が1層目の入力データと量子化部101により量子化された入力データを同様に処理できるように、1層目の入力データを変換する。
 上記推論装置100は、畳み込み演算における乗算処理がシフト演算により実現できるように構成されている。より具体的には、畳み込み演算部102は、取得した重みを入力データに相当する数左シフトすれば畳み込み演算の乗算処理が完了するように構成されている。入力データ変換部103は、当該畳み込み演算部102を層によらず使用可能とするため、入力データを変換する。その結果、量子化された入力データを用いた畳み込み演算を実行する回路(畳み込み演算部102)を各層にて共用できる。
 以下に具体的な実施の形態について、図面を参照してさらに詳しく説明する。なお、各実施形態において同一構成要素には同一の符号を付し、その説明を省略する。
[第1の実施形態]
 第1の実施形態について、図面を用いてより詳細に説明する。
 図2は、画像認識における中間層(隠れ層)の構造を説明するための図である。図2を参照すると、入力層と中間層が接続され、中間層と出力層が接続される。なお、第1の実施形態では、入力層に入力されるデータは画像データを想定している。但し、本願開示にて取り扱う入力データは画像データに限定されないことは勿論である。
 入力層は、取得した入力データから中間層に出力するためのデータを作成する。例えば、画像データがRGB(Red Green Blue)の3チャネルから構成されている場合には、入力層は、各色の画像データを生成し、中間層に出力する。中間層は、畳み込みニューラルネットワーク(CNN(Convolutional Neural Network))により入力データの特徴部分が抽出されたデータを1つのノードに結合し、特徴変数を出力する。出力層は、中間層から取得した特徴変数に基づき、入力データを分類する。
 中間層には、複数の「層(レイヤ)」が含まれ、初段の層が入力層と接続され、最終段の層は全結合層と接続されている。
 中間層をなす各層には、畳み込み層、活性化関数、プーリング層が含まれ得る。なお、図2に示す構成は例示であり、中間層の構成を限定する趣旨ではない。場合によっては、中間層に活性化関数、プーリング層が含まれていなくともよい。
 畳み込み層は、取得した入力データから特徴量を抽出する。当該抽出された特徴量には活性化関数が適用され、当該活性化関数が適用された後の特徴量がプーリング層に入力される。プーリング層では、取得した特徴量を結合する。その際、プーリング層では、物体の位置が変動しても同一の物体と判断できるようにするための処理(不変性を得るための処理)が行われる。例えば、対象物の位置ずれを許容するための処理がプーリング層にて行われる。なお、図2では、「活性化関数」を適用するための層が、畳み込み層やプーリング層と独立した形で記載されているが、実際には、「活性化関数」が畳み込み層及びプーリング層のいずれかの層に含まれる構成であってもよい。
 図2に示すように、中間層をなす各層は、縦続接続されており、前段の層の出力が後段の層の入力に相当する。
 図3は、畳み込み層における演算を説明するための図である。図3を参照すると、畳み込み層は、入力データと重み(フィルタ)を乗算することで、特徴量を出力する。
 なお、本願開示にて使用する各種パラメータは図3に図示するように定める。入力データにおける一の方向(図3では縦方向)のサイズを「H」と表記する。また、入力データにおける他の方向(図3では幅方向)のサイズを「W」と表記する。例えば、H=25、W=25であれば、H×W=625個の画素が入力データのサイズとなる。さらに、層の入力チャネル数を「C」と表記する。
 重みにおける一の方向(図3では縦方向)のサイズを「R」と表記する。また、重みにおける他の方向(図3では幅方向)のサイズを「S」と表記する。例えば、R=3、S=3とすれば、R×S=9が重みのサイズである。
 図3に示す「K」は層の出力チャネル数である。層の出力チャネル数Kと重みの種類数は一致する。例えば、図3に示す重みの種類数が「4」であれば、層の出力チャネル数Kも「4」となる。
 1種類の重みには、入力チャネル数Cと同じ数の重みが含まれる。例えば、入力チャネル数Cが「3」であれば、1種類の重みには3つの重みが含まれる。1種類の重みに含まれるC個の重みは、C個の入力データそれぞれと対応付けられている。例えば、図3において、上段のC個の重みにおいて、一番手前の重みは一番手前の入力データと対応付けられている。
 なお、本願開示において、入力チャネル数Cごとに区分された重みの集合を「重み群」と表記する。各重み群には、C個の重みが含まれる。また、重みの種類数は出力チャネル数Kに一致するので、畳み込み層における重みの数は、K×C個となる。さらに、本願開示において、一の入力データや一の重みを基準として他の入力データや重みに向かう方向を「チャネル方向」と表記する。同様に、一の重み群を基準として他の重み群に向かう方向を「カーネル方向」と表記する。例えば、図3に示す重み501から重み502に向かう方向がチャネル方向であり、重み群511から重み群512に向かう方向がカーネル方向である。
 畳み込み層では、入力データから重みのサイズに相当するデータを抽出し、当該抽出した入力データに含まれる要素と重みの対応する要素を乗算し、且つ、乗算結果をチャネル方向に加算する処理が実行される。例えば、図3に示すように、重みのサイズが3×3=9であれば、入力データから同じサイズのデータ(例えば、図3の一番手前に図示した入力データのうち四角の領域で囲まれた入力データ601)が抽出される。その後、抽出された入力データの各要素と対応する重みの各要素が乗算される。例えば、図3の例では、抽出された入力データ601における左上の要素値「1」と対応する重み501の左上の要素値「1」が乗算される。畳み込み層では、このような処理が繰り返される(上述の例では9回繰り返される)。その後、乗算結果は加算される。
 抽出された入力データと重みの乗算は、対応する入力データと重みの間で実行される。例えば、図3において、一番手前に図示した入力データ601に対応する重みは一番手前に図示された重み501とする。同様に、中間に図示した入力データに対応する重みが中間に図示した重み、最奥に図示した入力データに対応する重みが最奥に図示した重み502である。この場合、対応する入力データと重みの間で上記乗加算処理が繰り返される。
 さらに、上記乗加算処理の結果は、チャネル方向にて加算される。例えば、上述の例では、3チャネル(一番手前、中間、最奥)における乗加算結果が加算される。
 上記乗加算処理及びその後の加算処理は、重み群ごとに行われる。図3の例では、上段に図示した重み群511と入力データを用いた演算が行われ、下段に図示した重み群512に関しても同様の処理(同じ入力データを用いた乗加算処理及びその後の加算処理)が実行される。
 畳み込み層では、上記処理(乗加算処理及びチャネル方向への加算処理)を、抽出する入力データを変更しながら繰り返す。例えば、図3の一番手前の入力データに図示するように、抽出する領域をスライドさせながら入力データを切り出していく。当該切り出されたデータには、上記と同様の処理が適用される。
 上述のような入力データの抽出と、当該抽出された入力データに重みを乗算し、チャネル方向に加算する処理を繰り返すことで畳み込み層の出力データが得られる。なお、上述のように、入力データと重みの乗加算処理は重み群ごとに実行されるため、得られる出力データの数と重みの種類(重み群の数)は一致する。例えば、16個の重み群が用意されていれば、16個の出力データが得られる(K=16)。
 なお、各出力データのサイズ(縦方向のサイズ、幅方向のサイズ)は、入力データからデータを抽出する際の領域(ウィンドウ)をスライドする際の仕様により定まる。図3の例では、各出力データには、12(4×3)個の要素が含まれるように、入力データからデータが抽出される。
 第1の実施形態に係る推論装置10は、図3を用いて説明した畳み込み演算を推論の過程にて実行する。具体的には、図4に示すように、推論装置10は、その内部に、入力層を実現する入力層実行部11、中間層を実現する中間層実行部12、出力層を実現する出力層実行部13と、を含む。さらに、中間層実行部12には、畳み込み層を実現する畳み込み層実行部31、活性化関数を実行する活性化関数実行部32及びプーリング層を実現するプーリング層実行部33が各層に含まれる(図5参照)。
 本願開示においては、図4及び図5に示す各種実行部のうち、畳み込み層実行部31について詳細に説明する。他の実行部に関しては、公知のアルゴリズム等により実現可能であるため、その説明を省略する。
 畳み込み層実行部31は、図3を用いて説明した畳み込み演算(乗加算処理)を実行する。
 図6は、畳み込み層実行部31の内部構成の一例を示す図である。図6を参照すると、畳み込み層実行部31には、畳み込み層制御部40と、重み処理部41と、入力データ処理部42と、畳み込み演算部43と、量子化部44と、各種記憶部と、が含まれている。各種記憶部には、重み記憶部51と、入力データ記憶部52と、演算結果記憶部53と、が含まれる。
 入力データ記憶部52、重み記憶部51には各層の畳み込み演算に必要なデータ(入力データ、重み)が格納されている。畳み込み層実行部31では、重み及び入力データを用いた畳み込みニューラルネットワークにおける畳み込み演算が実行され、その結果が演算結果記憶部53に格納される。演算結果記憶部53に格納された畳み込み演算の結果は、活性化関数実行部32に引き渡される。また、プーリング層実行部33により処理された結果は、入力データ記憶部52に格納され、畳み込み層実行部31にて畳み込み演算が再び実行される。
 畳み込み層制御部40は、畳み込み層実行部31の全体を制御する手段である。畳み込み層制御部40は、畳み込み演算を各種モジュール(畳み込み演算部43等)を制御することで実現する。
 各層における畳み込み演算に利用する重みは、重み記憶部51に格納されている。重み記憶部51は、各層にて使用する複数の重み群を層ごとに区分して記憶する。重み記憶部51に記憶される重みは、推論装置10の動作前に予め設定されていてもよいし、上位装置(例えば、学習装置)から都度重みを受け取り、重み記憶部51に格納してもよい。
 入力データ記憶部52は、畳み込み演算に使用する入力データを記憶する。より正確には、当初の入力データ記憶部52には1層目の畳み込み演算に用いる入力データが格納される。1層目の層で実行する他の処理(活性化処理、プーリング処理)が終了すると、入力データ記憶部52には、2層目の畳み込み演算に用いる入力データ(アクティベーション)が格納される。
 重み処理部41は、畳み込み層制御部40からの指示に応じて、重み記憶部51にアクセスし、各層の畳み込み演算に適した(各層の畳み込み演算に使用する)重み群を取得する。
 入力データ処理部42は、畳み込み層制御部40からの指示に応じて、入力データ記憶部52にアクセスし、各層の畳み込み演算に使用する入力データを取得する。
 畳み込み演算部43は、重み処理部41及び入力データ処理部42から提供される重み及びデータ(入力データ、アクティベーション)を用いて畳み込み演算を実行する。詳細は後述するが、畳み込み演算部43は、量子化部44により対数量子化された入力データ(アクティベーション)を用いて畳み込み演算を実行するように構成されている。さらに、畳み込み演算部43は、量子化部44により対数量子化されたデータだけでなく、1層目の入力データに関しても2層目以降の入力データ(対数量子化された入力データ)と同様に処理する。畳み込み演算部43は、畳み込み演算の結果を量子化部44に出力する。
 量子化部44は、非特許文献4に開示されたように、畳み込み演算部43による畳み込み演算の結果を対数量子化する。より具体的には、量子化部44は、取得したデータを2の冪乗に丸め込み、当該2の冪乗を冪指数(底を2とした場合の冪指数)で表現する。例えば、量子化部44は、取得したデータが「8」であれば、当該値は2と表現できるので、取得したデータ「8」を冪指数である「3」に変換する。また、量子化部44は、対数量子化後のデータを4ビットで表現する。具体的には、対数量子化された4ビットのデータは、底(基数)を2とした場合の冪指数、又は、対数量子化されたデータ(対数量子化対象のデータ)が真にゼロであることを示す。
 なお、本願開示においては、上記4ビットのうち、1ビットは対数量子化されたデータが真にゼロを意味するのか、冪指数を意味するのかを明示するための情報に割り当てられる。また、上記4ビットのうち、3ビットを使って冪指数を表現する。なお、以降の説明において、対数量子化により得られる値(4ビットのデータ)を「対数量子化値」と表記する。
 量子化部44は、例えば、底を「2」に設定して対数量子化の対象値の対数を計算し、小数点以下を切り捨てることで、取得したデータを対数量子化する。例えば、対数量子化対象の値が「4」であれば、値「4」は「2」に対数量子化される(Log8=2)。また、対数量子化対象の値が「9」であれば、値「9」は「3」に対数量子化される(Log9=3.169;小数点以下切り捨てにより「3」)。なお、上述したように、量子化部44は、4ビットのうち3ビットを用いて冪指数を表現するので、その上限は「7(0111b)」となる。換言すれば、128(2)よりも大きな値は、量子化部44による対数量子化処理により「128」に丸め込まれることになる。なお、本願開示において、2進数を表現する場合には数字の後にbを付与する。
 本願開示では、対数量子化値の4ビットのうち、最上位のビットは対数量子化値が真にゼロか否かを示すフラグとして用いる。具体的には、当該最上位ビットが「1」であれば、他のビットの値によらず対数量子化値は真にゼロを示すものとして扱われる。対して、最上位ビットが「0」であれば、残りの3ビットは冪指数を示す。例えば、対数量子化値「1000b」は真にゼロを示す。対数量子化値「0000b」は冪指数が「0」を示す。対数量子化値「0111b」は冪指数が「7」を示す。
 このように、量子化部44は、データを2の冪乗に丸め込み、対数量子化対象のデータを冪指数又は真にゼロであるかを示す値に変換する。なお、本願開示における対数量子化は、非特許文献4に開示された手法や上記内容に限定されない。例えば、対数量子化値は4ビット以上のデータであってもよい。また、対数量子化されたデータを示す際の4ビットの使い方も上記内容に限定されない。例えば、4ビットで表現できる値のうち「1111b」をデータが真にゼロを示すものと扱い、残りの数字(0000b~1110b)にて冪指数を表現してもよい。さらに、対数量子化対象のデータを2の冪乗に丸め込む際の計算方法も上記方法に限定されない。例えば、量子化部44は、底を「2」に設定して対数量子化の対象値の対数を計算し、小数点以下を切り上げることで、取得したデータを対数量子化してもよい。
 なお、非特許文献4に開示された対数量子化では、対数量子化の対象値が一定の値より小さい場合には特定の最小値に、一定の値より大きければ特定の最大値にそれぞれ変換している。さらに、当該対数量子化では、対象値が上記特定の最小値、最大値より規定される範囲内の場合にその対数を計算している。本願開示においても、同様の処理を行うものとする。
 続いて、図6に示す畳み込み演算部43、入力データ処理部42、重み処理部41の詳細な説明を行う。
[畳み込み演算部]
 畳み込み演算部43は、対数量子化された入力データと重みの畳み込み演算を実行する。なお、各層における活性化関数やプーリング処理が適用されたとしても、次段の層に入力される入力データは対数量子化された状態を維持する。例えば、活性化関数としてReLUを用いれば、負の値は「0」に変換され、正の値(冪指数)はそのまま出力される。また、プーリング層による動作(プーリング前後)により変化するパラメータは入力データのサイズW、Hである。つまり、プーリング層による動作では、対数量子化された入力データの値それ自体が変化することはない。従って、活性化関数やプーリング処理が実行されても入力データの対数量子化は維持される。
 図7は、畳み込み演算部43の内部構成の一例を示す図である。図7を参照すると、畳み込み演算部43は、畳み込み演算制御部201と、重み入出力部202と、入力データ入出力部203と、乗加算部204と、各種記憶部が含まれる。各種記憶部には、重み一次記憶部211と、入力データ一次記憶部212と、演算結果一次記憶部213と、が含まれる。
 重み一次記憶部211、入力データ一次記憶部212のそれぞれは、重み処理部41、入力データ処理部42から提供されるデータを一時的に記憶する。また、演算結果一次記憶部213は、乗加算部204による演算結果(1回の畳み込み演算の結果)を記憶する。
 畳み込み演算部43は、入力データ一次記憶部212に格納されたデータと、重み一次記憶部211に格納された重みを用いて畳み込み演算を実行する。
 畳み込み演算制御部201は、重み入出力部202、入力データ入出力部203、乗加算部204を制御して重みと入力データ(アクティベーション)を用いた畳み込み演算を実行する手段である。
 重み入出力部202は、重みの入出力に関する処理を実行する。
 入力データ入出力部203は、入力データの入出力に関する処理を実行する。
 乗加算部204は、重み入出力部202及び入力データ入出力部203のそれぞれから供給されるデータの乗加算処理を実行し、畳み込み演算を行う。
 次に、図8を参照しつつ、畳み込み演算部43の動作概略を説明する。
 畳み込み演算制御部201は、1回の畳み込み演算の実行に必要な重み群を指定し、当該重み群の読み出しを重み入出力部202に指示する(ステップS01)。
 次に、畳み込み演算制御部201は、上記重み群との間で畳み込み演算を実行する入力データの範囲を指定し、当該入力データの読み出しを入力データ入出力部203に指示する(ステップS02)。
 例えば、図3を参照すると、重み群511と対応する入力データ611の畳み込み演算(1回の畳み込み演算)の実行が指示される。当該畳み込み演算により、図3の一番手前の出力データをなす各要素のうち左上の「1」が得られる。この場合、畳み込み演算制御部201は、重み入出力部202に対して、重み群511の読み出しを指示する。同様に、畳み込み演算制御部201は、入力データ入出力部203に対して、対応する入力データ611の読み出しを指示する。
 重み入出力部202、入力データ入出力部203におけるデータの取得が完了すると、畳み込み演算制御部201は、重み入出力部202、入力データ入出力部203及び乗加算部204に対して「畳み込み演算実行開始」に係る指示を行う(ステップS03)。
 当該指示を受信した重み入出力部202、入力データ入出力部203はそれぞれ、先に取得した重み群、入力データを乗加算部204に供給する。
 乗加算部204は、重み入出力部202、入力データ入出力部203から供給されるデータを用いて畳み込み演算に係る乗加算処理を実行する(ステップS04)。なお、乗加算部204の構成及びその動作の詳細は後述する。
 乗加算部204は、畳み込み演算が終了するとその旨を畳み込み演算制御部201に通知する(ステップS05)。また、乗加算部204は、畳み込み演算の結果(1回分の畳み込み演算の結果)を演算結果一次記憶部213に格納する。
 上記通知を受けた畳み込み演算制御部201は、重み入出力部202にて読み出した重み群を用いた畳み込み演算が終了したか否かを判定する(ステップS06)。例えば、上述の例では、重み群511が読み出されていれば、当該重み群511を用いた全ての畳み込み演算が終了しているか否かが判定される。
 読み出された重み群を用いた全ての畳み込み演算が終了していなければ(重み群と畳み込み演算する入力データが残っていれば;ステップS06、No分岐)、畳み込み演算制御部201は、ステップS02に戻り処理を継続する。その際、畳み込み演算制御部201は、適切な範囲を指定しつつ入力データ入出力部203に入力データの読み出しを指示する(スライディングウィンドウを移動して入力データの読み出しを指示する)。
 読み出された重み群を用いた全ての畳み込み演算が終了していれば(ステップS06、Yes分岐)、畳み込み演算制御部201は、全ての重み群を用いた畳み込み演算が終了しているか否かを判定する(ステップS07)。
 畳み込み演算が必要な重み群が残っていれば(ステップS07、No分岐)、畳み込み演算制御部201は、ステップS01に戻り処理を継続する。その際、畳み込み演算制御部201は、次の重み群を指定し、当該重み群を用いた畳み込み演算を実行する。
 畳み込み演算が必要な重み群が残っていなければ(ステップS07、Yes分岐)、畳み込み演算制御部201は、処理を終了する。
 畳み込み演算制御部201は、畳み込み演算が終了すると、その旨を畳み込み層制御部40に通知する。当該通知を受信した畳み込み層制御部40は、現在の層における畳み込み演算は終了したものと判断し、その旨を後段の層(活性化関数)に通知する。また、プーリング層実行部33による処理が終了すると、畳み込み層制御部40は、次の層の畳み込み演算を実行する。
 次に、乗加算部204について説明する。図9は、乗加算部204の内部構成の一例を示す図である。図9を参照すると、乗加算部204は、複数のシフト演算&加算器301-1~301-N(Nは正の整数、以下同じ)と、加算器302と、を含んで構成される。なお、以降の説明において、シフト演算&加算器301-1~301-Nを区別する特段の理由がない場合には、単に「シフト演算&加算器301」と表記する。他の構成についても同様に、ハイフンで区切られた前の数字にて当該構成を代表して表記する。
 シフト演算&加算器301は、入力データをなすチャネルごとに設けられる。より具体的には、シフト演算&加算器301は、畳み込み層実行部31にて取り扱うチャネル数と同じ数用意される。例えば、深層学習の画像応用において代表的なモデルであるVGG(Visual Geometry Group)16においては最終的なチャネル数は「512」となる。この場合、512個のシフト演算&加算器301が用意される(N=512)。
 シフト演算&加算器301は、入力データをなすチャネルの各要素と対応する重みに関するシフト演算を実行し、シフト演算の結果を加算する。より具体的には、シフト演算&加算器301のそれぞれは、重み入出力部202及び入力データ入出力部203から重みと対応する入力データを取得する。例えば、図3の例では、シフト演算&加算器301-1には、重み501と対応する入力データ601が供給される。なお、図9における「I(N)」や「W(N)」の括弧内の数字は、シフト演算&加算器301に供給される入力データと重みのチャネルを示している。
 シフト演算&加算器301のそれぞれは、供給された入力データと重みの対応する要素同士を乗算し、各乗算結果を加算する。その際、供給される入力データは、対数量子化されているので(入力データは底を2とした場合の冪指数であるので)、シフト演算&加算器301は、通常の整数乗算処理ではなく、シフト演算により乗算処理を行う。つまり、対数量子化値は、冪指数又は対数量子化値が真にゼロを示す値であるので、シフト演算&加算器301は、対数量子化値の数だけ重みを左シフトすれば、重みと入力データの乗算処理を実行したことになる。
 図10は、シフト演算&加算器301の内部構成の一例を示す図である。図10を参照すると、シフト演算&加算器301は、シフト演算器311と、加算器312と、レジスタ313と、を含んで構成される。なお、図10において、取得した重みや入力データを一時的に格納するレジスタや、シフト演算器311に投入する重みや入力データを制御するモジュール(コントローラ)の図示は省略している。
 シフト演算器311は、取得した重みの要素値を入力データの要素値(対数量子化値;冪指数)に相当する数左シフトする。例えば、対数量子化値が「0011b」であれば取得した重みの要素値を3ビット左シフトして加算器312に出力する。加算器312は、レジスタ313に格納された値(初期値はゼロ)とシフト演算器311が出力する値を加算し、その結果をレジスタ313に格納する。なお、対数量子化値が「1000b」であれば、当該値は入力データは真にゼロであることを示すので、当該入力データと重みの乗算(シフト演算)は行わない。
 シフト演算&加算器301は、取得した重みの各要素を対応する入力データの要素値(即ち、対数量子化値)に相当する数の左シフトを計算し、加算器312及びレジスタ313を用いて乗算結果(左シフト演算の結果)を加算することを繰り返す。各シフト演算&加算器301による加算結果(レジスタ313の最終的な保持値)は、加算器302に出力される。
 加算器302は、各シフト演算&加算器301から取得した加算結果を加算し、1回の畳み込み演算による演算結果とする。当該演算結果は、演算結果一次記憶部213に格納される。
 このように、畳み込み演算部43(乗加算部204)は、畳み込み演算にて実行する乗算処理を、取得した入力データをなす各要素の要素値に応じたシフト演算により実現する。
[入力データ処理部]
 図6に説明を戻す。入力データ処理部42は、入力データ記憶部52から取得したデータが1層目で使用されるものである場合には、当該取得した入力データに所定の変換処理を施し、変換後の入力データを畳み込み演算部43に供給する。一方、入力データ処理部42は、入力データ記憶部52から取得したデータ(アクティベーション)が2層目以降で使用されるものである場合には、特段の処理を行わず、取得したデータを畳み込み演算部43に供給する。
 上記機能を実現するため、入力データ処理部42は、図11に示すような構成を備える。図11を参照すると、入力データ処理部42は、入力データ取得部401と、入力データ変換部402と、を含んで構成される。
 入力データ取得部401は、畳み込み層制御部40からの指示に応じて、入力データ記憶部52にアクセスし、各層の畳み込み演算に必要なデータ(入力データ、アクティベーション)を取得する。その際、入力データ取得部401は、データの取得を指示された層が1層目であれば、取得したデータを入力データ変換部402に供給する。入力データ取得部401は、データの取得を指示された層が2層目以降であれば、取得したデータをそのまま畳み込み演算部43に供給する。
 入力データ変換部402は、畳み込み演算部43が、1層目の畳み込み演算に使用する入力データと量子化部44により対数量子化された入力データを同様に処理できるように、当該1層目の入力データを変換する手段である。より具体的には、入力データ変換部402は、変換前後の入力データが等価であることを担保しつつ、1層目の入力データを変換する。
 図12を参照しつつ、入力データ変換部402による変換処理を具体的に説明する。図12には、理解の容易のため、1チャネル分の入力データ(3×3のサイズ)を図示している。また、入力データの各要素値は8ビット(0~255)により表現されるものとする。
 初めに、入力データ変換部402は、1層目の入力データに含まれる一のチャネルを、1層目の入力データをなす要素のビット数と同数のサブチャネルに拡張する。例えば、図12に示すように、入力データの要素値が8ビットで表現されている場合には、入力データ変換部402は、8個のサブチャネルCH1-1~CH1-8を生成する。
 次に、入力データ変換部402は、1層目の入力データに含まれる一のチャネルの各要素について、要素値を2進数で表現した場合に、値が「1」の桁を当該値が「1」の桁の位置(ビット位置)を示す値に変換する。また、入力データ変換部402は、値が0の桁を変換後のデータが真にゼロを示す値に変換する。このようにして、入力データ変換部402は、入力データの各要素から複数の要素を備えるデータ列を生成する。例えば、入力データの要素値が「13」であれば、その2進数表記は「00001101b」となる。便宜上、真にゼロを示す値を「-1」とすれば、入力データ変換部402は、データ列{-1、-1、-1、-1、3、2、-1、0}を生成する。なお、上記入力データ変換部402の処理において、最下位ビットのビット位置を「0」とする。
 このように、入力データ変換部402は、上記処理により、「1」が設定された桁のビット位置又は真にゼロを示す値を要素とするデータ列を生成する。なお、当該データ列に含まれる2進数のビット位置は、乗加算部204にて底を2とした場合の冪指数として扱われる。つまり、乗加算部204は、量子化部44が生成するデータ(対数量子化値)と入力データ変換部402が生成するデータ(変換値)を同等に扱うことができる。
 入力データ変換部402は、上記データ列をなす各要素(ビット位置、真にゼロを示す値)を先に生成したサブチャネルの各要素に割り当てる。その際、入力データ変換部402は、1層目の入力データに含まれる一のチャネルの各要素の位置に対応する、サブチャネルの要素の位置にデータ列をなす各要素を割り当てる。例えば、図12において、変換前の入力データの右上に位置する要素(要素値が13)から生成されたデータ列の各要素は、生成されたサブチャネルの右上に位置する要素に分散されて配置される。
 例えば、上述の入力データの要素値が「13」である場合の例では、生成されたデータ列は、{-1、-1、-1、-1、3、2、-1、0}である。また、図12の例では、チャネル1(CH1)のサブチャネルとして、CH1-1~CH1-8が生成される。上記生成されたデータ列をなす要素を左から順にサブチャネルに割り当てると、サブチャネルCH1-8の要素値は「-1」となる。上述のように、量子化部44は4ビットで入力データを対数量子化し、真のゼロは「1000b」で表記するので、当該表記に合わせると、サブチャネルCH1-8の要素値は「1000b」となる。サブチャネルCH1-7~CH-5の要素値も同様に「1000b」となる。そして、サブチャネルCH1-4の要素値はデータ列の対応する要素値が「3」であるので、「0011b」となる。同様に、サブチャネルCH1-3の要素値は「0010b」、サブチャネルCH1-2の要素値は「1000b」、サブチャネルCH1-1は「0000b」となる。
 入力データ変換部402は、上記のようなデータ列を生成する処理を取得した入力データの全ての要素に適用して対応するデータ列を生成し、データ列の各要素をサブチャネルの各要素に割り当てる。また、入力データ変換部402は、上記サブチャネルを生成する処理、データ列を生成する処理、データ列の各要素をサブチャネルの各要素に割り当てる処理を取得した入力データの全てのチャネルに適用する。
 上記入力データ変換部402の動作を纏めると図13に示すフローチャートのとおりとなる。
 初めに、入力データ変換部402は、入力データの各チャネルに関し、変換前の入力データをなす各要素値のビット数に応じた数のサブチャネルを生成する(ステップS101)。次に、入力データ変換部402は、入力データの各要素値を2進数表記し、各ビットの値(0、1)に応じて、ビット位置を示す数又は対数量子化後のデータが真にゼロを示す数を要素とするデータ列を生成する(ステップS102)。最後に、入力データ変換部402は、入力データの各要素とサブチャネルの各要素の位置を保持しつつ、生成したデータ列の各要素をサブチャネルの各要素に割り当てる(ステップS103)。
 入力データ変換部402は、上記のように生成したサブチャネルを対数量子化された入力データ(アクティベーション)として畳み込み演算部43に供給する。例えば、入力データがRGBの3チャネルから構成される画像データである場合には、1つのチャネルが8個のサブチャネルに拡張されるので、24(3×8)個のチャネルが畳み込み演算部43に供給される。
 サブチャネルの各要素は冪指数又は真にゼロを示すので、畳み込み演算部43(より正確には乗加算部204)における畳み込み演算に必要な乗算は、シフト演算で実現できる。また、畳み込み演算では、チャネルと重みの対応する要素同士の乗算の後、乗算結果は加算されることになるので、変換前の入力データを用いた畳み込み演算と変換後の入力データを用いた畳み込み演算の結果は同一となる。
 例えば、変換前の入力データの要素値が「13」であり、対応する重みの要素値が「2」の場合を考える。この場合、入力データと重みの乗算結果は「26」である。要素値「13」は、2+2+2と表現できるので、重みの要素値「2」を3ビット左シフト、2ビット左シフト、シフト無しの加算が乗算結果となる。当該シフト演算と加算の結果は「26」となる(16+8+2=26)。
 続いて、データ変換前の入力データを用いた畳み込み演算とデータ変換後の入力データを用いた畳み込み演算の結果が等しくなることを数式により説明する。
 畳み込み演算の計算式は下記の式(1)のように表現できる。
[式1]
Figure JPOXMLDOC01-appb-I000001
 なお、式(1)において、wは重みの要素、aは入力データ(アクティベーション)の要素を示す。nは層の順番を示し、サフィックスi、jは入力データ、重みの幅方向、高さ方向の位置を示す。x、yは出力データの位置を示す。C、S、Rは上述のように、チャネル数、重みのサイズを示す。
 入力データ(アクティベーション)が対数量子化されている場合、入力データaはa=2と表記できる(但し、lは冪指数であり、正の整数。以下同じ)。すると、式(1)から下記の式(2)、(3)が得られる。
[式2]
Figure JPOXMLDOC01-appb-I000002

[式3]
Figure JPOXMLDOC01-appb-I000003
 また、入力データ変換部402によるデータ変換の際、変換前の入力データの要素値が8ビット整数の場合には、入力データaは下記の式(4)のとおりとなる。
[式4]
Figure JPOXMLDOC01-appb-I000004
 なお、Lは入力データ変換部402により生成されるサブチャネルの数である。上述の例では、L=8である。
 式(4)を用いると式(1)は、下記の式(5)~(7)のとおり変形できる。
[式5]
Figure JPOXMLDOC01-appb-I000005

[式6]
Figure JPOXMLDOC01-appb-I000006

[式7]
Figure JPOXMLDOC01-appb-I000007
 式(7)において、入力データはRGBの3チャネルとし、
Figure JPOXMLDOC01-appb-I000008
をチャネル数3×Lと捉えれば、式(7)と式(3)は同等となる。このように、入力データ変換部402による変換された入力データ(各要素が冪指数であるサブチャネル)を用いた畳み込み演算結果とデータ変換前の畳み込み演算の結果は同じとなる。
 なお、量子化部44の対数量子化処理により得られる対数量子化値と入力データ変換部402の変換処理により得られる変換値の形式(フォーマット)は同じものであるが、上記2つのモジュールの処理は似て非なるものである。
 上述のように、量子化部44の対数量子化処理は、対象となるデータを2の冪乗に丸め込み、当該丸め込んだデータを冪指数で表現するものである。従って、量子化部44による対数量子化値から対数量子化前のデータを得ることは原則できない。即ち、量子化部44による処理は不可逆な変換動作とも言える。
 対して、入力データ変換部402による変換処理は、対象となるデータを2の冪乗の和として表現し、これら2の冪乗を複数のサブチャネルに分配配置する処置である。その際、入力データ変換部402は、各サブチャネルに分配する2の冪乗を冪指数で表現する。従って、サブチャネルに分配された要素から2の冪乗を復元し、復元結果を加算することで、データ変換前の値を得ることができる。即ち、入力データ変換部402による処理は可逆な変換動作とも言える。
[重み処理部]
 図6に説明を戻す。重み処理部41は、重み記憶部51から取得した重み(重み群)が1層目で使用するものである場合には、当該取得した重みを所定の数複製し、畳み込み演算部43に供給する。一方、重み処理部41は、重み記憶部51から取得した重みが2層目以降で使用されるものである場合には、特段の処理を行わず、取得した重みを畳み込み演算部43に供給する。
 上記機能を実現するため、重み処理部41は、図14に示すような構成を備える。図14を参照すると、重み処理部41は、重み取得部411と、重み複製部412と、を含んで構成される。
 重み取得部411は、畳み込み層制御部40からの指示に応じて、重み記憶部51にアクセスし、各層の畳み込み演算に必要な重み群(複数の重み群)を取得する。その際、重み取得部411は、重みの取得を指示された層が1層目であれば、取得した重みを重み複製部412に供給する。重み取得部411は、重みの取得を指示された層が2層目以降であれば、取得した重みをそのまま畳み込み演算部43に供給する。
 重み複製部412は、取得した1層目の重み(重み群)を所定の数複製する。具体的には、重み複製部412は、1層目の入力データに含まれる一のチャネルに対応する重みの数が、拡張されたサブチャネルの数と同数となるように1層目の入力データに含まれる一のチャネルに対応する重みを複製する。つまり、重み複製部412は、入力データ変換部402が生成するサブチャネルの数と同じ数となるように対応する重みを複製する。例えば、上述のように、入力データ変換部402が1つのチャネルから8個のサブチャネルを生成する場合には、重み複製部412は1層目の対応する重みを7回複製する。即ち、重み複製部412は、同じ重みを8個用意する。
 換言すれば、重み複製部412は、データ変換前の入力データと重みの関係と、データ変換後の入力データ(サブチャネル)と重みの関係と、が維持されるように1層目の重みの複製を行う。当該複製処理により、畳み込み演算部43は、提供されたデータ(入力データ、重み)の層を意識すること無く、画一的に処理できる。
 続いて、第1の実施形態に係る推論装置10のハードウェア構成について説明する。
 図15は、推論装置10のハードウェア構成の一例を示す図である。推論装置10は、所謂、情報処理装置(コンピュータ)により構成可能であり、図15に例示する構成を備える。例えば、推論装置10は、内部バスにより相互に接続される、CPU(Central Processing Unit)91、メモリ92、入出力インターフェイス93及び通信手段であるNIC(Network Interface Card)94等を備える。
 なお、図15に示す構成は、推論装置10のハードウェア構成を限定する趣旨ではない。推論装置10は、図示しないハードウェアを含んでもよい。あるいは、推論装置10に含まれるCPU等の数も図15の例示に限定する趣旨ではなく、例えば、複数のCPUが推論装置10に含まれていてもよい。
 メモリ92は、RAM(Random Access Memory)、ROM(Read Only Memory)、補助記憶装置(ハードディスク等)である。
 入出力インターフェイス93は、図示しない表示装置や入力装置のインターフェイスとなる手段である。表示装置は、例えば、液晶ディスプレイ等である。入力装置は、例えば、キーボードやマウス等のユーザ操作を受け付ける装置である。
 推論装置10の機能は、上述の処理モジュールにより実現される。当該処理モジュールは、例えば、メモリ92に格納されたプログラムをCPU91が実行することで実現される。あるいは、処理モジュールの一部(例えば、乗加算部204)は、FPGA(Field Programmable Gate Array)やASIC(Application Specific Integrated Circuit)等の特定用途に特化したハードウェアにより実現(ハードウェアに実装)されてもよい。また、上記プログラムは、ネットワークを介してダウンロードするか、あるいは、プログラムを記憶した記憶媒体を用いて、更新することができる。さらに、上記処理モジュールは、半導体チップにより実現されてもよい。即ち、上記処理モジュールが行う機能は、何らかのハードウェアにおいてソフトウェアが実行されることによって実現できればよい。
 以上のように、第1の実施形態に係る推論装置10は、畳み込み演算部43が取得したデータを層によらず画一的に処理できるように、1層目にて使用する入力データを変換する。第1の実施形態では、当該入力データの変換を変換前後で意味が変化しないようにしているため、変換後の入力データを用いた畳み込み演算の精度が劣化することはない。この点、非特許文献1に開示された技術では、意味が変化してしまうのと対照的である。また、非特許文献1に開示された技術では、重みの再学習が必要であったが、第1の実施形態に係る推論装置10では、入力データの意味が変化しないのでそのような再学習は不要である。
[第2の実施形態]
 続いて、第2の実施形態について図面を参照して詳細に説明する。
 第1の実施形態では、入力データは正の整数であることを前提としている。しかし、CNN学習、推論において1層目の入力データが負の値となることや実数(浮動小数点)となることがあり得る。第2の実施形態では、これら入力データが負の値や浮動小数点で表現される場合であっても、畳み込み演算回路を共用できることを説明する。
 特定のデータセットを用いたCNN学習、推論では、畳み込み演算の前処理として、事前算出されるデータセット全体の平均値を入力データから減算する処理が行われることがある。例えば、画像データセットにおいて、画像のRGB3チャネルそれぞれの平均値(Rのデータセット平均値、Gのデータセット平均値、Bのデータセットの平均値の3値)が事前に計算される。その後、画像データの画素値から当該3つの平均値を減算して得られる画像を、CNN推論の入力とすることがある。
 上記内容を数式にて表現すると、以下の式(8)のとおりとなる。
[式8]
Figure JPOXMLDOC01-appb-I000009
 式(8)において、a'x,y,cは平均値減算後の画素値を示し、CNNへの入力データとなる。ax,y,cはRGBの各チャネルcにおける座標(x、y)の画素値を示す。avecは各チャネルcのデータセット平均値を示す。
 上記式(8)から明らかな通り、入力データに対して事前処理を施すとCNNへの入力データ(入力画素値)は正の整数とは限らず、データセット平均値によっては負の値や浮動小数点(実数)となることがある。第1の実施形態にて説明した構成では、これら負の値や浮動小数点をそのまま扱うことができない。そこで、第2の実施形態では、上記事前減算に相当する処理を、1層目の畳み込み演算が終了した後に実行することで、畳み込み演算の回路を共用する場合を説明する。
 なお、第1の実施形態では、入力データに加算するバイアスに言及していない。入力データに加算するバイアスは、通常、固定値(例えば、「1」)でありバイアスが加算されても入力データ全体がシフトするだけであり、畳み込み演算の動作には影響しないためである。
 バイアスを考慮して式(1)を書き直すと、下記の式(9)が得られる。
[式9]
Figure JPOXMLDOC01-appb-I000010
 式(9)において、bがバイアスである。
 上記事前減算を考慮しつつ、CNN1層目の演算を上述の式(9)を用いて表現すると下記の式(10)が得られる。
[式10]
Figure JPOXMLDOC01-appb-I000011
 式(10)において、b は1層目のバイアスである。なお、1層目のバイアスb は、設計時に予め定まる固定値である。
 式(10)に式(8)を代入し、展開すると下記の式(11)が得られる。
[式11]
Figure JPOXMLDOC01-appb-I000012
 上記式(11)は分配則により、下記の式(12)に変形できる。
[式12]

Figure JPOXMLDOC01-appb-I000013
 ここで、
Figure JPOXMLDOC01-appb-I000014

Figure JPOXMLDOC01-appb-I000015
が、(x、y)座標によらない値であることを考慮すると、式(12)は下記の式(13)に書き換えることができる。
[式13]

Figure JPOXMLDOC01-appb-I000016
 式(13)において、右辺の第2項
Figure JPOXMLDOC01-appb-I000017
はkに依存する変数b’1 と置き替えることができる。さらに、式(13)において、第2項、第3項の-b’1 +b をbnew と置き替えれば、置換後の式(13)により示される畳み込み演算(事前減算を行う畳み込み演算)は、式(9)と同等と捉えることができる。
 当該事実は、事前減算に変えて、1層目における畳み込み演算結果に加算するバイアスを新たなバイアスbnew (=-b’1 +b )としておくことで、CNN1層目の入力データを正の値にできることを意味する。つまり、式(13)の右辺第1項は、特定のデータセット等にて行われる事前減算を行う前の入力データを用いた畳み込み演算に等しく、右辺の第2項と第3項は新たなバイアスと捉えることができる。このことは、1層目の入力データを第1の実施形態と同様に処理(入力データの変換、畳み込み演算の実行)し、その後、新たなバイアスを加算すれば、上記事前減算が行われた入力データを用いた畳み込み演算と同じ処理結果が得られることを意味する。換言すれば、第2の実施形態では、事前に行われる減算処理に相当する処理を1層目の畳み込み演算が終了した後に実行することで、入力データ変換部402がデータ変換の対象とする入力データは正の整数となることを担保する。
 図16は、第2の実施形態に係る畳み込み層実行部31aの内部構成の一例を示す図である。図6と図16を比較すると、畳み込み演算部43と量子化部44の間にバイアス変更部45が追加されている点が相違する。
 バイアス変更部45は、重み記憶部51に格納された重みと、入力データ記憶部52に格納された入力データと、を取得可能に構成されている。バイアス変更部45は、1層目の畳み込み演算の結果を畳み込み演算部43から取得した場合には、量子化部44に供給するデータのバイアスを変更する。対して、バイアス変更部45は、2層目以降の畳み込み演算の結果を取得した場合には、当初のバイアスを変更せず畳み込み演算の結果を量子化部44に供給する。
 具体的には、バイアス変更部45は、1層目の畳み込み演算結果を取得した場合には、上記bnew を計算し、畳み込み演算の結果に加算する。より詳細には、バイアス変更部45は、1層目の入力データから各チャネルの平均値aveを計算する。その後、バイアス変更部45は、計算した平均値aveと各チャネルに対応する重み群の全要素を乗算し、乗算結果を加算することで上記b’1 を計算する。バイアス変更部45は、-b’1 +b (当初のバイアス;予め定められた固定値)を計算し、当該計算した値を新たなバイアスとして1層目の畳み込み演算結果に加算し、その結果を量子化部44に供給する。なお、バイアス変更部45の動作は、層出力値の平均を「0」に、分散を「1」に変換するような正規化処理と捉えることもできる。
 以上のように、第2の実施形態では、1層目の入力データに対応するバイアスを、1層目の入力データと1層目の入力データに対応する重みを用いて変換し、当該変換されたバイアスを1層目の畳み込み演算の結果に加算する。その結果、データセット平均値を入力データから減算することにより入力データが負の値や浮動小数点(実数)となることが回避できる。つまり、第2の実施形態では、入力データの事前減算処理を実行する前に、1層目の畳み込み演算を実行し、その後、各チャネルの平均値を事前減算に関する値をバイアスと共に加算(減算)する。当該加算処理により、畳み込み演算結果が浮動小数点(実数)となることがあり得るが、当該実数値は量子化部44による対数量子化処理により丸め込まれ、整数に変換される。その結果、2層目以降の入力データも整数となり、畳み込み演算回路を共用することができる。
[変形例]
 第1の実施形態にて説明した推論装置10は例示であって、その構成及び動作を限定する趣旨ではない。以下、各種変形例について説明する。
 上記実施形態では、畳み込み層実行部31にて対数量子化処理を実行する場合について説明したが、プーリング層等において対数量子化処理を実行しても良い。あるいは、図6に示す重み処理部41、入力データ処理部42が1つのモジュールにより実現されていても良い。
 上記実施形態では、重み複製部412が1層目の重みを複製することを説明したが、畳み込み演算部43が、畳み込み演算を実行する「層」を区別することで、当該複製処理を不実施とすることもできる。具体的には、図7において、重み入出力部202は1層目の同じ重みを必要な数だけ連続して乗加算部204に供給すればよい。上述の例では、重み入出力部202は、同じ重みを8回連続して乗加算部204に供給すればよい。
 上記実施形態では、入力データの値によらず、入力データ一次記憶部212に格納された入力データと重み一次記憶部211に格納された重みを全て乗加算部204に供給することを説明した。しかし、対数量子化された入力データの値が真に「0」であれば、その乗算結果は重みの値によらずゼロになるので、当該入力データ「0」と対応する重みの値を乗加算部204に供給する必要がない。そこで、例えば、入力データ入出力部203が入力データの値が「0」であることを検知し、当該事実を重み入出力部202に伝え、値が「0」である入力データと対応する重み値の供給を省略してもよい。つまり、入力データの要素値が真にゼロを示すものである場合には、入力データ入出力部203と重み入出力部202が連携し、当該データ及び対応する重みを乗加算部204に供給することを停止してもよい。その結果、乗加算部204における処理が低減され、畳み込み演算の高速化が期待できる。
 上記実施形態では、量子化部44による対数量子化値が取り得る範囲と入力データ変換部402による変換値が取り得る範囲が同じ場合を説明した。具体的には、量子化部44による対数量子化値及び入力データ変換部402による変換値は、真にゼロを示す値か、0~7の冪指数である。しかし、対数量子化値と変換値の取り得る範囲は異なるものであっても良い。例えば、対数量子化値に含まれる冪指数は0~14であり、変換値に含まれる冪指数は0~7であってもよい。このような場合であっても、畳み込み演算部43は、量子化部44により対数量子化されたデータと入力データ変換部402から供給されるデータを画一的に扱うことができる。つまり、畳み込み演算部43が、2つのデータを同様の処理できるものであれば、対数量子化値と変換値に含まれる冪指数が取り得る範囲は異なっていても良い。
 上記実施形態では、1つの畳み込み演算部43が1回の畳み込み演算を順番に実行していく構成を説明したが、複数の畳み込み演算部43を設け畳み込み演算を並列に実行してもよい。例えば、それぞれが同一の構成を有する複数の畳み込み演算部43を用意し、各畳み込み演算部43にて独立に畳み込み演算を実行してもよい。例えば、図3を参照すると、ある畳み込み演算部43が重み群511に関する畳み込み演算を実行し、他の畳み込み演算部43が重み群512に関する畳み込み演算を同時に(並列に)実行してもよい。
 上記実施形態では、主に対数量子化された入力データの要素値は正の値の場合について説明したが、対数量子化された入力データの要素値は負の値であってもよい。つまり、重みを左シフト(対数量子化された入力データの要素値は正の値)する場合だけでなく、重みを右シフト(対数量子化された入力データの要素値は負の値)してもよい。例えば、対数量子化された入力データの要素値が「-2」であれば、当該値は重みとの乗算において重みの値を2ビット右にシフトすることを意味する。
 上記実施形態では、入力データは整数であることを前提としているが、入力データに対して事前処理、畳み込み演算に対する事後処理により入力データが浮動小数点で記載されていても対応できる。例えば、浮動小数点を固定小数点に変換し、擬似的に整数として扱うことで入力データが浮動小数点で表現されていても、畳み込み演算の回路を共用することができる。
 第2の実施形態では、バイアス変更部45が、1層目の入力データから各チャネルの平均値aveを計算している。しかし、各チャネルの平均値aveは入力データが定まれば事前計算できる値であるので、当該平均値を事前計算しておきバイアス変更部45のレジスタ等に予め登録しておいてもよい。この場合、バイアス変更部45は、予め計算された平均値aveと各チャネルに対応する重み群の全要素を乗算し、乗算結果を加算することで上記b’ を計算する。
 第2の実施形態では、畳み込み層実行部31aの内部にバイアス変更部45を設ける例を説明したが、他の箇所にバイアス変更部45を設けても良いことは勿論である。例えば、図7に示す畳み込み演算部43にバイアス変更部45を設けてもよい。
 なお、第2の実施形態では、
Figure JPOXMLDOC01-appb-I000018
が(x、y)座標によらない値であることを前提としている。しかし、厳密に言えば、画像端の位置における畳み込み演算では画面外画素を補填(パディング)する処理が行われ、上記前提が成立しないことがある。しかし、換言すれば、上記前提が成り立たないのは画像端という特殊な状況だけであり、畳み込み演算には大きな影響を与えるものではない。
 本願開示では、入力データから結果を推論(判定)する推論装置を例にとり畳み込み演算に使用する回路の共用化手法を説明した。しかし、畳み込みニューラルネットワークの活用(中間層の動作)の観点からは、推論装置と重みを生成する学習装置では相違する点はない。つまり、推論装置への入力データは推論対象となるデータであり、学習装置の推論部への入力データは教師データであるが、「推論」の観点からは両者に違いはない。即ち、上記説明した推論装置10に、誤差逆伝搬を行う誤差逆伝搬部、重みアップデートを行う重みアップデート部等を付加することで学習装置を構成することができる。なお、誤差逆伝搬部及び重みアップデート部に関しては、公知のアルゴリズム等により実現可能でありその説明を省略する。
 また、上述の説明で用いた複数のフローチャートでは、複数の工程(処理)が順番に記載されているが、各実施形態で実行される工程の実行順序は、その記載の順番に制限されない。各実施形態では、例えば各処理を並行して実行する等、図示される工程の順番を内容的に支障のない範囲で変更することができる。
 上記の実施形態の一部又は全部は、以下のようにも記載され得るが、以下には限られない。
[形態1]
 上述の第1の視点に係る推論装置のとおりである。
[形態2]
 前記入力データ変換部は、
 変換前後の入力データが等価であることを担保しつつ、前記1層目の入力データを変換する、好ましくは形態1の推論装置。
[形態3]
 前記入力データ変換部は、
 前記1層目の入力データに含まれる一のチャネルを、前記1層目の入力データをなす要素のビット数と同数のサブチャネルに拡張する、好ましくは形態2の推論装置。
[形態4]
 前記入力データ変換部は、
 前記1層目の入力データに含まれる一のチャネルの各要素について、要素値を2進数で表現した場合に、値が1の桁を前記値が1の桁の位置を示す値に変換し、値が0の桁を変換後のデータが真にゼロを示す値に変換してデータ列を生成し、
 前記データ列をなす各要素を前記サブチャネルの各要素に割り当てる、好ましくは形態3の推論装置。
[形態5]
 前記入力データ変換部は、
 前記1層目の入力データに含まれる一のチャネルの各要素の位置に対応する、前記サブチャネルの要素の位置に前記データ列をなす各要素を割り当てる、好ましくは形態4の推論装置。
[形態6]
 前記入力データを記憶する、入力データ記憶部と、
 前記入力データ記憶部にアクセスし、前記入力データを取得する入力データ取得部と、をさらに備え、
 前記入力データ取得部は、
 前記取得した入力データが1層目の畳み込み演算で使用される場合には、前記取得した入力データを前記入力データ変換部に供給し、
 前記取得した入力データが2層目以降の畳み込み演算で使用される場合には、前記取得した入力データを前記畳み込み演算部に供給する、好ましくは形態1乃至5のいずれか一に記載の推論装置。
[形態7]
 前記1層目の入力データに含まれる一のチャネルに対応する重みの数が、前記拡張されたサブチャネルの数と同数となるように前記1層目の入力データに含まれる一のチャネルに対応する重みを複製する、重み複製部をさらに備える、好ましくは形態3乃至5のいずれか一に記載の推論装置。
[形態8]
 前記重みを記憶する、重み記憶部と、
 前記重み記憶部にアクセスし、前記重みを取得する重み取得部と、をさらに備え、
 前記重み取得部は、
 前記取得した重みが1層目の畳み込み演算で使用される場合には、前記取得した重みを前記重み複製部に供給し、
 前記取得した重みが2層目以降の畳み込み演算で使用される場合には、前記取得した重みを前記畳み込み演算部に供給する、好ましくは形態7の推論装置。
[形態9]
 前記畳み込み演算部は、
 畳み込み演算にて実行する乗算処理を、取得した入力データをなす各要素の要素値に応じたシフト演算により実現する、好ましくは形態1乃至8のいずれか一に記載の推論装置。
[形態10]
 前記畳み込み演算部は、
 前記入力データをなすチャネルごとに設けられ、前記チャネルの各要素と前記チャネルの各要素に対応する重みに関する前記シフト演算を実行し、前記シフト演算の結果を加算する、複数のシフト演算&加算器と、
 前記複数のシフト演算&加算器の演算結果を加算する、加算器と、
 を含んで構成される、好ましくは形態9の推論装置。
[形態11]
 前記量子化部は、畳み込み演算の結果を2の冪乗に丸め込み、量子化対象のデータを、底を2とした場合の冪指数又は量子化後のデータが真にゼロであるかを示す値に変換する、好ましくは形態1乃至10のいずれか一に記載の推論装置。
[形態12]
 前記1層目の入力データに対応するバイアスを、前記1層目の入力データと前記1層目の入力データに対応する重みを用いて変換し、前記変換されたバイアスを前記1層目の畳み込み演算の結果に加算する、バイアス変更部をさらに備える、好ましくは形態1乃至11のいずれか一に記載の推論装置。
[形態13]
 上述の第2の視点に係る畳み込み演算実行方法のとおりである。
[形態14]
 上述の第3の視点に係るプログラムのとおりである。
 なお、形態13及び形態14は、形態1と同様に、形態2~12のように展開することが可能である。
 なお、引用した上記の特許文献等の各開示は、本書に引用をもって繰り込むものとする。本発明の全開示(請求の範囲を含む)の枠内において、さらにその基本的技術思想に基づいて、実施形態ないし実施例の変更・調整が可能である。また、本発明の全開示の枠内において種々の開示要素(各請求項の各要素、各実施形態ないし実施例の各要素、各図面の各要素等を含む)の多様な組み合わせ、ないし、選択(少なくとも一部の非選択を含む)が可能である。すなわち、本発明は、請求の範囲を含む全開示、技術的思想にしたがって当業者であればなし得るであろう各種変形、修正を含むことは勿論である。特に、本書に記載した数値範囲については、当該範囲内に含まれる任意の数値ないし小範囲が、別段の記載のない場合でも具体的に記載されているものと解釈されるべきである。
10、100 推論装置
11 入力層実行部
12 中間層実行部
13 出力層実行部
31、31a 畳み込み層実行部
32 活性化関数実行部
33 プーリング層実行部
40 畳み込み層制御部
41 重み処理部
42 入力データ処理部
43、102 畳み込み演算部
44、101 量子化部
45 バイアス変更部
51 重み記憶部
52 入力データ記憶部
53 演算結果記憶部
91 CPU(Central Processing Unit)
92 メモリ
93 入出力インターフェイス
94 NIC(Network Interface Card)
103、402 入力データ変換部
201 畳み込み演算制御部
202 重み入出力部
203 入力データ入出力部
204 乗加算部
211 重み一次記憶部
212 入力データ一次記憶部
213 演算結果一次記憶部
301、301-1~301-N シフト演算&加算器
302、312 加算器
311 シフト演算器
313 レジスタ
401 入力データ取得部
411 重み取得部
412 重み複製部
501、502 重み
511、512 重み群
601、611 入力データ

Claims (14)

  1.  入力データと重みを用いた畳み込みニューラルネットワークにおける畳み込み演算の結果を量子化する、量子化部と、
     前記量子化された演算結果を入力データとして用いて畳み込み演算を実行する、畳み込み演算部と、
     前記畳み込み演算部が1層目の入力データと前記量子化部により量子化された入力データを同様に処理できるように、前記1層目の入力データを変換する、入力データ変換部と、
     を備える、推論装置。
  2.  前記入力データ変換部は、
     変換前後の入力データが等価であることを担保しつつ、前記1層目の入力データを変換する、請求項1の推論装置。
  3.  前記入力データ変換部は、
     前記1層目の入力データに含まれる一のチャネルを、前記1層目の入力データをなす要素のビット数と同数のサブチャネルに拡張する、請求項2の推論装置。
  4.  前記入力データ変換部は、
     前記1層目の入力データに含まれる一のチャネルの各要素について、要素値を2進数で表現した場合に、値が1の桁を前記値が1の桁の位置を示す値に変換し、値が0の桁を変換後のデータが真にゼロを示す値に変換してデータ列を生成し、
     前記データ列をなす各要素を前記サブチャネルの各要素に割り当てる、請求項3の推論装置。
  5.  前記入力データ変換部は、
     前記1層目の入力データに含まれる一のチャネルの各要素の位置に対応する、前記サブチャネルの要素の位置に前記データ列をなす各要素を割り当てる、請求項4の推論装置。
  6.  前記入力データを記憶する、入力データ記憶部と、
     前記入力データ記憶部にアクセスし、前記入力データを取得する入力データ取得部と、をさらに備え、
     前記入力データ取得部は、
     前記取得した入力データが1層目の畳み込み演算で使用される場合には、前記取得した入力データを前記入力データ変換部に供給し、
     前記取得した入力データが2層目以降の畳み込み演算で使用される場合には、前記取得した入力データを前記畳み込み演算部に供給する、請求項1乃至5のいずれか一項に記載の推論装置。
  7.  前記1層目の入力データに含まれる一のチャネルに対応する重みの数が、前記拡張されたサブチャネルの数と同数となるように前記1層目の入力データに含まれる一のチャネルに対応する重みを複製する、重み複製部をさらに備える、請求項3乃至5のいずれか一項に記載の推論装置。
  8.  前記重みを記憶する、重み記憶部と、
     前記重み記憶部にアクセスし、前記重みを取得する重み取得部と、をさらに備え、
     前記重み取得部は、
     前記取得した重みが1層目の畳み込み演算で使用される場合には、前記取得した重みを前記重み複製部に供給し、
     前記取得した重みが2層目以降の畳み込み演算で使用される場合には、前記取得した重みを前記畳み込み演算部に供給する、請求項7の推論装置。
  9.  前記畳み込み演算部は、
     畳み込み演算にて実行する乗算処理を、取得した入力データをなす各要素の要素値に応じたシフト演算により実現する、請求項1乃至8のいずれか一項に記載の推論装置。
  10.  前記畳み込み演算部は、
     前記入力データをなすチャネルごとに設けられ、前記チャネルの各要素と前記チャネルの各要素に対応する重みに関する前記シフト演算を実行し、前記シフト演算の結果を加算する、複数のシフト演算&加算器と、
     前記複数のシフト演算&加算器の演算結果を加算する、加算器と、
     を含んで構成される、請求項9の推論装置。
  11.  前記量子化部は、畳み込み演算の結果を2の冪乗に丸め込み、量子化対象のデータを、底を2とした場合の冪指数又は量子化後のデータが真にゼロであるかを示す値に変換する、請求項1乃至10のいずれか一項に記載の推論装置。
  12.  前記1層目の入力データに対応するバイアスを、前記1層目の入力データと前記1層目の入力データに対応する重みを用いて変換し、前記変換されたバイアスを前記1層目の畳み込み演算の結果に加算する、バイアス変更部をさらに備える、請求項1乃至11のいずれか一項に記載の推論装置。
  13.  入力データと重みを用いた畳み込みニューラルネットワークにおける畳み込み演算の結果を量子化する、量子化部と、
     前記量子化された演算結果を入力データとして用いて畳み込み演算を実行する、畳み込み演算部と、
     を備える推論装置において、
     前記入力データを取得するステップと、
     前記取得した入力データが1層目の畳み込み演算で使用される場合には、前記畳み込み演算部が前記1層目の入力データと前記量子化部により量子化された入力データを同様に処理できるように、前記1層目の入力データを変換する、ステップと、
     を含む、畳み込み演算実行方法。
  14.  入力データと重みを用いた畳み込みニューラルネットワークにおける畳み込み演算の結果を量子化する、量子化部と、
     前記量子化された演算結果を入力データとして用いて畳み込み演算を実行する、畳み込み演算部と、
     を備える推論装置に搭載されたコンピュータに、
     前記入力データを取得する処理と、
     前記取得した入力データが1層目の畳み込み演算で使用される場合には、前記畳み込み演算部が前記1層目の入力データと前記量子化部により量子化された入力データを同様に処理できるように、前記1層目の入力データを変換する、処理と、
     を実行させるプログラム。
PCT/JP2019/007756 2018-03-02 2019-02-28 推論装置、畳み込み演算実行方法及びプログラム WO2019168084A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2020503604A JP6977864B2 (ja) 2018-03-02 2019-02-28 推論装置、畳み込み演算実行方法及びプログラム
US16/977,349 US11989639B2 (en) 2018-03-02 2019-02-28 Inferential device, convolutional operation method, and program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018-038029 2018-03-02
JP2018038029 2018-03-02

Publications (1)

Publication Number Publication Date
WO2019168084A1 true WO2019168084A1 (ja) 2019-09-06

Family

ID=67806335

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/007756 WO2019168084A1 (ja) 2018-03-02 2019-02-28 推論装置、畳み込み演算実行方法及びプログラム

Country Status (3)

Country Link
US (1) US11989639B2 (ja)
JP (1) JP6977864B2 (ja)
WO (1) WO2019168084A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468935A (zh) * 2020-05-08 2021-10-01 上海齐感电子信息科技有限公司 人脸识别方法

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6805984B2 (ja) * 2017-07-06 2020-12-23 株式会社デンソー 畳み込みニューラルネットワーク
US11586910B1 (en) 2018-04-20 2023-02-21 Perceive Corporation Write cache for neural network inference circuit
US10740434B1 (en) 2018-04-20 2020-08-11 Perceive Corporation Reduced dot product computation circuit
US11568227B1 (en) 2018-04-20 2023-01-31 Perceive Corporation Neural network inference circuit read controller with multiple operational modes
US11341397B1 (en) 2018-04-20 2022-05-24 Perceive Corporation Computation of neural network node
US11481612B1 (en) 2018-04-20 2022-10-25 Perceive Corporation Storage of input values across multiple cores of neural network inference circuit
JP7137067B2 (ja) * 2018-10-25 2022-09-14 富士通株式会社 演算処理装置、学習プログラム及び学習方法
US11995533B1 (en) * 2018-12-05 2024-05-28 Perceive Corporation Executing replicated neural network layers on inference circuit
US11347297B1 (en) 2019-01-23 2022-05-31 Perceive Corporation Neural network inference circuit employing dynamic memory sleep
US20200293865A1 (en) * 2019-03-14 2020-09-17 Gyrfalcon Technology Inc. Using identity layer in a cellular neural network architecture
US11625585B1 (en) 2019-05-21 2023-04-11 Perceive Corporation Compiler for optimizing filter sparsity for neural network implementation configuration
CN111814957B (zh) * 2020-06-28 2024-04-02 深圳云天励飞技术股份有限公司 神经网络运算方法及相关设备
CN113128116B (zh) * 2021-04-20 2023-09-26 上海科技大学 可用于轻量级神经网络的纯整型量化方法
WO2022236128A1 (en) * 2021-05-07 2022-11-10 Google Llc Asynchronous distributed data flow for machine learning workloads

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018181313A (ja) * 2017-04-20 2018-11-15 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America 情報処理方法、情報処理装置およびプログラム

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5473730A (en) 1993-11-09 1995-12-05 At&T Ipm Corp. High efficiency learning network
US6038337A (en) 1996-03-29 2000-03-14 Nec Research Institute, Inc. Method and apparatus for object recognition
JP6348431B2 (ja) 2015-02-24 2018-06-27 株式会社日立製作所 画像処理方法、画像処理装置
US10831444B2 (en) * 2016-04-04 2020-11-10 Technion Research & Development Foundation Limited Quantized neural network training and inference
JP2017211735A (ja) 2016-05-24 2017-11-30 ソニー株式会社 演算処理装置、及び、演算処理方法
JP6183980B1 (ja) 2016-12-02 2017-08-23 国立大学法人東京工業大学 ニューラルネットワーク回路装置、ニューラルネットワーク、ニューラルネットワーク処理方法およびニューラルネットワークの実行プログラム
WO2018119808A1 (zh) * 2016-12-29 2018-07-05 浙江工商大学 一种基于3d卷积神经网络的立体视频生成方法
US11556772B2 (en) * 2017-04-28 2023-01-17 Intel Corporation Incremental precision networks using residual inference and fine-grain quantization
KR102601604B1 (ko) * 2017-08-04 2023-11-13 삼성전자주식회사 뉴럴 네트워크의 파라미터들을 양자화하는 방법 및 장치

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018181313A (ja) * 2017-04-20 2018-11-15 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America 情報処理方法、情報処理装置およびプログラム

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MIYASHITA, DAISUKE ET AL.: "Convolutional Neural Networks using Logarithmic Data Representation(v2)", ARXIV.ORG, 17 March 2016 (2016-03-17), pages 1 - 10, XP080686928, Retrieved from the Internet <URL:https://arxiv.org/abs/1603.01025> [retrieved on 20190423] *
SHIMODA MASAYUKI ET AL.: "Consideration of all benarized convolutional neural network", IEICE TECHNICAL REPORT, vol. 117, no. 153, 19 July 2017 (2017-07-19), pages 131 - 136 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468935A (zh) * 2020-05-08 2021-10-01 上海齐感电子信息科技有限公司 人脸识别方法
CN113468935B (zh) * 2020-05-08 2024-04-02 上海齐感电子信息科技有限公司 人脸识别方法

Also Published As

Publication number Publication date
US20210110236A1 (en) 2021-04-15
JPWO2019168084A1 (ja) 2021-03-04
US11989639B2 (en) 2024-05-21
JP6977864B2 (ja) 2021-12-08

Similar Documents

Publication Publication Date Title
WO2019168084A1 (ja) 推論装置、畳み込み演算実行方法及びプログラム
EP3788470B1 (en) Block floating point computations using reduced bit-width vectors
US20210004663A1 (en) Neural network device and method of quantizing parameters of neural network
CN107340993B (zh) 运算装置和方法
KR102562320B1 (ko) 비트 연산 기반의 뉴럴 네트워크 처리 방법 및 장치
JP7325158B2 (ja) ニューラル・ネットワーク・コアにおける動的精度のためのデータ表現
WO2018193906A1 (ja) 情報処理方法、情報処理装置およびプログラム
WO2019238029A1 (zh) 卷积神经网络系统和卷积神经网络量化的方法
CN107944545B (zh) 应用于神经网络的计算方法及计算装置
US10579334B2 (en) Block floating point computations using shared exponents
CN110008952B (zh) 一种目标识别方法及设备
EP3671572A1 (en) Information processing apparatus, neural network program, and processing method for neural network
JP7414930B2 (ja) 情報処理装置、情報処理方法
Chervyakov et al. Residue number system-based solution for reducing the hardware cost of a convolutional neural network
CN111656390A (zh) 用于机器学习的图像变换
KR20190098671A (ko) 뉴럴 네트워크의 고속 처리 방법 및 그 방법을 이용한 장치
US20240104342A1 (en) Methods, systems, and media for low-bit neural networks using bit shift operations
CN109389209B (zh) 处理装置及处理方法
Peng et al. MBFQuant: A Multiplier-Bitwidth-Fixed, Mixed-Precision Quantization Method for Mobile CNN-Based Applications
WO2019168088A1 (ja) 推論装置、畳み込み演算実行方法及びプログラム
CN112215347A (zh) 用于确定神经网络的成对连续层之间的传递函数的方法和计算工具
CN113313253A (zh) 神经网络压缩方法、数据处理方法、装置及计算机设备
CN109416757B (zh) 用于处理数值数据的方法、设备和计算机可读存储介质
CN113869517A (zh) 一种基于深度学习模型的推理方法
EP4318315A1 (en) A computer implemented method for transforming a pre-trained neural network and a device therefor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19761308

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020503604

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19761308

Country of ref document: EP

Kind code of ref document: A1