Neural network model transformation device and method
The neural network model conversion device addresses the limitation of high-speed devices by rearranging and dividing weight values to achieve desired sparsity, enabling efficient use and maintaining calculation accuracy.
Patent Information
- Application Number
- JP2023528793
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-06-15
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-06-15
AI Technical Summary
Existing high-speed devices for neural network model calculations are limited in accelerating operations unless the sparsity of weight value groups is equal to or higher than a predetermined value, such as 50%, leading to inefficiencies when the sparsity is below this threshold.
A neural network model conversion device and method that rearranges and divides weight values in neural network models to achieve a sparsity greater than a predetermined value by determining optimal division positions in the weight value groups, adding combination layers to combine output data, thereby facilitating effective use of high-speed devices.
The conversion process ensures that high-speed devices can efficiently perform calculations by ensuring a minimum sparsity threshold is met, maintaining the overall calculation results of the neural network model without altering its output.
Smart Images

Figure 0007540597000013 
Figure 0007540597000018 
Figure 0007540597000005
Abstract
Description
[Technical field]
[0001] The present invention relates to a neural network model conversion device, a neural network model conversion method, and a neural network model conversion program for converting a neural network model. To Regarding. [Background technology]
[0002] A neural network model trained by deep learning may be used to make predictions about predetermined items.
[0003] A neural network model includes multiple layers. Input data is given to one layer, and the output data of that layer is calculated by an operation, and the output data becomes the input data of the next layer. The final data obtained in the last layer represents the prediction result. In addition, a group of weight values (multiple weight values) is associated with each layer.
[0004] The inclusion of 0 as a weight value in a weight value group is referred to as weight sparsity. Moreover, the degree of how many weight values "0" are included in a weight value group is referred to as sparseness. Specifically, sparseness is the ratio of the number of weight values that are 0 to the number of weight values included in a weight value group. For example, if a weight value group does not include a weight value "0", the sparseness is 0%. Moreover, if all weight values included in a weight value group are "0", the sparseness is 100%.
[0005] Furthermore, Patent Document 1 describes rearranging the weight values.
[0006] Moreover, Patent Document 2 describes the removal of neurons. [Prior art documents] [Patent documents]
[0007] [Patent Document 1] International Publication No. 2019 / 082859 [Patent Document 2] Special Publication No. 2017-509951 Summary of the Invention [Problem to be solved by the invention]
[0008] In recent years, devices have been developed that use the fact that the weight value group has a high degree of sparsity (i.e., when the weight value group contains a large number of weight values "0") to speed up the calculation of layers of a neural network model. Hereinafter, such devices will be referred to as high-speed devices. High-speed devices can speed up calculations when the weight value group has a high degree of sparsity, compared to general devices that perform calculations of neural network models (hereinafter, simply referred to as general devices).
[0009] However, such high-speed devices have the restriction that, for example, the speed of calculation cannot be increased unless the sparsity is a predetermined value or more. For example, even if a calculation of a layer having a weight value group with a sparsity of 30% is executed by a high-speed device having the restriction that the speed of calculation cannot be increased unless the sparsity is 50% or more, the speed of the calculation cannot be increased.
[0010] Therefore, the present invention provides a neural network model conversion device, a neural network model conversion method, and a neural network model conversion program that can convert a neural network model so as to facilitate effective use of high-speed devices. M The purpose is to provide. [Means for solving the problem]
[0011] The neural network model conversion device according to the present invention comprises a splitting position determination means for determining a splitting position in a weight value group of at least one layer included in a given neural network model, the weight value group having a configuration in which kernels obtained by arranging at least one weight value in the channel direction are arranged in the kernel direction; a splitting means for obtaining a plurality of weight value groups by dividing the weight value group at the splitting position; and a coupling layer adding means for adding a coupling layer for combining each of the output data obtained by calculating the input data to the layer and each of the weight value groups after the splitting into one output data, characterized in that the splitting position determination means determines the splitting position in the weight value group before splitting so that at least one weight value group after splitting has a sparsity of a predetermined value or more when the sparsity degree is the ratio of the number of weight values that are 0 to the number of weight values included in the weight value group.
[0012] The neural network model conversion method according to the present invention is characterized in that a computer executes a split position determination process to determine a split position in a weight value group of at least one layer included in a given neural network model, the weight value group having a configuration in which kernels obtained by arranging at least one weight value in the channel direction are arranged in the kernel direction, a splitting process to obtain multiple weight value groups by dividing the weight value group at the split position, and a coupling layer addition process to add a coupling layer that combines each output data obtained by calculating the input data to the layer and each weight value group after the split into one output data, and determines a split position in the weight value group before splitting so that at least one weight value group after splitting has a sparsity of a predetermined value or more when the sparsity degree is the ratio of the number of weight values that are 0 to the number of weight values included in the weight value group.
[0013] According to the present invention Neural network model conversion programcauses a computer to execute a division position determination process for determining a division position in a weight value group of at least one layer included in a given neural network model, the weight value group having a configuration in which kernels obtained by arranging at least one or more weight values in a channel direction are arranged in the kernel direction; a division process for obtaining a plurality of weight value groups by dividing the weight value group at the division position; and a combination layer addition process for adding a combination layer for combining each of output data obtained by operations between input data to the layer and each of the weight value groups after the division into one output data, and determining a division position in the weight value group before division such that at least one weight value group after division has a sparsity degree equal to or greater than a predetermined value when the sparsity degree is the ratio of the number of weight values that are 0 to the number of weight values included in the weight value group. do. Effect of the Invention
[0014] According to the present invention, neural network models can be transformed to facilitate efficient use of high speed devices. [Brief description of the drawings]
[0015] [Figure 1] FIG. 2 is a schematic diagram showing an example of the configuration of a weight value group corresponding to one layer. [Diagram 2] FIG. 2 is an explanatory diagram showing the relationship between input data, a weighting value group, and output data. [Diagram 3] 1 is a block diagram showing an example of the configuration of a neural network model conversion device according to a first exemplary embodiment of the present invention. [Figure 4] 13 is a schematic diagram showing an example of division positions when a weight value group is divided in the kernel direction. FIG. [Diagram 5] FIG. 13 is a schematic diagram showing an example of two weight value groups obtained by division. [Figure 6] 11 is a schematic diagram showing an example of a plurality of output data obtained by a convolution operation between input data and each of weight value groups; FIG. [Figure 7]FIG. 13 is a schematic diagram showing an example of one piece of output data obtained in the combination layer. [Figure 8] 4 is a flowchart showing an example of a process flow in the first embodiment of the present invention. [Figure 9] FIG. 4 is a schematic diagram showing conversion of a layer to be divided in the first embodiment. [Figure 10] FIG. 11 is a block diagram showing an example of the configuration of a neural network model conversion device according to a second exemplary embodiment of the present invention. [Figure 11] 10 is a flowchart showing an example of a process flow according to a second embodiment of the present invention. [Figure 12] FIG. 11 is a schematic diagram showing conversion of a layer to be divided in the second embodiment. [Figure 13] 13 is an explanatory diagram showing that the number of kernels included in the weight value group of the layer to be divided, the number of channels of the output data of the layer to be divided, and the number of channels included in the weight value group of the next layer are equal. [Figure 14] FIG. 13 is a block diagram showing an example of the configuration of a neural network model conversion device according to a third exemplary embodiment of the present invention. [Figure 15] 13 is a flowchart showing an example of a process flow according to a third embodiment of the present invention. [Figure 16] 13A and 13B are schematic diagrams showing a layer to be divided and conversion of a next layer in the third embodiment. [Figure 17] FIG. 13 is a block diagram showing an example of the configuration of a neural network model conversion device according to a fourth exemplary embodiment of the present invention. [Figure 18] 11 is a schematic diagram showing an example of division positions when a weight value group is divided in the channel direction. FIG. [Figure 19] FIG. 13 is a schematic diagram showing an example of two weight value groups obtained by division. [Figure 20] 11 is a schematic diagram showing an example of a plurality of output data obtained by a convolution operation between input data and each of weight value groups; FIG. [Figure 21] FIG. 13 is a schematic diagram showing an example of one piece of output data obtained in the combination layer. [Figure 22] 13 is a flowchart showing an example of a process flow in the fourth embodiment of the present invention. [Figure 23] FIG. 13 is a schematic diagram showing conversion of a layer to be divided in the fourth embodiment. [Figure 24] FIG. 13 is a block diagram showing an example of the configuration of a neural network model conversion device according to a fifth exemplary embodiment of the present invention. [Diagram 25] 13 is a flowchart showing an example of a process flow in the fifth embodiment of the present invention. [Figure 26] FIG. 13 is a schematic diagram showing conversion of a layer to be divided in the fifth embodiment. [Figure 27] FIG. 11 is an explanatory diagram showing that the number of channels included in the weight value group of the layer to be divided, the number of channels of the input data to the layer to be divided, and the number of kernels included in the weight value group of the previous layer are equal. [Figure 28] FIG. 13 is a block diagram showing an example of the configuration of a neural network model conversion device according to a sixth exemplary embodiment of the present invention. [Figure 29] 20 is a flowchart showing an example of a process flow in the sixth embodiment of the present invention. [Diagram 30] FIG. 23 is a schematic diagram showing transformation of a layer to be divided and a previous layer in the sixth embodiment. [Diagram 31] FIG. 1 is a schematic block diagram showing an example of the configuration of a computer related to a neural network model conversion device according to an embodiment of the present invention. [Diagram 32] 1 is a block diagram showing an overview of a neural network model conversion device according to the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0016] As described above, the neural network model includes a plurality of layers, and a weight value group is associated with each layer. The neural network model conversion device of the present invention is applied to at least one layer of the neural network model. The neural network model conversion device of the present invention may be applied to a plurality of layers of the neural network model.
[0017] First, the configuration of a weight group corresponding to one layer included in a neural network model will be described. Fig. 1 is a schematic diagram showing an example of the configuration of a weight group corresponding to one layer.
[0018] The weight value group has a configuration in which kernels obtained by arranging at least one or more weight values in the channel direction are arranged in the kernel direction. A kernel is formed by arranging at least one or more weight values in the channel direction.
[0019] In the example shown in Fig. 1, a kernel is formed by arranging matrices in the channel direction, in which weight values are arranged in the R and S directions shown in Fig. 1, and a weight value group is shown in which the kernels are arranged in the kernel direction. In the example shown in Fig. 1, the channel direction is represented by the symbol C, and the kernel direction is represented by the symbol K.
[0020] A set of weight values obtained by arranging at least one weight value (in the example shown in Figure 1, a 3-row, 3-column matrix with weight values as elements) in the channel direction is called a kernel. A kernel is sometimes called a filter. The number of channels for each kernel included in one weight value group is the same.
[0021] Moreover, the kernel direction is the direction in which the kernels are arranged.
[0022] In the weight value group shown in Fig. 1, the R direction, S direction, channel direction (C direction), and kernel direction (K direction) are shown as the directions in which the weight values are arranged. Therefore, it can be said that the weight value group shown in Fig. 1 is represented as a four-dimensional array. In the explanation of each embodiment shown below, a case will be explained as an example in which the weight value group is configured as shown in Fig. 1, in which kernels are formed by arranging matrices in which weight values are arranged in the R direction and the S direction in the channel direction, and the kernels are arranged in the kernel direction. However, the dimension of the array representing the weight value group is not limited to four dimensions.
[0023] 2 is an explanatory diagram showing the relationship between input data, weight value groups, and output data. In the weight value groups, the number of channels (the number of matrices arranged in the channel direction) is c, and the number of kernels (the number of kernels arranged in the kernel direction) is k.
[0024] The input data has a configuration in which c matrices are arranged in the channel direction. That is, the number of channels of the input data is equal to the number of channels of the weight value group of the layer to which the input data is input. In the example shown in FIG. 2, the number of channels of the input data and the number of channels of the weight value group are both c, which are equal. However, the number of rows and the number of columns may differ between the matrix in which weight values are arranged in the R and S directions included in the weight value group and each matrix included in the input data (see FIG. 2).
[0025] Output data is obtained by performing a convolution operation using the input data and the weight value group. The convolution operation is performed using the input data for each kernel included in the weight value group. Data (matrix) that will be the jth channel in the output data is obtained by performing a convolution operation between the input data and the jth (j is an integer between 1 and k) kernel. Therefore, when the input data and the first kernel 100 1 The convolution operation with 1 We also obtain the input data and the k-th kernel 100 k The data 200 that is the kth channel in the output data is obtained by convolution with k Thus, each kernel included in the weight value group corresponds to each channel in the output data. The number of kernels included in the weight value group is equal to the number of channels in the output data. As shown in FIG. 2, if the number of kernels included in the weight value group is k, the number of channels in the output data is also k.
[0026] Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
[0027] A neural network model conversion device according to an embodiment of the present invention divides a weight value group of a layer of a neural network model. The layer into which the weight value group is divided may be one or more layers. In each of the embodiments shown below, for simplicity of explanation, the description focuses on one layer into which the weight value group is divided. The layer into which the weight value group is divided is referred to as a layer to be divided. That is, although there may be multiple layers to be divided, the description focuses on one layer to be divided in each of the embodiments shown below.
[0028] Furthermore, dividing a weight value group means dividing the layer corresponding to that weight value group.
[0029] In addition, the layer to be divided is determined in advance. For example, the layer to be divided may be specified in advance by an administrator of the neural network model. At least one layer to be divided is determined.
[0030] In addition, the sparsity of the weights in the layer to be divided (the sparsity of the weights before division) is assumed to be less than a predetermined value. Furthermore, it is assumed that there exists a high-speed device that can perform a convolution operation between a weight group having a sparsity equal to or greater than the predetermined value and input data faster than a general device.
[0031] The layer to be segmented is not only segmented, but also transformed by adding layers that perform other processing, resulting in a transformation of the neural network model.
[0032] In each embodiment, it is assumed that the neural network model to be converted is input in advance to the neural network model conversion device of each embodiment.
[0033] Embodiment 1. In the first embodiment of the present invention, the number of kernels included in the weight value group of the division target layer is k. In the first embodiment, the weight values of 0 are unevenly distributed in the kernel direction in the weight value group of the division target layer. In this example, the first closest kernel contains more weight values of "0", and the kth closest kernel contains fewer weight values of "0". However, this form of uneven distribution is only an example. For example, the kernels do not have to be arranged in a strictly descending order based on the number of weight values "0". Also, for example, the kernels may be arranged in an ascending order based on the number of weight values "0".
[0034] Furthermore, in the first embodiment, the neural network model conversion device divides the weight value group in the kernel direction.
[0035] 3 is a block diagram showing an example of the configuration of a neural network model conversion device according to the first embodiment of the present invention. A neural network model conversion device 10 of this embodiment includes a division position determination unit 11, a division unit 12, and a coupling layer addition unit 13.
[0036] The division position determination unit 11 determines the division position in the weight value group of the division target layer. In this embodiment, the division position determination unit 11 determines the division position so as to divide the weight value group before division in the kernel direction. Therefore, in this embodiment, the division position determined is the boundary between kernels.
[0037] Here, the split position determination unit 11 determines the split positions so that at least one weight value group after splitting has a sparsity of a predetermined value or more. This predetermined value is the minimum sparsity value at which a high-speed device can speed up the layer calculation. That is, if the sparsity is equal to or more than the predetermined value, the high-speed device can speed up the layer calculation, and if the sparsity is less than the predetermined value, the high-speed device cannot speed up the layer calculation.
[0038] In each embodiment, a case will be described in which the division position determination unit determines one division position in the weight value group, and the division unit divides the weight value group into two weight value groups. However, in cases where there are multiple types of high-speed devices with different sparsity levels capable of high-speed processing, in each embodiment, the division position determination unit may determine two or more division positions in the weight value group, and the division unit may divide the weight value group into three or more weight value groups.
[0039] FIG. 4 is a schematic diagram showing an example of a division position when dividing a weight value group in the kernel direction. As described above, in this example, the closer the kernel is to the first, the more the weight value "0" is included, and the closer the kernel is to the kth, the fewer the weight value "0". In this case, the sparseness of the weight value group including the first to i-th kernels is equal to or greater than a predetermined value, and the sparseness of the weight value group including the i+1-th to k-th kernels is less than a predetermined value. In this case, the division position determination unit 11 determines the boundary between the i-th kernel and the i+1-th kernel as the division position (see FIG. 4).
[0040] The dividing unit 12 divides the weight value group at the division position determined by the division position determining unit 11. Fig. 5 is a schematic diagram showing an example of two weight value groups obtained by division. Each of the two weight value groups 71, 72 obtained by division corresponds to one layer. The fact that two weight value groups are obtained by division means that the layer to be divided has been divided into two layers.
[0041] The first weight value group 71 obtained by the division includes the first to i-th kernels in the weight value group before division, that is, the weight value group 71 includes i kernels.
[0042] Moreover, the second weight value group 72 obtained by the division includes the (i+1)th to the kth kernels in the weight value group before division. That is, the weight value group 72 includes ki kernels.
[0043] Moreover, the number of channels in the weight value groups 71 and 72 is common to each other, that is, c.
[0044] The input data to the layer to be divided is input to each layer after division, and a convolution operation is performed in each layer.
[0045] FIG. 6 is a schematic diagram showing an example of multiple output data obtained by a convolution operation between input data and each of weight value groups 71 and 72. As described above, the number of kernels included in a weight value group is equal to the number of channels of the output data. Therefore, the number of channels of output data 76 obtained by a convolution operation between input data and weight value group 71 (see FIG. 5) is i. These i channels correspond to the i kernels of weight value group 71. Moreover, the number of channels of output data 77 obtained by a convolution operation between input data and weight value group 72 (see FIG. 5) is ki. These ki channels correspond to the ki kernels of weight value group 72.
[0046] The connection layer adding unit 13 adds a connection layer to the neural network model. Specifically, the connection layer adding unit 13 adds a connection layer after each layer after division.
[0047] The combination layer is a layer that combines the output data obtained by the convolution operation between the input data to the layer to be divided and each weight value group after division into one output data. In this example, the combination layer adding unit 13 adds a combination layer after each layer after division that combines the output data 76, 77 (see FIG. 6) obtained by the convolution operation between the input data to the layer to be divided and each weight value group 71, 72 (see FIG. 5) into one output data.
[0048] When the weight group is not divided, the layer to be divided has one output data, and the number of channels of the output data is k.
[0049] On the other hand, when the weight value group is divided into two, two output data 76, 77 are obtained as shown in Fig. 6. The two output data 76, 77 shown in Fig. 6 cannot be used as is as input data to the layer next to the layer to be divided. By combining the output data 76, 77 shown in Fig. 6 into one output data in the combination layer, this one output data can be used as input data to the layer next to the layer to be divided.
[0050] In this embodiment, the coupling layer adding unit 13 adds a coupling layer that connects each output data 76, 77 in the channel direction so that the order of the kernels corresponds to the order of the channels of the output data corresponding to the kernels, thereby converting each output data into one output data. In this example, the coupling layer adding unit 13 adds a coupling layer that connects output data 77 having ki channels corresponding to each kernel from the i+1th to the kth kernels of the weight value group before division, following output data 76 having i channels corresponding to each kernel from the 1st to the ith kernels of the weight value group before division, in the channel direction, thereby converting each output data into one output data. FIG. 7 is a schematic diagram showing an example of one output data obtained in the coupling layer. As shown in FIG. 7, one output data obtained after the connection is output data having k channels.
[0051] The division position determination unit 11, the division unit 12, and the coupling layer addition unit 13 are realized by, for example, a CPU (Central Processing Unit) of a computer that operates according to a neural network model conversion program. For example, the CPU may read the neural network model conversion program from a program recording medium such as a program storage device of the computer, and operate as the division position determination unit 11, the division unit 12, and the coupling layer addition unit 13 according to the neural network model conversion program.
[0052] 8 is a flowchart showing an example of the process progress of the first embodiment of the present invention. Descriptions of matters that have already been explained will be omitted as appropriate.
[0053] First, the division position determination unit 11 determines a division position in the weight value group of the division target layer so that at least one weight value group after division has a sparsity degree equal to or greater than a predetermined value (step S1). This division position is the division position when the weight value group is divided in the kernel direction.
[0054] Next, the division unit 12 divides the weight value group of the division target layer in the kernel direction at the division positions determined in step S1 (step S2).
[0055] Next, the coupling layer adding unit 13 adds a coupling layer after each layer obtained by division (step S3). In the first embodiment, the process ends at step S3.
[0056] FIG. 9 is a schematic diagram showing the conversion of the division target layer in the first embodiment. The division target layer included in the given neural network model is converted into a first layer 81 and a second layer 82, and a coupling layer 83, which are obtained by the neural network model conversion device 10 of the first embodiment dividing the weight value group of the division target layer in the kernel direction. The sparseness of the first layer 81 is equal to or greater than a predetermined value, and the sparseness of the second layer 82 is less than a predetermined value. Therefore, the convolution operation between the input data and the weight value group of the first layer 81 is performed by a high-speed device, and the convolution operation between the input data and the weight value group of the second layer 82 is performed by a general device, thereby speeding up the operation using the neural network model. In addition, since the coupling layer 83 is also added, the output data of each of the first layer 81 and the second layer 82 can be combined into one output data, and the one output data is the same as the output data of the division target layer. Therefore, even if the division target layer is converted as shown in FIG. 9, the operation result of the neural network model as a whole does not change. Thus, neural network models can be transformed to facilitate efficient use of high speed devices.
[0057] Embodiment 2. The first embodiment is an embodiment that is applied when the weight values of the layer to be split are unevenly distributed in the kernel direction. In the weight values of the layer to be split, there are cases where the weight values of 0 are not unevenly distributed in the kernel direction. The second embodiment is an embodiment that can be applied when the weight values of the layer to be split are not unevenly distributed in the kernel direction. In the second embodiment, it is assumed that kernels containing many weight values "0" and kernels containing only a few weight values "0" are not arranged in order of the number of weight values "0" in the weight values of the layer to be split.
[0058] In the second embodiment, the number of kernels included in the weight value group of the division target layer is also assumed to be k. Also in the second embodiment, the neural network model conversion device divides the weight value group in the kernel direction.
[0059] Fig. 10 is a block diagram showing an example of the configuration of a neural network model conversion device according to the second embodiment of the present invention. Elements similar to those in the first embodiment are given the same reference numerals as those shown in Fig. 3. A neural network model conversion device 20 of this embodiment includes a kernel rearrangement unit 21, a division position determination unit 11, a division unit 12, a coupling layer addition unit 13, and an output data rearrangement layer addition unit 22.
[0060] The kernel sorting unit 21 sorts the kernels included in the weight value group before division of the division target layer according to a predetermined criterion. Specifically, the kernel sorting unit 21 sorts the kernels included in the weight value group based on the number of weight values "0" included in each kernel. More specifically, the kernel sorting unit 21 sorts the kernels included in the weight value group before division of the division target layer in descending or ascending order of the number of weight values that are 0. In the following, an example will be described in which the kernel sorting unit 21 sorts the kernels included in the weight value group before division in descending order of the number of weight values that are 0. However, the kernel sorting unit 21 may sort the kernels in ascending order of the number of weight values that are 0.
[0061] In addition, after rearranging the kernels included in the weight value group before division, the kernel rearrangement unit 21 sends rearrangement information indicating the order of each kernel before and after rearrangement to the output data rearrangement layer addition unit 22.
[0062] The operations of the split position determination unit 11, the split unit 12, and the coupled layer addition unit 13 are similar to those of the split position determination unit 11, the split unit 12, and the coupled layer addition unit 13 in the first embodiment. However, in the second embodiment, the split position determination unit 11, the split unit 12, and the coupled layer addition unit 13 perform processing based on a group of weight values after the kernel rearrangement by the kernel rearrangement unit 21.
[0063] The division position determination unit 11 determines the division position so that the weight value group after the kernel rearrangement by the kernel rearrangement unit 21 is divided in the kernel direction. At this time, the division position determination unit 11 determines the division position so that at least one weight value group after the division has a sparsity degree of a predetermined value or more. The kernel rearrangement unit 21 rearranges the kernels included in the weight value group before the division in descending order (or ascending order) of the number of weight values that are 0. As a result, for example, the first closest kernel contains more weight values "0", and the kth closest kernel contains fewer weight values "0". Therefore, the division position determination unit 11 can determine the division position so that at least one weight value group after the division has a sparsity degree of a predetermined value or more.
[0064] In the weight value group after the kernel rearrangement, the sparsity of the weight value group including the 1st to i-th kernels is equal to or greater than a predetermined value, and the sparsity of the weight value group including the i+1th to k-th kernels is less than a predetermined value. In this case, similar to the case shown in Fig. 4, the division position determination unit 11 determines the boundary between the i-th kernel and the i+1th kernel as the division position. However, the order of 1st, i-th, i+1th, k-th, etc. described here is the order of the kernels after the kernel rearrangement unit 21 rearranges the kernels.
[0065] The dividing unit 12 divides the weight value group at the division position determined by the division position determining unit 11. As a result, two weight value groups are obtained as shown in Fig. 5. Hereinafter, the second embodiment will also be described with reference to Figs. 5, 6 and 7 for convenience.
[0066] As described above, the fact that two sets of weight values are obtained by division means that the layer to be divided is divided into two layers.
[0067] A first weight value group 71 (see FIG. 5) obtained by dividing the weight value group after the kernel rearrangement includes the first to i-th kernels in the weight value group before division. That is, the weight value group 71 includes i kernels.
[0068] A second weight value group 72 (see FIG. 5) obtained by dividing the weight value group after the kernel rearrangement includes the (i+1)th to kth kernels in the weight value group before division. That is, the weight value group 72 includes ki kernels.
[0069] Moreover, the number of channels in the weight value groups 71 and 72 is common to each other, that is, c.
[0070] The input data to the layer to be divided is input to each layer after division, and a convolution operation is performed in each layer.
[0071] A convolution operation between the input data and the weight value group 71 (see FIG. 5) produces output data 76 (see FIG. 6) having i channels. A convolution operation between the input data and the weight value group 72 (see FIG. 5) produces output data 77 (see FIG. 6) having ki channels.
[0072] The coupling layer adding unit 13 adds a coupling layer that combines each output data 76, 77 in the channel direction to combine the output data into one output data (see FIG. 7) so that the order of the kernels after the rearrangement by the kernel rearrangement unit 21 corresponds to the order of the channels of the output data corresponding to the kernels. In this example, the coupling layer adding unit 13 adds a coupling layer that combines output data 77 having ki channels corresponding to each kernel from the i+1th to the kth kernels of the weight value group before division into one output data, following output data 76 having i channels corresponding to each kernel from the 1st to the ith kernels of the weight value group before division, in the channel direction. As described above, the order of 1st, ith, i+1th, kth, etc. is the order of the kernels after the kernel rearrangement by the kernel rearrangement unit 21.
[0073] Therefore, in the second embodiment, the order of the channels of the output data obtained in the connection layer corresponds to the order of the kernels after rearrangement by the kernel rearrangement unit 21.
[0074] The output data rearrangement layer adding unit 22 adds an output data rearrangement layer to the neural network model after the above-mentioned connection layer.
[0075] The output data rearrangement layer is a layer that rearranges channels of one output data obtained in the combination layer based on the change in the order of the kernels due to rearrangement by the kernel rearrangement unit 21, so that the order corresponds to the order of the kernels in the weight value group before the kernels are rearranged.
[0076] For example, assume that a kernel (assumed to be Q) that was first in the weight value group before the kernel rearrangement is rearranged to the p-th kernel by the kernel rearrangement unit 21. Originally, the channel of the output data corresponding to kernel Q is the first channel, but in one piece of output data obtained by the connection layer, the channel corresponding to kernel Q is the p-th channel. The output data rearrangement layer rearranges the p-th channel of the output data to the first channel. The output data rearrangement layer similarly rearranges each of the other channels.
[0077] The output data rearrangement layer adding unit 22 can determine, based on the above-mentioned rearrangement information, how to rearrange the channels of one output data obtained in the combined layer so that the order of the channels of the output data can correspond to the order of the kernels in the weight value group before the kernels are rearranged. Therefore, the output data rearrangement layer adding unit 22 creates an output data rearrangement layer that specifies how to rearrange the channels of the output data based on the rearrangement information, and adds the output data rearrangement layer after the above-mentioned combined layer.
[0078] In one piece of output data after the rearrangement of the channels by the output data rearrangement layer, the order of the channels corresponds to the order of the kernels before the rearrangement of the kernels by the kernel rearrangement unit 21. Therefore, the one piece of output data obtained by the output data rearrangement layer can be used as input data to the layer next to the layer to be divided.
[0079] The kernel sorting unit 21, the division position determination unit 11, the division unit 12, the connection layer addition unit 13, and the output data rearrangement layer addition unit 22 are realized by, for example, a CPU of a computer that operates according to a neural network model conversion program. For example, the CPU may read the neural network model conversion program from a program recording medium such as a program storage device of the computer, and operate as the kernel sorting unit 21, the division position determination unit 11, the division unit 12, the connection layer addition unit 13, and the output data rearrangement layer addition unit 22 according to the neural network model conversion program.
[0080] Fig. 11 is a flowchart showing an example of the process progress of the second embodiment of the present invention. Explanations of matters already explained will be omitted as appropriate. Steps S1 to S3 shown in Fig. 11 are similar to steps S1 to S3 (see Fig. 8) of the first embodiment, except that they are processes based on the weight value group after the kernel is rearranged, and explanations thereof will be omitted.
[0081] In the second embodiment, first, the kernel rearrangement unit 21 rearranges the kernels included in the weight value group of the splitting target layer based on the number of weight values "0" included in each kernel (step S11). For example, the kernel rearrangement unit 21 rearranges the kernels included in the weight value group of the splitting target layer in descending order of the number of weight values "0". In addition, the kernel rearrangement unit 21 sends rearrangement information indicating the order of each kernel included in the weight value group before and after rearrangement to the output data rearrangement layer addition unit 22.
[0082] After step S11, the neural network model conversion device 20 performs steps S1 to S3 based on the group of weight values after rearrangement of the kernels.
[0083] After step S3, the output data rearrangement layer adding unit 22 creates an output data rearrangement layer that rearranges a channel of one output data obtained in the combination layer so as to correspond to the order of the kernels in the weight value group before the kernel rearrangement, based on the above-mentioned rearrangement information.Then, the output data rearrangement layer adding unit 22 adds the output data rearrangement layer after the combination layer (step S12).In the second embodiment, the process ends at step S12.
[0084] FIG. 12 is a schematic diagram showing the conversion of the layer to be divided in the second embodiment. The first layer 91 and the second layer 92 are two layers obtained by dividing the weight value group after the kernel rearrangement by the dividing unit 12 (see FIG. 10). The sparsity of the first layer 91 is equal to or greater than a predetermined value, and the sparsity of the second layer 92 is less than a predetermined value. Therefore, the speed of the calculation using the neural network model can be increased by making a high-speed device execute the convolution calculation between the input data and the weight value group of the first layer 91, and making a general device execute the convolution calculation between the input data and the weight value group of the second layer 92. The combining layer 83 is the same as the combining layer 83 shown in FIG. 9, and combines the output data of the first layer 91 and the second layer 92 into one output data. The output data rearrangement layer 94 rearranges the order of the channels of the one output data so that the order of the channels of the one output data corresponds to the order of the kernels in the weight value group before the kernel rearrangement by the kernel rearrangement unit 21. One output data obtained by rearrangement of the channels is the same as the output data of the layer to be divided. Therefore, even if the layer to be divided is converted as shown in Fig. 12, the operation result of the neural network model as a whole does not change. Therefore, the neural network model can be converted so as to make it easier to effectively use high-speed devices.
[0085] Embodiment 3. Similarly to the second embodiment, the third embodiment is also applicable to a case where weight values that are 0 are not concentrated in the kernel direction in the group of weight values of the layer to be divided.
[0086] In the third embodiment, the number of kernels included in the weight value group of the split layer is k. In this case, the number of channels of the output data obtained in the split layer is k. The layer next to the split layer is referred to as the next layer. Here, the split layer is a convolution layer, and the convolution layer next to the split layer is referred to as the next layer, and the case where the split layer and the next layer are continuous is described as an example. If the neural network model is not converted, the next layer performs a convolution operation using the output data of the split layer as input data. The number of channels of the weight value group of the next layer is k because it is equal to the number of channels of the input data of the next layer. That is, the number of kernels included in the weight value group of the split layer, the number of channels of the output data of the split layer, and the number of channels included in the weight value group of the next layer are all k, as shown in FIG. 13.
[0087] Also in the third embodiment, the neural network model conversion device divides the weight value group of the division target layer in the kernel direction. Furthermore, in the third embodiment, the neural network model conversion device rearranges the channels of the next layer of the division target layer. That is, in the third embodiment, not only the division target layer but also the next layer of the division target layer is converted.
[0088] In the second embodiment, as shown in FIG. 12, an output data rearrangement layer 94 is added after the combination layer 83 so that the output data obtained by the output data rearrangement layer 94 is identical to the output data of the layer to be split.
[0089] On the other hand, in the third embodiment, the output data rearrangement layer 94 (see FIG. 12) is not added, and instead, as described above, the channels of the layer next to the layer to be divided are rearranged. This makes it possible to obtain output data from the layer next to the layer to be divided, which is the same as the output data of the layer next to the layer to be divided when the neural network model is not converted, from the layer with the channels rearranged.
[0090] Fig. 14 is a block diagram showing an example of the configuration of a neural network model conversion device according to the third embodiment of the present invention. Elements similar to those in the second embodiment are given the same reference numerals as those shown in Fig. 10. A neural network model conversion device 30 of this embodiment includes a kernel rearrangement unit 21, a next layer rearrangement unit 31, a division position determination unit 11, a division unit 12, and a coupling layer addition unit 13.
[0091] The operations of the kernel rearrangement unit 21, the division position determination unit 11, the division unit 12, and the connection layer addition unit 13 are similar to those of the kernel rearrangement unit 21, the division position determination unit 11, the division unit 12, and the connection layer addition unit 13 in the second embodiment. Therefore, a description of the operations of the kernel rearrangement unit 21, the division position determination unit 11, the division unit 12, and the connection layer addition unit 13 will be omitted. In addition, the neural network model conversion device 30 does not include the output data rearrangement layer addition unit 22 in the second embodiment.
[0092] Therefore, in the third embodiment, the layer to be divided is converted into a first layer 91, a second layer 92, and a combination layer 83 shown in Fig. 12. Also, the output data rearrangement layer 94 (see Fig. 12) is not provided.
[0093] As described above, the operation of the kernel rearrangement unit 21 is similar to the operation of the kernel rearrangement unit 21 in the second embodiment. However, in the third embodiment, the kernel rearrangement unit 21 rearranges the kernels included in the weight value group before division, and then transmits rearrangement information indicating the order of each kernel before and after rearrangement to the next-layer rearrangement unit 31.
[0094] Next layer rearrangement unit 31 rearranges the channels of the weight value group of the next layer to be divided, in accordance with the order of the kernels rearranged by kernel rearrangement unit 21.
[0095] In the next layer, a convolution operation is performed using the input data (in other words, one piece of output data obtained by the coupling layer added by the coupling layer adding unit 13) and the weight value group of the next layer. As described in the second embodiment, the order of the channels of the output data obtained by the coupling layer corresponds to the order of the kernels after rearrangement by the kernel rearrangement unit 21. Therefore, if the order of the channels of the weight value group of the next layer remains the original order, the channels of the input data to the next layer do not correspond to the channels of the weight value group of the next layer. As a result, the output data of the next layer will be different from the output data obtained in the next layer when the neural network model is not converted. Then, the operation result of the neural network model as a whole will also change.
[0096] To prevent this from happening, next layer rearrangement unit 31 rearranges the channels of the weight value group of the layer next to the layer to be divided, in accordance with the order of the kernels rearranged by kernel rearrangement unit 21.
[0097] For example, suppose that a kernel (Q) that was the first in the weight value group before the kernel rearrangement is rearranged to the p-th kernel by the kernel rearrangement unit 21. Then, in one output data (input data to the next layer) obtained in the coupling layer, the channel corresponding to the kernel Q is the p-th channel. Therefore, the next layer rearrangement unit 31 rearranges the first channel in the weight value group of the next layer to the p-th channel. The next layer rearrangement unit 31 similarly rearranges other channels of the weight value group of the next layer. As a result, each channel of the input data to the next layer (i.e., output data of the coupling layer) and each channel of the weight value group of the next layer correspond to each other. Then, although the output data obtained in the coupling layer is different from the output data obtained in the layer to be split, the output data obtained in the layer next to the layer to be split and the output data obtained in the layer next to the layer in which the channels are rearranged are the same. Therefore, even if the layer to be split and its next layer are transformed, the calculation result of the neural network model as a whole does not change.
[0098] The next layer rearrangement unit 31 may rearrange the channels of the weight value group of the next layer of the split target layer by referring to the above-mentioned rearrangement information when rearranging the channels of the weight value group of the next layer of the split target layer according to the order of the kernels rearranged by the kernel rearrangement unit 21. The rearrangement information indicates the order before and after rearrangement of each kernel included in the weight value group of the split target layer. Therefore, the next layer rearrangement unit 31 can rearrange the channels of the weight value group of the next layer of the split target layer so as to correspond to the order of the kernels after rearrangement based on the rearrangement information.
[0099] The kernel rearrangement unit 21, the next layer rearrangement unit 31, the division position determination unit 11, the division unit 12, and the connection layer addition unit 13 are realized by, for example, a CPU of a computer that operates according to a neural network model conversion program. For example, the CPU may read the neural network model conversion program from a program recording medium such as a program storage device of the computer, and operate as the kernel rearrangement unit 21, the next layer rearrangement unit 31, the division position determination unit 11, the division unit 12, and the connection layer addition unit 13 according to the neural network model conversion program.
[0100] Fig. 15 is a flowchart showing an example of the process progress of the third embodiment of the present invention. Explanation of matters already explained will be omitted. Step S11 and steps S1 to S3 shown in Fig. 15 are similar to steps S11 and steps S1 to S3 (see Fig. 11) in the second embodiment, and detailed explanation will be omitted.
[0101] First, the kernel rearrangement unit 21 rearranges the kernels included in the weight value group of the division target layer based on the number of weight values "0" included in each kernel (step S11). Then, the kernel rearrangement unit 21 sends rearrangement information indicating the order before and after rearrangement of each kernel included in the weight value group to the next layer rearrangement unit 31.
[0102] After step S11, the neural network model conversion device 30 performs steps S1 to S3 based on the group of weight values after rearrangement of the kernels.
[0103] After step S3, the next layer rearrangement unit 31 rearranges the channels of the weight value group of the next layer of the division target layer according to the order of the kernels rearranged in step S11 (step S13). At this time, the next layer rearrangement unit 31 may determine how to rearrange the channels based on the rearrangement information.
[0104] The neural network model conversion device 30 may execute step S13 between step S11 and step S1.
[0105] FIG. 16 is a schematic diagram showing the conversion of the layer to be divided and the next layer in the third embodiment. The same layers as those shown in FIG. 12 are given the same reference numerals as those in FIG. 12. In the third embodiment, the layer to be divided is converted into a first layer 91, a second layer 92, and a coupling layer 83. The next layer of the layer to be divided is converted into a next layer 95 after channel rearrangement by the next layer rearrangement unit 31. As already described with reference to FIG. 12, the convolution operation between the input data and the weight value group of the first layer 91 is performed by a high-speed device, and the convolution operation between the input data and the weight value group of the second layer 92 is performed by a general device, thereby speeding up the operation using the neural network model. In addition, the output data of the next layer when the neural network model is not converted and the output data of the next layer 95 after channel rearrangement are the same. Therefore, even if the layer to be divided and the next layer are converted as shown in FIG. 16, the operation result of the neural network model as a whole does not change. Thus, neural network models can be transformed to facilitate efficient use of high speed devices.
[0106] In addition, in a neural network model, a normalization layer or an activation function layer may generally exist between convolution layers. Even in such a case, the present embodiment can be applied without any problem. Specifically, for a layer without weights, such as an activation function layer, no special measures are required since it is not affected by rearrangement. On the other hand, for a layer with weights for each channel, such as a normalization layer (e.g., a batch normalization layer), the weight value group of this layer is rearranged based on rearrangement information by the next layer rearrangement unit 31 in the same way as the weight value group of the next layer, so that the output data of the next layer can be made the same as the output data of the next layer in the case where conversion of the neural network model is not performed. This point is also true when a normalization layer or an activation function layer exists between the layer to be divided (convolution layer) and the previous layer in the sixth embodiment described later. That is, even in the sixth embodiment described later, when a layer with a weight value group, such as a normalization layer, exists between the layer to be divided and the previous layer, the weight value group of the layer may be rearranged based on rearrangement information in the same way as the weight value group of the previous layer.
[0107] Embodiment 4. In the fourth embodiment of the present invention, the number of channels included in the weight value group of the division target layer is c, and the number of kernels is k. In addition, in the fourth embodiment, the weight values of 0 are unevenly distributed in the channel direction in the weight value group of the division target layer. In this example, the closest channel contains more weight values of "0", and the closest channel to the cth channel contains fewer weight values of "0". However, this type of uneven distribution is only an example. For example, the channels do not have to be arranged in a strictly descending order based on the number of weight values "0". Also, for example, the channels may be arranged in an ascending order based on the number of weight values "0".
[0108] Moreover, in the fourth embodiment, the neural network model conversion device divides the weight value group in the channel direction.
[0109] 17 is a block diagram showing an example of the configuration of a neural network model conversion device according to the fourth embodiment of the present invention. A neural network model conversion device 40 of this embodiment includes a division position determination unit 41, a division unit 42, and a coupling layer addition unit 43.
[0110] The division position determination unit 41 determines a division position in the weight value group of the division target layer. In this embodiment, the division position determination unit 41 determines the division position so as to divide the weight value group before division in the channel direction. Therefore, in this embodiment, the division position determined is the boundary between channels.
[0111] Here, the splitting position determination unit 41 determines the splitting positions so that at least one weight value group after splitting has a sparsity degree equal to or greater than a predetermined value. This predetermined value is the minimum sparsity degree value that allows a high-speed device to speed up the calculation of the layer.
[0112] FIG. 18 is a schematic diagram showing an example of a division position when dividing a weight value group in the channel direction. As described above, in this example, the closer to the first channel, the more weight value "0" is included, and the closer to the cth channel, the fewer the number of weight values "0". In this case, the sparseness of the weight value group including the first to i-th channels is equal to or greater than a predetermined value, and the sparseness of the weight value group including the i+1-th to c-th channels is less than a predetermined value. In this case, the division position determination unit 41 determines the boundary between the i-th channel and the i+1-th channel as the division position (see FIG. 18).
[0113] The dividing unit 42 divides the weight value group at the division position determined by the division position determining unit 41. Fig. 19 is a schematic diagram showing an example of two weight value groups obtained by division. Each of the two weight value groups 171, 172 obtained by division corresponds to one layer. As already explained, the fact that two weight value groups are obtained by division means that the layer to be divided has been divided into two layers.
[0114] The first weight value group 171 obtained by the division includes the first to i-th channels in the weight value groups before division, that is, the weight value group 171 includes i channels.
[0115] Moreover, second weight value group 172 obtained by division includes channels (i+1) to (c) in the weight value group before division. That is, weight value group 172 includes ci channels.
[0116] The weight value groups 171 and 172 each have a common number of kernels, k.
[0117] Moreover, each of the weight value groups 171, 172 after division has information indicating which channel before division the group contains corresponds to. Hereinafter, this information will be referred to as channel information. For example, the weight value group 171 has channel information indicating the 1st to i-th channels. Moreover, the weight value group 172 has channel information indicating the i+1th to c-th channels. For example, the division unit 42 may assign the channel information to each weight value group after division.
[0118] Input data to the layer to be divided is input to each layer after division, and a convolution operation is performed in each layer. At this time, in the convolution operation between the input data and the weight value group 171, channels (1st to i-th channels) corresponding to the channels indicated by the channel information of the weight value group 171 are extracted from the input data, and a convolution operation is performed between the data consisting of the extracted i channels and the weight value group 171. Similarly, in the convolution operation between the input data and the weight value group 172, channels (i+1th to c-th channels) corresponding to the channels indicated by the channel information of the weight value group 172 are extracted from the input data, and a convolution operation is performed between the data consisting of the extracted ci channels and the weight value group 172.
[0119] FIG. 20 is a schematic diagram showing an example of a plurality of output data obtained by a convolution operation between the input data and each of the weight value groups 171 and 172. As described above, the number of kernels included in the weight value group is equal to the number of channels of the output data. The number of kernels included in the weight value group 171 and the number of kernels included in the weight value group 172 are common to each other, k (see FIG. 19). Therefore, the number of channels of the output data 176 obtained by the convolution operation between the input data and the weight value group 171 is k. Furthermore, the number of channels of the output data 177 obtained by the convolution operation between the input data and the weight value group 172 is k. Therefore, the number of channels of the plurality of output data 176 and 177 is common to each other, k, and the plurality of output data 176 and 177 have a common configuration. Therefore, each element of the output data 176 and each element of the output data 177 are in one-to-one correspondence.
[0120] The connection layer adding unit 43 adds a connection layer to the neural network model. Specifically, the connection layer adding unit 43 adds a connection layer after each layer after division.
[0121] As already described, the combining layer is a layer that combines the output data obtained by the convolution operation between the input data to the division target layer and each weight value group after division to generate one output data. However, the combining layer in the fourth embodiment is a combining layer that derives one output data by adding corresponding elements in each output data. For example, when the output data 176, 177 shown in FIG. 20 is obtained, the corresponding elements of the output data 176, 177 are added, and one output data having the sum result as an element is derived by the combining layer. The configuration of this one output data is the same as the configuration of the output data 176, 177.
[0122] Fig. 21 is a schematic diagram showing an example of one output data obtained in the combination layer. As shown in Fig. 21, one output data obtained in the combination layer has k channels. One data obtained in the combination layer is the same as one data obtained in the division target layer.
[0123] The division position determination unit 41, the division unit 42, and the coupling layer addition unit 43 are realized by, for example, a CPU of a computer that operates according to a neural network model conversion program. For example, the CPU may read the neural network model conversion program from a program recording medium such as a program storage device of the computer, and operate as the division position determination unit 41, the division unit 42, and the coupling layer addition unit 43 according to the neural network model conversion program.
[0124] 22 is a flowchart showing an example of the progress of processing in the fourth embodiment of the present invention. Descriptions of matters that have already been explained will be omitted as appropriate.
[0125] First, the division position determination unit 41 determines a division position in the weight value group of the division target layer so that at least one weight value group after division has a sparsity degree equal to or greater than a predetermined value (step S41). This division position is a division position when the weight value group is divided in the channel direction.
[0126] Next, the dividing unit 42 divides the weight value group of the division target layer in the channel direction at the division position determined in step S41 (step S42).
[0127] Next, the combined layer adding unit 43 adds a combined layer after each layer obtained by division (step S43). This combined layer is a combined layer that derives one output data by adding corresponding elements in each output data. In the fourth embodiment, the process ends at step S43.
[0128] FIG. 23 is a schematic diagram showing the conversion of the division target layer in the fourth embodiment. The division target layer included in the given neural network model is converted into a first layer 181, a second layer 182, and a coupling layer 183 obtained by dividing the weight value group of the division target layer in the channel direction by the neural network model conversion device 40 of the fourth embodiment. The sparsity of the first layer 181 is equal to or greater than a predetermined value, and the sparsity of the second layer 182 is less than a predetermined value. Therefore, the convolution operation between the input data and the weight value group of the first layer 181 is performed by a high-speed device, and the convolution operation between the input data and the weight value group of the second layer 182 is performed by a general device, thereby speeding up the operation using the neural network model. In addition, the coupling layer 183 is also added, so that the output data of each of the first layer 181 and the second layer 182 can be combined into one output data, and the one output data is the same as the output data of the division target layer. Therefore, even if the layer to be divided is converted as shown in Fig. 23, the operation result of the neural network model as a whole does not change. Therefore, the neural network model can be converted so as to facilitate effective use of high-speed devices.
[0129] Embodiment 5. The fourth embodiment is an embodiment that is applied when the weight values of the layer to be split are unevenly distributed in the channel direction in the weight value group of the layer to be split. There are also cases where the weight values of the layer to be split are unevenly distributed in the channel direction in the weight value group of the layer to be split. The fifth embodiment is an embodiment that can be applied when the weight values of the layer to be split are unevenly distributed in the channel direction in the weight value group of the layer to be split. In the fifth embodiment, it is assumed that the channels that contain many weight values "0" and the channels that contain only a few weight values "0" are not arranged in order of the number of weight values "0" in the weight value group of the layer to be split.
[0130] In the fifth embodiment, the number of channels included in the weight value group of the division target layer is c, and the number of kernels is k. The neural network model conversion device of the fifth embodiment divides the weight value group in the channel direction, as in the fourth embodiment.
[0131] Fig. 24 is a block diagram showing a configuration example of a neural network model conversion device according to the fifth embodiment of the present invention. Elements similar to those in the fourth embodiment are given the same reference numerals as those shown in Fig. 17. A neural network model conversion device 50 of this embodiment includes a channel rearrangement unit 51, a division position determination unit 41, a division unit 42, a coupling layer addition unit 43, and an input data rearrangement layer addition unit 52.
[0132] The channel rearrangement unit 51 rearranges the channels included in the weight value group before division of the division target layer according to a predetermined criterion. Specifically, the channel rearrangement unit 51 rearranges the channels included in the weight value group based on the number of weight values "0" included in each channel. More specifically, the channel rearrangement unit 51 rearranges the channels included in the weight value group before division of the division target layer in descending or ascending order of the number of weight values that are 0. In the following, an example will be described in which the channel rearrangement unit 51 rearranges the channels included in the weight value group before division in descending order of the number of weight values that are 0. However, the channel rearrangement unit 51 may rearrange the channels in ascending order of the number of weight values that are 0.
[0133] Furthermore, after rearranging the channels included in the weight value group before division, the channel rearrangement unit 51 sends rearrangement information indicating the order of each channel before and after rearrangement to the input data rearrangement layer addition unit 52.
[0134] The operations of the division position determination unit 41, the division unit 42, and the combination layer addition unit 43 are similar to those of the division position determination unit 41, the division unit 42, and the combination layer addition unit 43 in the fourth embodiment. However, in the fifth embodiment, the division position determination unit 41, the division unit 42, and the combination layer addition unit 43 perform processing based on a weight value group after the channel rearrangement unit 51 rearranges the channels.
[0135] The division position determination unit 41 determines the division position so as to divide the weight value group after the channel rearrangement by the channel rearrangement unit 51 in the channel direction. At this time, the division position determination unit 41 determines the division position so that at least one weight value group after the division has a sparsity degree of a predetermined value or more. The channel rearrangement unit 51 rearranges the channels included in the weight value group before the division in descending order (or ascending order) of the number of weight values that are 0. As a result, for example, the first closest channel contains more weight values "0", and the cth closest channel contains fewer weight values "0". Therefore, the division position determination unit 41 can determine the division position so that at least one weight value group after the division has a sparsity degree of a predetermined value or more.
[0136] In the weight value group after the rearrangement of the channels, the sparseness of the weight value group including the 1st to i-th channels is equal to or greater than a predetermined value, and the sparseness of the weight value group including the i+1th to c-th channels is less than a predetermined value. In this case, similar to the case shown in Fig. 18, the division position determination unit 41 determines the boundary between the i-th channel and the i+1th channel as the division position. However, the order of 1st, i-th, i+1th, c-th, etc. described here is the order of the channels after the rearrangement of the channels by the channel rearrangement unit 51.
[0137] The dividing unit 42 divides the weight value group at the division position determined by the division position determining unit 41. As a result, two weight value groups are obtained as shown in Fig. 19. Hereinafter, the fifth embodiment will also be described with reference to Figs. 19, 20, and 21 for convenience.
[0138] A first weight value group 171 (see FIG. 19) obtained by dividing the weight value group after rearrangement of the channels includes the first to i-th channels in the weight value group before division. That is, weight value group 171 includes i channels. Weight value group 171 also has channel information. The channel information has been explained in the fourth embodiment, so an explanation of it will be omitted here. In this example, weight value group 171 has channel information indicating the first to i-th channels.
[0139] Moreover, a second weight value group 172 (see FIG. 19) obtained by dividing the weight value group after rearrangement of the channels includes the i+1th to cth channels in the weight value group before division. That is, weight value group 172 includes ci channels. Moreover, weight value group 172 has channel information. In this example, weight value group 172 has channel information indicating the i+1th to cth channels.
[0140] The channel information may be assigned to each weight value group after division by the division unit 42, for example.
[0141] The convolution operation between the weighting value group having channel information and the input data has been described in the fourth embodiment, and therefore will not be described here.
[0142] The weight value groups 171 and 172 each have a common number of kernels, k.
[0143] In this embodiment, the channel order of the input data to the layer to be divided is rearranged by an input data rearrangement layer described later. The input data with the rearranged channel order is input to each layer after division, and a convolution operation is performed in each layer. The input data rearrangement layer that rearranges the channel order of the input data will be described later.
[0144] A convolution operation between the input data in which the channels have been rearranged and weight value group 171 (see FIG. 19) produces output data 176 (see FIG. 20) having k channels. A convolution operation between the input data in which the channels have been rearranged and weight value group 172 (see FIG. 19) produces output data 177 (see FIG. 20) having k channels.
[0145] The combined layer adding unit 43 adds a combined layer after each layer after division. The combined layer in this embodiment is the same as the combined layer in the fourth embodiment. That is, the combined layer in this embodiment is a combined layer that derives one output data (see FIG. 21) by adding corresponding elements in each output data obtained in each layer after division.
[0146] The input data rearrangement layer adding unit 52 adds an input data rearrangement layer before the multiple layers obtained by dividing the weight value group of the division target layer. The input data rearrangement layer is a layer that rearranges the channels of the input data to the division target layer according to the order of the channels rearranged by the channel rearrangement unit 51. For example, it is assumed that the channel rearrangement unit 51 rearranges the first channel of the weight value group of the division target layer to the qth channel. In this case, the input data rearrangement layer rearranges the first channel of the input data to the qth channel. The input data rearrangement layer also rearranges the other channels of the input data according to the order of the channels rearranged by the channel rearrangement unit 51.
[0147] The input data rearrangement layer adding unit 52 creates an input data rearrangement layer with reference to the rearrangement information. The rearrangement information in this embodiment is information indicating the order before and after rearrangement of each channel included in the weight value group of the division target layer. Therefore, the input data rearrangement layer adding unit 52 can create an input data rearrangement layer with reference to the rearrangement information. As described above, the input data rearrangement layer adding unit 52 adds an input data rearrangement layer before the multiple layers obtained by dividing the weight value group.
[0148] The input data rearrangement layer rearranges the order of the channels of the input data to the layer to be divided according to the order of the channels of the weight value group rearranged by the channel rearrangement unit 51. The input data whose channels have been rearranged in this manner is input to each layer obtained by dividing the weight value group of the layer to be divided, and a convolution operation is performed in each layer.
[0149] In the fifth embodiment, the channel rearrangement unit 51 rearranges the order of the channels of the weight value group of the layer to be split, and the input data rearrangement layer addition unit 52 adds an input data rearrangement layer that rearranges the channels of the input data according to the order. Therefore, the output data obtained in the combination layer of this embodiment is the same as the output data obtained in the layer to be split. Therefore, one output data obtained in the combination layer can be used as input data to the layer next to the layer to be split.
[0150] The channel rearrangement unit 51, the division position determination unit 41, the division unit 42, the coupling layer addition unit 43, and the input data rearrangement layer addition unit 52 are realized by, for example, a CPU of a computer that operates according to a neural network model conversion program. For example, the CPU may read the neural network model conversion program from a program recording medium such as a program storage device of the computer, and operate as the channel rearrangement unit 51, the division position determination unit 41, the division unit 42, the coupling layer addition unit 43, and the input data rearrangement layer addition unit 52 according to the neural network model conversion program.
[0151] Fig. 25 is a flowchart showing an example of the progress of processing in the fifth embodiment of the present invention. Explanations of matters already explained will be omitted as appropriate. Also, steps S41 to S43 shown in Fig. 25 are similar to steps S41 to S43 (see Fig. 22) in the fourth embodiment, except that they are processes based on the weight value group after rearrangement of the channels, and explanations thereof will be omitted.
[0152] In the fifth embodiment, first, the channel rearrangement unit 51 rearranges the channels included in the weight value group of the division target layer based on the number of weight values "0" included in each channel (step S51). For example, the channel rearrangement unit 51 rearranges the channels included in the weight value group of the division target layer in descending order of the number of weight values "0". In addition, the channel rearrangement unit 51 sends rearrangement information indicating the order before and after rearrangement of each channel included in the weight value group to the input data rearrangement layer addition unit 52.
[0153] After step S51, the neural network model conversion device 50 performs steps S41 to S43 based on the group of weight values after rearrangement of the channels.
[0154] After step S43, the input data rearrangement layer adding unit 52 creates an input data rearrangement layer that rearranges the channels of the input data according to the order of the channels rearranged in step S51, based on the rearrangement information.Then, the input data rearrangement layer adding unit 52 adds an input data rearrangement layer before the multiple layers obtained by dividing the weight value group (step S52).In the fifth embodiment, the process ends at step S52.
[0155] FIG. 26 is a schematic diagram showing the conversion of the layer to be divided in the fifth embodiment. The first layer 191 and the second layer 192 are two layers obtained by dividing the weight value group after the rearrangement of the channels by the division unit 42 (see FIG. 24). The sparseness of the first layer 191 is equal to or greater than a predetermined value, and the sparseness of the second layer 192 is less than a predetermined value. Therefore, the speed of the calculation using the neural network model can be increased by making a high-speed device execute a convolution calculation between the input data in which the channels have been rearranged and the weight value group of the first layer 191, and making a general device execute a convolution calculation between the input data in which the channels have been rearranged and the weight value group of the second layer 192. The combination layer 183 is the same as the combination layer 183 shown in FIG. 23, and combines the output data of the first layer 191 and the second layer 192 into one output data. Furthermore, the input data rearrangement layer 194 rearranges the channels of the input data according to the order of the channels of the weight value group rearranged by the channel rearrangement unit 51. As a result, one piece of output data obtained in the coupling layer 183 is the same as the output data of the layer to be split. Therefore, even if the layer to be split is converted as shown in FIG. 26, the calculation result of the neural network model as a whole does not change. Therefore, the neural network model can be converted so as to facilitate effective use of high-speed devices.
[0156] Embodiment 6. Similarly to the fifth embodiment, the sixth embodiment is also applicable to a case where the weight values that are 0 are not unevenly distributed in the channel direction in the weight value group of the division target layer.
[0157] In the sixth embodiment, the number of channels included in the weight value group of the division target layer is also assumed to be c.
[0158] As described in the third embodiment, the number of kernels included in the weight value group of the splitting layer, the number of channels of the output data of the splitting layer, and the number of channels included in the weight value group of the next layer are common (see FIG. 13). It is assumed that the "next layer" in the third embodiment is the splitting layer, and the layer immediately preceding the splitting layer (hereinafter, referred to as the previous layer) is considered. In this case, as shown in FIG. 27, the number of channels included in the weight value group of the splitting layer, the number of channels of the input data to the splitting layer (in other words, the output data of the previous layer), and the number of kernels included in the weight value group of the previous layer are all c, which are common. Note that here, it is assumed that the splitting layer is a convolutional layer, and the convolutional layer preceding the splitting layer is referred to as the previous layer, and a case where the previous layer and the splitting layer are continuous will be described as an example.
[0159] In the sixth embodiment, the neural network model conversion device also divides the weight value group of the division target layer in the channel direction. Furthermore, in the sixth embodiment, the neural network model conversion device rearranges the kernel of the previous layer of the division target layer. That is, in the sixth embodiment, not only the division target layer but also the previous layer of the division target layer is converted.
[0160] In the fifth embodiment, as shown in FIG. 26, an input data rearrangement layer 194 is added before the first layer 191 and the second layer 192, so that the output data obtained in the combination layer 183 is identical to the output data of the layer to be divided.
[0161] On the other hand, in the sixth embodiment, the input data rearrangement layer 194 (see FIG. 26) is not added, and instead, as described above, the kernels of the layer before the layer to be divided are rearranged. This makes it possible to obtain from the combination layer the same data as the output data of the layer to be divided when no conversion of the neural network model is performed.
[0162] Fig. 28 is a block diagram showing a configuration example of a neural network model conversion device according to the sixth embodiment of the present invention. Elements similar to those in the fifth embodiment are given the same reference numerals as those shown in Fig. 24. A neural network model conversion device 60 according to this embodiment includes a channel rearrangement unit 51, a front layer rearrangement unit 61, a division position determination unit 41, a division unit 42, and a coupling layer addition unit 43.
[0163] The operations of the channel rearrangement unit 51, the division position determination unit 41, the division unit 42, and the combination layer addition unit 43 are similar to those of the channel rearrangement unit 51, the division position determination unit 41, the division unit 42, and the combination layer addition unit 43 in the fifth embodiment. Therefore, a description of the operations of the channel rearrangement unit 51, the division position determination unit 41, the division unit 42, and the combination layer addition unit 43 will be omitted. In addition, the neural network model conversion device 60 does not include the input data rearrangement layer addition unit 52 in the fifth embodiment.
[0164] Therefore, in the sixth embodiment, the layer to be divided is converted into a first layer 191, a second layer 192, and a combination layer 183 shown in Fig. 26. Also, the input data rearrangement layer 194 (see Fig. 26) is not provided.
[0165] As described above, the operation of the channel rearrangement unit 51 is similar to that of the channel rearrangement unit 51 in the fifth embodiment. However, in the sixth embodiment, the channel rearrangement unit 51 rearranges the channels included in the weight value group before division, and then transmits rearrangement information indicating the order of each channel before and after rearrangement to the front-layer rearrangement unit 61.
[0166] The front layer rearrangement unit 61 rearranges the kernels of the weight value group of the front layer of the layer to be divided, in accordance with the order of the channels rearranged by the channel rearrangement unit 51.
[0167] For example, suppose that the channel rearrangement unit 51 rearranges the first channel of the weight value group of the division target layer to the qth channel. In this case, the previous layer rearrangement unit 61 rearranges the first kernel of the weight value group of the previous layer to the qth kernel. The previous layer rearrangement unit 61 also rearranges the other kernels of the weight value group of the previous layer according to the order of the channels rearranged by the channel rearrangement unit 51.
[0168] Each kernel of the weight value group of the previous layer corresponds to each channel of the output data of the previous layer. Therefore, by rearranging the order of the kernels included in the weight value group of the previous layer according to the order of the channels rearranged by the channel rearrangement unit 51, the output data of the previous layer becomes the same as the input data obtained in the input data rearrangement layer in the fifth embodiment. Then, each layer and the combined layer obtained by division are processed based on the output data of the previous layer, so that the output data of the combined layer in this embodiment becomes the same as the output data of the combined layer in the fifth embodiment. Therefore, the output data of the combined layer in this embodiment can be used as input data to the layer next to the layer to be divided.
[0169] The previous layer rearrangement unit 61 may rearrange the kernels of the weight value group of the previous layer of the splitting target layer in accordance with the order of the channels rearranged by the channel rearrangement unit 51, by referring to the above-mentioned rearrangement information. The rearrangement information indicates the order before and after rearrangement of each channel included in the weight value group of the splitting target layer. Therefore, the previous layer rearrangement unit 61 can rearrange the kernels included in the weight value group of the previous layer of the splitting target layer in accordance with the order of the channels after rearrangement, based on the rearrangement information.
[0170] The channel rearrangement unit 51, the front layer rearrangement unit 61, the division position determination unit 41, the division unit 42, and the connection layer addition unit 43 are realized by, for example, a CPU of a computer that operates according to a neural network model conversion program. For example, the CPU may read the neural network model conversion program from a program recording medium such as a program storage device of the computer, and operate as the channel rearrangement unit 51, the front layer rearrangement unit 61, the division position determination unit 41, the division unit 42, and the connection layer addition unit 43 according to the neural network model conversion program.
[0171] Fig. 29 is a flowchart showing an example of the process progress of the sixth embodiment of the present invention. Explanation of matters already explained will be omitted. Step S51 and steps S41 to S43 shown in Fig. 29 are similar to step S51 and steps S41 to S43 (see Fig. 25) in the fifth embodiment, and detailed explanation will be omitted.
[0172] First, the channel rearrangement unit 51 rearranges the channels included in the weight value group of the division target layer based on the number of weight values "0" included in each channel (step S51). Then, the channel rearrangement unit 51 sends rearrangement information indicating the order before and after rearrangement of each channel included in the weight value group to the previous layer rearrangement unit 61.
[0173] After step S51, the neural network model conversion device 60 performs steps S41 to S43 based on the group of weight values after rearrangement of the channels.
[0174] After step S43, the previous layer rearrangement unit 61 rearranges the kernels of the weight value group of the previous layer of the division target layer according to the order of the channels rearranged in step S51 (step S53). At this time, the previous layer rearrangement unit 61 may determine how to rearrange the kernels based on the rearrangement information.
[0175] The neural network model conversion device 60 may execute step S53 between step S51 and step S41.
[0176] FIG. 30 is a schematic diagram showing the conversion of the layer to be split and the previous layer in the sixth embodiment. The same layers as those shown in FIG. 26 are given the same reference numerals as those in FIG. 26. In the sixth embodiment, the layer to be split is converted into a first layer 191, a second layer 192, and a coupling layer 183. The previous layer of the layer to be split is converted into a previous layer 195 after kernel sorting by the previous layer sorting unit 61. The convolution operation between the input data and the weight value group of the first layer 191 is performed by a high-speed device, and the convolution operation between the input data and the weight value group of the second layer 192 is performed by a general device, thereby speeding up the operation using the neural network model. In addition, since the previous layer 195 after kernel sorting is provided, the output data of the layer to be split in the case where the conversion of the neural network model is not performed and the output data obtained by the coupling layer 183 are the same. Therefore, even if the layer to be split and the previous layer are converted as shown in FIG. 30, the operation result of the neural network model as a whole does not change. Thus, neural network models can be transformed to facilitate efficient use of high speed devices.
[0177] In addition, there may be a plurality of layers to be divided in the neural network model. Different embodiments of the present invention may be applied to different layers to be divided. However, it is not possible to define a plurality of layers to be divided such that the "next layer" of the third embodiment overlaps with the "previous layer" of the sixth embodiment.
[0178] 31 is a schematic block diagram showing an example of the configuration of a computer relating to the neural network model conversion device of the embodiment of the present invention. The computer 1000 includes a CPU 1001, a main memory device 1002, an auxiliary memory device 1003, and an interface 1004.
[0179] The neural network model conversion device of each embodiment of the present invention is realized, for example, by a computer 1000. The operation of the neural network model conversion device is stored in the form of a neural network model conversion program in an auxiliary storage device 1003. A CPU 1001 reads out the program, loads the program in a main storage device 1002, and executes the processes described in each of the above embodiments in accordance with the program.
[0180] The auxiliary storage device 1003 is an example of a non-transient tangible medium. Other examples of non-transient tangible media include a magnetic disk, a magneto-optical disk, a CD-ROM (Compact Disk Read Only Memory), a DVD-ROM (Digital Versatile Disk Read Only Memory), a semiconductor memory, and the like, which are connected via the interface 1004. In addition, when a program is distributed to the computer 1000 via a communication line, the computer 1000 that receives the program may load the program into the main storage device 1002 and execute the processes described in the above embodiments according to the program.
[0181] In addition, some or all of the components may be realized by general-purpose or dedicated circuits, processors, etc., or a combination of these. These may be configured by a single chip, or may be configured by multiple chips connected via a bus. Some or all of the components may be realized by a combination of the above-mentioned circuits, etc., and programs.
[0182] When some or all of the components are realized by a plurality of information processing devices, circuits, etc., the plurality of information processing devices, circuits, etc. may be centrally or distributed. For example, the information processing devices, circuits, etc. may be realized as a client-server system, a cloud computing system, etc., in a form in which each is connected via a communication network.
[0183] Next, an overview of the present invention will be described. Fig. 32 is a block diagram showing an overview of the neural network model conversion device of the present invention. The neural network model conversion device of the present invention comprises a division position determination means 701, a division means 702, and a connection layer addition means 703.
[0184] The splitting position determination means 701 (e.g., splitting position determination unit 11, splitting position determination unit 41) determines a splitting position in a weight value group of at least one layer included in a given neural network model, the weight value group having a configuration in which kernels obtained by arranging at least one weight value in the channel direction are arranged in the kernel direction.
[0185] The division means 702 (for example, the division unit 12 or the division unit 42) obtains a plurality of weight value groups by dividing the weight value group at the division position.
[0186] A coupling layer adding means 703 (e.g., coupling layer adding unit 13, coupling layer adding unit 43) adds a coupling layer that combines each output data obtained by calculation between the input data to that layer and each group of weight values after division into one output data.
[0187] Then, the division position determination means 701 determines a division position in the weight value group before division so that at least one weight value group after division has a sparsity of a predetermined value or more, where the sparsity is the ratio of the number of weight values that are 0 to the number of weight values included in the weight value group.
[0188] Such an arrangement allows the neural network model to be transformed to facilitate efficient use of high speed devices.
[0189] The above-described embodiment of the present invention can be described as follows, but is not limited to the following.
[0190] (Appendix 1) a division position determination means for determining a division position in a weight value group of at least one layer included in a given neural network model, the weight value group having a configuration in which kernels obtained by arranging at least one or more weight values in a channel direction are arranged in a kernel direction; a division means for dividing the weight value group at the division position to obtain a plurality of weight value groups; a combination layer adding means for adding a combination layer that combines each output data obtained by a calculation between the input data to the layer and each weight value group after division into one output data, The division position determination means determines division positions in the weight value groups before division such that at least one weight value group after division has a sparsity of a predetermined value or more, where the sparsity is a ratio of the number of weight values that are 0 to the number of weight values included in the weight value groups. A neural network model conversion device comprising:
[0191] (Appendix 2) the division position determination means determines a division position so as to divide the weight value group before division in a kernel direction; The dividing means divides the weight value group before division at the division position, The coupling layer adding means adds a coupling layer that connects each output data obtained by the operation between the input data and each weight value group after division in a channel direction to form one output data. 2. A neural network model conversion device according to claim 1.
[0192] (Appendix 3) a kernel sorting means for sorting kernels included in the weight value group before division according to a predetermined criterion; the division position determination means determines a division position so as to divide the weight value group after the kernel rearrangement in the kernel direction; The dividing means divides the weight value group before division at the division position, the coupling layer adding means adds a coupling layer that connects each output data obtained by an operation between the input data and each of the weight value groups after division in a channel direction to form one output data; and an output data rearrangement layer adding means for adding an output data rearrangement layer that rearranges channels of the one output data, based on a change in the order of the kernels due to the rearrangement by the kernel rearrangement means, so as to correspond to the order of the kernels in the weight value group before the rearrangement of the kernels. 3. The neural network model conversion device according to claim 1 or 2.
[0193] (Appendix 4) A kernel sorting means for sorting kernels included in the weight value group before division according to a predetermined criterion; a next layer sorting means for sorting channels of a weight value group of a layer next to the layer into which the weight value group is divided, according to the order of the kernels sorted by the kernel sorting means; the division position determination means determines a division position so as to divide the weight value group after the kernel rearrangement in the kernel direction; The dividing means divides the weight value group before division at the division position, The coupling layer adding means adds a coupling layer that connects each output data obtained by the operation between the input data and each weight value group after division in a channel direction to form one output data. 3. The neural network model conversion device according to claim 1 or 2.
[0194] (Appendix 5) The kernel sorting means sorts the kernels included in the weight value group before division in descending or ascending order of the number of weight values that are 0. 5. The neural network model conversion device according to claim 3 or 4.
[0195] (Appendix 6) the division position determination means determines a division position such that the weight value group before division is divided in the channel direction; The dividing means divides the weight value group before division at the division position, The coupling layer adding means adds a coupling layer that derives one output data by adding corresponding elements in each output data obtained by an operation between the input data and each weight value group after division. 2. A neural network model conversion device according to claim 1.
[0196] (Appendix 7) a channel sorting means for sorting channels included in the weight value group before division according to a predetermined criterion; an input data rearrangement layer adding means for adding an input data rearrangement layer that rearranges the channels of the input data in accordance with the order of the channels rearranged by the channel rearrangement means; the division position determination means determines a division position so as to divide the group of weight values after rearrangement of the channels in the channel direction; The dividing means divides the weight value group before division at the division position, The coupling layer adding means adds a coupling layer that derives one output data by adding corresponding elements in each output data obtained by an operation between the input data and each weight value group after division. 7. The neural network model conversion device according to claim 1 or 6.
[0197] (Appendix 8) a channel sorting means for sorting channels included in the weight value group before division according to a predetermined criterion; a previous layer sorting means for sorting kernels of weight value groups in a layer preceding a layer into which the weight value groups are divided, according to the order of the channels sorted by the channel sorting means; the division position determination means determines a division position so as to divide the group of weight values after rearrangement of the channels in the channel direction; The dividing means divides the weight value group before division at the division position, The coupling layer adding means adds a coupling layer that derives one output data by adding corresponding elements in each output data obtained by an operation between the input data and each weight value group after division. 7. The neural network model conversion device according to claim 1 or 6.
[0198] (Appendix 9) The channel sorting means sorts the channels included in the weight value group before division in descending or ascending order of the number of weight values that are 0. 9. The neural network model conversion device according to claim 7 or 8.
[0199] (Appendix 10) The computer a division position determination process for determining a division position in a weight value group of at least one layer included in a given neural network model, the weight value group having a configuration in which kernels obtained by arranging at least one or more weight values in a channel direction are arranged in a kernel direction; a division process for obtaining a plurality of weight value groups by dividing the weight value group at the division position; and A combination layer addition process is executed to add a combination layer that combines the output data obtained by the calculation of the input data to the layer and each of the weight value groups after division into one output data. In the division position determination process, when the ratio of the number of weight values that are 0 to the number of weight values included in the weight value group is defined as the sparsity degree, the division positions in the weight value group before division are determined so that at least one weight value group after division has a sparsity degree equal to or greater than a predetermined value. A neural network model conversion method comprising:
[0200] (Appendix 11) The computer, In the division position determination process, a division position is determined so as to divide the weight value group before division in a kernel direction; In the division process, the weight value group before division is divided at the division position; In the connection layer addition process, a connection layer is added to connect each output data obtained by the operation between the input data and each weight value group after division in the channel direction to form one output data. 11. The neural network model transformation method according to claim 10.
[0201] (Appendix 12) The computer, In the division position determination process, a division position is determined so as to divide the weight value group before division in a channel direction; In the division process, the weight value group before division is divided at the division position; In the coupling layer addition process, a coupling layer is added to derive one output data by adding corresponding elements in each output data obtained by computing the input data and each weight value group after division. 11. The neural network model transformation method according to claim 10.
[0202] (Appendix 13) On the computer, a division position determination process for determining a division position in a weight value group of at least one layer included in a given neural network model, the weight value group having a configuration in which kernels obtained by arranging at least one or more weight values in a channel direction are arranged in a kernel direction; a division process for obtaining a plurality of weight value groups by dividing the weight value group at the division position; and Executing a combination layer addition process that adds a combination layer to combine the respective output data obtained by operations on the input data to the layer and the respective weight value groups after division into one output data; In the division position determination process, when the ratio of the number of weight values that are 0 to the number of weight values included in the weight value group is defined as the sparsity degree, the division positions in the weight value group before division are determined so that at least one weight value group after division has a sparsity degree equal to or greater than a predetermined value. A computer-readable recording medium having a neural network model transformation program recorded thereon.
[0203] (Appendix 14) The computer includes: In the division position determination process, a division position is determined so that the weight value group before division is divided in a kernel direction; In the division process, the weight value group before division is divided at the division position; In the connection layer addition process, a connection layer is added that connects each output data obtained by the operation between the input data and each weight value group after division in the channel direction to form one output data. 14. The computer-readable recording medium according to claim 13, having a neural network model conversion program recorded thereon.
[0204] (Appendix 15) The computer includes: In the division position determination process, a division position is determined so that the weight value group before division is divided in the channel direction; In the division process, the weight value group before division is divided at the division position; In the coupling layer addition process, a coupling layer is added to derive one output data by adding corresponding elements in each output data obtained by calculation of the input data and each weight value group after division. 14. The computer-readable recording medium according to claim 13, having a neural network model conversion program recorded thereon.
[0205] Although the present invention has been described above with reference to the embodiment, the present invention is not limited to the above embodiment. Various modifications that can be understood by those skilled in the art can be made to the configuration and details of the present invention within the scope of the present invention.
[0206] The present invention is preferably applied to a neural network model conversion device that converts a neural network model. [Explanation of symbols]
[0207] 10,20,30,40,50,60 Neural network model conversion device 11 Division position determining section 12 Division 13 Additional bonding layer 21 Kernel sorting unit 22 Adding an output data sorting layer 31 Next layer sorting section 41 Division position determination section 42 Division 43 Additional bonding layer 51 Channel sorting unit 52 Input data sorting layer addition part 61 Front layer sorting section
Claims
1. a division position determination means for determining a division position in a weight group of at least one layer included in a given neural network model, the weight group having a configuration in which kernels obtained by arranging at least one or more weight values in a channel direction are arranged in a kernel direction; a division means for dividing the weight value group at the division position to obtain a plurality of weight value groups; a combination layer adding means for adding a combination layer that combines each output data obtained by an operation between the input data to the layer and each group of weight values after division into one output data, The division position determination means determines division positions in the weight value groups before division such that at least one weight value group after division has a sparsity of a predetermined value or more, where the sparsity is a ratio of the number of weight values that are 0 to the number of weight values included in the weight value groups. A neural network model conversion device comprising:
2. the division position determination means determines a division position so as to divide the weight value group before division in a kernel direction; The dividing means divides the weight value group before division at the division position, The coupling layer adding means adds a coupling layer that connects each output data obtained by the operation between the input data and each of the weight value groups after division in a channel direction to form one output data.
2. The neural network model transformation device according to claim 1.
3. a kernel sorting means for sorting kernels included in the weight value group before division according to a predetermined criterion; the division position determination means determines a division position so as to divide the weight value group after the kernel rearrangement in the kernel direction; The dividing means divides the weight value group before division at the division position, the coupling layer adding means adds a coupling layer that connects each output data obtained by an operation between the input data and each of the weight value groups after division in a channel direction to form one output data; and an output data rearrangement layer adding means for adding an output data rearrangement layer that rearranges channels of the one output data based on a change in the order of kernels caused by the rearrangement by the kernel rearrangement means so as to correspond to the order of kernels in the weight value group before the rearrangement of the kernels.
3. The neural network model conversion device according to claim 1 or 2.
4. A kernel sorting means for sorting kernels included in the weight value group before division according to a predetermined criterion; a next layer sorting means for sorting channels of a weight value group of a layer next to the layer into which the weight value group is divided, according to the order of the kernels sorted by the kernel sorting means; the division position determination means determines a division position so as to divide the weight value group after the kernel rearrangement in the kernel direction; The dividing means divides the weight value group before division at the division position, The coupling layer adding means adds a coupling layer that connects each output data obtained by the operation between the input data and each of the weight value groups after division in a channel direction to form one output data.
3. The neural network model conversion device according to claim 1 or 2.
5. The kernel sorting means sorts the kernels included in the weight value group before division in descending or ascending order of the number of weight values that are 0.
5. The neural network model conversion device according to claim 3.
6. the division position determination means determines a division position such that the weight value group before division is divided in the channel direction; The dividing means divides the weight value group before division at the division position, The coupling layer adding means adds a coupling layer that derives one output data by adding corresponding elements in each output data obtained by an operation between the input data and each weight value group after division.
2. The neural network model transformation device according to claim 1.
7. a channel sorting means for sorting channels included in the weight value group before division according to a predetermined criterion; an input data rearrangement layer adding means for adding an input data rearrangement layer that rearranges the channels of the input data in accordance with the order of the channels rearranged by the channel rearrangement means; the division position determination means determines a division position so as to divide the group of weight values after rearrangement of the channels in the channel direction; The dividing means divides the weight value group before division at the division position, The coupling layer adding means adds a coupling layer that derives one output data by adding corresponding elements in each output data obtained by an operation between the input data and each weight value group after division.
7. The neural network model conversion device according to claim 1 or 6.
8. a channel sorting means for sorting channels included in the weight value group before division according to a predetermined criterion; a previous layer sorting means for sorting kernels of weight value groups in a layer previous to a layer into which the weight value groups are divided, according to the order of the channels sorted by the channel sorting means; the division position determination means determines a division position so as to divide the group of weight values after rearrangement of the channels in the channel direction; The dividing means divides the weight value group before division at the division position, The coupling layer adding means adds a coupling layer that derives one output data by adding corresponding elements in each output data obtained by an operation between the input data and each weight value group after division.
7. The neural network model conversion device according to claim 1 or 6.
9. The computer a division position determination process for determining a division position in a weight value group of at least one layer included in a given neural network model, the weight value group having a configuration in which kernels obtained by arranging at least one or more weight values in a channel direction are arranged in the kernel direction; a division process for obtaining a plurality of weight value groups by dividing the weight value group at the division position; and A combination layer addition process is executed to add a combination layer that combines the output data obtained by the calculation of the input data to the layer and each of the weight value groups after division into one output data. In the division position determination process, when the ratio of the number of weight values that are 0 to the number of weight values included in the weight value group is defined as the sparsity degree, the division positions in the weight value group before division are determined so that at least one weight value group after division has a sparsity degree equal to or greater than a predetermined value. A neural network model conversion method comprising:
10. On the computer, a division position determination process for determining a division position in a weight value group of at least one layer included in a given neural network model, the weight value group having a configuration in which kernels obtained by arranging at least one or more weight values in a channel direction are arranged in the kernel direction; a division process for obtaining a plurality of weight value groups by dividing the weight value group at the division position; and Executing a combination layer addition process that adds a combination layer to combine the respective output data obtained by operations on the input data to the layer and the respective weight value groups after division into one output data; In the division position determination process, when the ratio of the number of weight values that are 0 to the number of weight values included in the weight value group is defined as the sparsity degree, the division positions in the weight value group before division are determined so that at least one weight value group after division has a sparsity degree equal to or greater than a predetermined value. Neural network model conversion program.
Citation Information
Patent Citations
Neural network pruning method and device, electronic equipment and computer readable medium
CN111291884A
constructing a sparse neural network
JP2017509951A
Dynamically dividing activation and kernels for improving memory efficiency
JP2021077342A
Inference device, convolutional computation execution method, and program
WO2019082859A1
