Machine learning program, device, and method
The machine learning device optimizes large-scale model training by selectively skipping and restarting learning processes based on learning status, maintaining accuracy and efficiency.
Patent Information
- Application Number
- JP2021017689
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-02-05
- Publication Date
- 2024-09-18
- Estimated Expiration
- 2041-02-05
AI Technical Summary
In large-scale machine learning models, reducing calculation time without compromising prediction accuracy and increasing learning time is challenging due to the potential for inappropriate skipping of learning processing.
A machine learning device that monitors learning status through weights, error gradients, and momentum, determines appropriate layers for skipping based on learning progress, and restarts skipped processes when necessary to maintain accuracy and efficiency.
This approach effectively avoids decreases in prediction accuracy and learning time by strategically skipping and restarting learning processes, ensuring optimal model performance.
Smart Images

Figure 0007552401000004 
Figure 0007552401000009 
Figure 0007552401000010
Abstract
Description
[Technical field]
[0001] The disclosed technology relates to a machine learning program, a machine learning device, and a machine learning method. [Background technology]
[0002] Various recognition processes such as image recognition, speech recognition, and natural language processing are performed using models such as multi-layer neural networks that have been machine-learned through deep learning. As the number of layers in a neural network increases, the recognition accuracy of the model improves, and so models tend to become larger in scale. In large-scale models, the calculation time for recognition processes and the like increases. In addition, in large-scale models, the parameters to be optimized are also enormous, so the calculation time for machine learning also increases. Technologies for reducing such calculation times have been proposed.
[0003] For example, an information estimation device has been proposed that uses a neural network to quickly calculate a variance value that represents the uncertainty of an estimation result without performing a huge number of calculation processes. This device relates to a neural network having an integration layer that is a combination of a dropout layer that removes part of the input data and an FC layer or a convolution layer that calculates weights. This neural network also has an activation layer that performs calculations using a nonlinear function at least one before and after the integration layer. In this neural network, this device refers to data related to a multivariate distribution input to the activation layer and determines whether the variance value of the multivariate distribution output from the activation layer after calculation in the activation layer can be set to zero. Furthermore, when performing calculations in the integration layer, this device skips calculations related to the multivariate distribution that is determined by the data analysis unit to be able to set the variance value to zero.
[0004] Also proposed is a machine learning method for labeling, training, and evaluating a machine learning model using, for example, one or more skip regions. The method includes using the one or more skip regions to label, train, and evaluate a machine learning model, and specifying the one or more skip regions for an image, where a non-skip region of the image is a portion of the image that is not in the one or more skip regions. The method further includes initiating, by a processor, labeling one or more features in the non-skip regions of the image and excluding the one or more skip regions from the labeling to create a partially labeled image, where the partially labeled image is included in a training dataset for training the machine learning model. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] JP 2019-70950 A [Patent Document 2] US Patent Application Publication No. 2019 / 0188538 Summary of the Invention [Problem to be solved by the invention]
[0006] If some processing is skipped in order to reduce the computation time of the model's machine learning, the predictive accuracy of the model reached at the end of the machine learning may decrease, or the learning time may increase to achieve the desired predictive accuracy.
[0007] In one aspect, the disclosed technology aims to avoid inappropriate skipping of learning processes that can lead to reduced prediction accuracy and increased learning time. [Means for solving the problem]
[0008] In one embodiment, the disclosed technology acquires information indicating a learning status for each iteration of the learning process. The disclosed technology also determines the learning progress of each layer based on the information indicating the learning status, and skips a part of the learning process of each layer included in the first layer group from the input layer to a specific layer where the learning progress satisfies a predetermined condition. Then, the disclosed technology executes the following process when a part of the learning process of each layer included in the first layer group is skipped. First, the disclosed technology determines whether or not the amount of change in the evaluation value based on the information indicating the learning status of any layer included in the second layer group from the next layer on the output layer side of the specific layer to the output layer exceeds a predetermined threshold range. Then, the disclosed technology resumes a part of the learning process skipped in each layer included in the first layer group when the amount of change in the evaluation value exceeds the threshold range. Effect of the Invention
[0009] One aspect of the present invention is that it has the effect of preventing inappropriate skipping of learning processes that can lead to a decrease in prediction accuracy or an increase in learning time. [Brief description of the drawings]
[0010] [Figure 1] FIG. 1 is a functional block diagram of a machine learning device. [Diagram 2] FIG. 1 is a schematic diagram illustrating an example of a model. [Diagram 3] FIG. 11 is a diagram for explaining a learning process. [Figure 4] FIG. 11 is a diagram illustrating an example of an evaluation value DB. [Diagram 5] 11 is a diagram for explaining skipping of the learning process according to the progress of learning. FIG. [Figure 6] FIG. 13 is a diagram for explaining skipping of the learning process. [Figure 7] FIG. 13 is a schematic diagram showing evaluation values for each epoch in a specific layer in the case where the learning process is not skipped and in the case where the learning process is skipped. [Figure 8] 11 is a diagram for explaining calculation of a change amount of an evaluation value. [Figure 9]11 is a diagram for explaining a threshold range to be compared with the amount of change in evaluation value; FIG. [Figure 10] 11 is a diagram for explaining a threshold range to be compared with the amount of change in evaluation value; FIG. [Figure 11] 13 is a diagram for explaining another method of determining whether or not the amount of change in the evaluation value exceeds the threshold range. FIG. [Figure 12] FIG. 1 is a block diagram showing a schematic configuration of a computer that functions as a machine learning device. [Figure 13] 13 is a flowchart illustrating an example of a learning process. [Figure 14] 13 is a flowchart illustrating an example of a skip setting process. [Figure 15] 13 is a flowchart illustrating an example of a restart setting process. [Figure 16] FIG. 13 is a diagram for explaining an outline of a restart setting process. [Figure 17] FIG. 13 illustrates an example of an error gradient for the present method. [Figure 18] FIG. 13 is a diagram showing an example of a comparison result of an accuracy evaluation between the present method and a comparison method without skipping and without restarting. [Figure 19] FIG. 13 is a block diagram showing another example of the hardware configuration of the machine learning device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] Hereinafter, an example of an embodiment of the disclosed technology will be described with reference to the drawings.
[0012] 1, the machine learning device 10 functionally includes a learning processing unit 12, an acquisition unit 14, a skip setting unit 16, and a restart setting unit 18. In addition, a model 22, a training data DB (Database) 24, and an evaluation value DB 26 are stored in a predetermined storage area of the machine learning device 10.
[0013] The model 22 is a model that is the target of machine learning, and in this case is a neural network including an input layer, a hidden layer, and an output layer, as shown in FIG. 2. Each layer of the model 22 includes one or more neurons (circles in FIG. 2). Neurons in the hidden layer and the output layer have an internal activation function. In addition, weights indicating the strength of the connection are set between neurons connected between layers.
[0014] The training data DB 24 stores a plurality of training data used for machine learning of the model 22. The training data is data input to the model 22, and is data to which a label indicating the correct answer of the output value of the model 22 for the training data is attached.
[0015] The learning processing unit 12 executes machine learning of the model 22 using the training data, and optimizes the weights included in the model 22. The learning processing unit 12 executes a learning process including a first process, a second process, and a third process. Specifically, as shown in FIG. 3, the learning processing unit 12 executes a process of inputting training data from an input layer, and calculating an error between an output value output from an output layer and a correct answer indicated by a label attached to the training data as a first process ("Forward Propagation" in FIG. 3). More specifically, a value obtained by multiplying the value of the training data input to each neuron in the input layer by a weight between the neuron in the next layer is input to the neuron in the next layer. A value obtained by applying an activation function to the input value is output from the neuron in the next layer, and becomes an input to the neuron in the next layer. In this way, the value is forward propagated, and finally an output value is output from each neuron in the output layer. The learning processing unit 12 calculates, as an error, for example, a square sum error between this output value and a value indicated by a label.
[0016] Furthermore, as a second process, the learning processing unit 12 executes a process of backpropagating the error information calculated in the first process from the output layer to the input layer and calculating the error gradient for each weight ("Backward Propagation" and "Error Gradient Calculation" in FIG. 3). The error gradient is an estimate of the amount of change in error when the weight is updated by a unit amount. Furthermore, as a third process, the learning processing unit 12 executes a process of updating the weights between layers using the error gradient calculated in the second process ("Weight Update" in FIG. 3).
[0017] The acquisition unit 14 acquires information indicating the learning status for each iteration of the learning process by the learning processing unit 12. Specifically, the acquisition unit 14 acquires the weight, error gradient, and momentum obtained in the course of the learning process by the learning processing unit 12 for each iteration, which is the minimum unit of the iteration of the learning process, and stores them in the evaluation value DB 26. The momentum is a coefficient used in the gradient descent method using the momentum method, and is a moving average of the error gradient. FIG. 4 shows an example of the evaluation value DB 26. In the example of FIG. 4, "w" is the weight, "g" is the error gradient, and "m" is the momentum. Also, "layer" is information for identifying which layer the weight is between, and here, the layer between the input layer and the next layer is set to 1, followed by 2, 3, ....
[0018] Here, the learning process is repeatedly executed, thereby optimizing the weights, that is, learning progresses. The progress of learning can be expressed, for example, by the weight difference between iterations or the magnitude of the error gradient. In this case, the smaller the weight difference or error gradient, the more advanced the learning is. As shown in FIG. 5, in the early stage of the learning process, the learning of the weights in each layer is not yet advanced. As the iterations of the learning process progress, the learning also progresses. And, as in the layer shown by the dashed line in FIG. 5, in some layers, the weight difference or error gradient is small, and further learning may not be necessary.
[0019] Therefore, the skip setting unit 16 judges the learning progress of each layer based on the information stored in the evaluation value DB 26, and sets the learning process of each layer included in the first layer group from the input layer to the specific layer, where the learning progress satisfies a predetermined condition, to be skipped. Here, a case will be described in which the difference in weight between iterations is used as the learning progress. Specifically, the skip setting unit 16 acquires the weight in the current iteration and the weight in the immediately previous iteration from the evaluation value DB 26, and calculates the difference between the two weights. The skip setting unit 16 determines the layer closest to the output layer as the specific layer, among the layers in which the calculated weight difference is equal to or less than a predetermined threshold, starting from the input layer. Then, the skip setting unit 16 sets each layer included in the first layer group from the input layer to the specific layer to skip a part of the learning process, for example, by setting a flag indicating that a part of the learning process is to be skipped.
[0020] For the layer for which a skip has been set, the second process is skipped in the learning process by the learning processing unit 12. By skipping the second process, the error gradient of each layer is not calculated, and therefore the third process is also skipped. That is, for each layer included in the first layer group, only the first process of the learning process is executed, and for each layer included in the second layer group from the layer next to the output layer side of the specific layer to the output layer, the first process, the second process, and the third process are executed.
[0021] Specifically, in the example shown in FIG. 6, it is assumed that the skip setting unit 16 determines the third layer from the input layer side as a specific layer (Ln in FIG. 6). In this case, Ln-2, Ln-1, and Ln are the first layer group, and Ln+1, Ln+2, Ln+3, and Ln+4 are the second layer group. In this case, forward propagation is performed for all layers, and errors are calculated. Then, backward propagation of errors by backward propagation is performed only up to Ln+1. Therefore, for each layer included in the second layer group, an error gradient is calculated, and weights are updated. On the other hand, for the first layer group, calculation of error gradients and updating of weights are not performed.
[0022] As a result, the amount of calculation for the second process and the third process for each layer included in the first group of layers is reduced in each iteration, as shown in Fig. 5. Then, in one epoch, a skip is set and the accumulated amount of reduction in the subsequent iterations is reduced.
[0023] As described above, when some layers are set to skip a part of the learning process, the prediction accuracy of the model reached at the end of machine learning may decrease, or the learning time may increase in order to obtain the desired prediction accuracy. Specifically, when the skip is set at an appropriate timing and an appropriate layer is selected as the layer to which the skip is set, it is possible to reach the target accuracy quickly. On the other hand, when the timing to set the skip and the selection of the layer are inappropriate, the learning process of the layer after the layer to which the skip is set, that is, the second layer group, may be affected. If the degree of the influence is large, there is a problem of a decrease in the final achieved accuracy and an increase in the calculation time.
[0024] A more specific example will be described with reference to FIG. 7. FIG. 7 is a schematic diagram showing evaluation values (details will be described later) for each epoch in a predetermined layer when a ResNet (Residual Network) 50 is used as the model 22. The upper part shows a case where no skip is set, and the lower part shows a case where a skip is set from the input layer to the 33rd layer at the 10th epoch. In both the upper and lower parts, the left diagram shows the evaluation value for the 42nd layer (Convolution layer), and the right diagram shows the evaluation value for the 34th layer (Bach Normalization layer). Note that, although details will be described later, an example is shown in which the inner product of the error gradient g and momentum m (hereinafter, referred to as "inner product (g×m)") is used as the evaluation value for the 42nd layer, and the L2 norm of the error gradient g (hereinafter, referred to as "g_norm") is used for the 34th layer.
[0025] As shown in Figure 7, in both the 34th layer, which is immediately after the 33rd layer where a skip was set, and the 42nd layer, which is far from the 33rd layer, a large fluctuation in the evaluation value is seen immediately after the 10th epoch where a skip was set. In this way, when the change in the evaluation value is large, the final achievement accuracy may decrease or the calculation time may increase compared to when a skip is not set.
[0026] Therefore, the restart setting unit 18 determines whether or not the amount of change in the evaluation value of any layer included in the second layer group exceeds a predetermined threshold range when a part of the learning process of each layer included in the first layer group is skipped. Then, when the amount of change in the evaluation value of any layer exceeds the predetermined threshold range, the restart setting unit 18 restarts the part of the learning process that was skipped in each layer included in the first layer group.
[0027] Specifically, the restart setting unit 18 calculates an evaluation value for each layer for each iteration based on the information stored in the evaluation value DB 26. The evaluation value is a value that can estimate the final attainment accuracy of the machine-learned model 22 and the learning time required to obtain a desired accuracy. Specifically, the restart setting unit 18 may use each of the weight w, the error gradient g, and the momentum m as the evaluation value as is, or may calculate the evaluation value using at least one of the weight w, the error gradient g, and the momentum m. For example, the restart setting unit 18 may calculate an inner product (g×m), g_norm, or the like as the evaluation value.
[0028] Furthermore, the restart setting unit 18 calculates the amount of change in the evaluation value with the progress of the learning process. Specifically, the restart setting unit 18 calculates the amount of change between the statistical value of the evaluation value calculated for a predetermined number of iterations in a first period including the current iteration and the statistical value of the evaluation value calculated for a predetermined number of iterations in a second period prior to the first period. That is, the restart setting unit 18 calculates the amount of change in the evaluation value for each layer for each predetermined number of iterations. The predetermined number may be, for example, 100 iterations, the number of iterations for one epoch, or the like. Note that, when the predetermined number is set to one, the restart setting unit 18 calculates the amount of change between the evaluation value for the current iteration and the evaluation value for the previous iteration. Furthermore, the statistical value is an average, a maximum value, a minimum value, a median value, or the like. In the following, a case where the average is used as the statistical value will be described.
[0029] With reference to FIG. 8, a case will be described in which a skip is set at the 10th epoch, and an inner product (g×m) is used as an evaluation value to calculate the change in the evaluation value for each epoch. For example, the restart setting unit 18 calculates an average evaluation value by averaging the evaluation values calculated for each iteration included in each epoch at the end of each epoch. Then, the restart setting unit 18 calculates, for example, the difference between the average evaluation value calculated at the nth (e.g., 12th) epoch and the average evaluation value calculated at the n-1st (e.g., 11th) epoch as the change in the evaluation value. The part indicated by P in FIG. 8 corresponds to the change in the evaluation value at the nth epoch. When the change in the evaluation value calculated as described above exceeds a predetermined threshold range in any layer, the restart setting unit 18 cancels the skip setting and sets the learning process of the first layer group to be restarted. For example, the restart setting unit 18 cancels the skip setting by turning off a flag set by the skip setting unit 16 indicating that part of the learning process is to be skipped.
[0030] Here, an appropriate method for setting the threshold range to be compared with the change in the evaluation value will be described with an example using specific values. With reference to FIG. 9, a case will be described in which the inner product (g×m) is used as the evaluation value and the change in the evaluation value is calculated for every 100 iterations. That is, the inner product (g×m) shown in FIG. 9 is an average value of the inner products (g×m) for 100 iterations. The lower diagram of FIG. 9 is a partially enlarged diagram including the part indicated by the dashed circle in the upper diagram of FIG. 9. FIG. 10 shows the evaluation value and the change in the evaluation value at each of Points 1 to 4 shown in FIG. 9. For example, the change in the inner product (g×m) from Point 1 to Point 2 is assumed to have an effect such as a deterioration in the accuracy of the subsequent learning process and an increase in the learning time. On the other hand, the change in the inner product (g×m) from Point 3 to Point 4 is assumed not to have such an effect. In this case, it is desirable that the change in the evaluation value at Point 2 is determined to have exceeded the threshold range, and the change in the evaluation value at Point 4 is determined to be within the threshold range. Therefore, the threshold range may be set to a value of, for example, 0.15 to 0.2.
[0031] With reference to FIG. 11, another method of determining whether the change in the evaluation value exceeds the threshold range will be described. In the example of FIG. 11, a skip is set at the 10th epoch, g_norm is used as the evaluation value, and whether the change in the evaluation value exceeds the threshold range for each epoch will be determined. For example, the restart setting unit 18 may determine that the change in the evaluation value exceeds the threshold range when the sign of the differential value of the average evaluation value calculated at the nth epoch is inverted from the sign of the differential value of the average evaluation value calculated at the n-1th epoch. In the example of FIG. 11, the sign of the differential value of the average evaluation value at the 10th epoch is negative, and the sign of the differential value of the average evaluation value at the 11th epoch is positive. In this case, the restart setting unit 18 determines that the change in the evaluation value exceeds the threshold range at the 11th epoch.
[0032] Furthermore, the restart setting unit 18 may calculate multiple types of evaluation values for each layer, determine whether or not the amount of change in each evaluation value exceeds a threshold range, and set restart of the learning process when the amount of change in at least one type of evaluation value exceeds the threshold. Note that the inner product (g×m) is useful as an evaluation value in this embodiment because it decreases simply as learning progresses when there is no problem with the learning process and is an index that easily captures the amount of change when a problem occurs in the learning process.
[0033] The machine learning device 10 can be realized by, for example, a computer 40 shown in FIG. 12. The computer 40 includes a CPU (Central Processing Unit) 41, a memory 42 as a temporary storage area, and a non-volatile storage unit 43. The computer 40 also includes an input / output device 44 such as an input unit and a display unit, and an R / W (Read / Write) unit 45 that controls reading and writing of data from and to a storage medium 49. The computer 40 also includes a communication I / F (Interface) 46 that is connected to a network such as the Internet. The CPU 41, the memory 42, the storage unit 43, the input / output device 44, the R / W unit 45, and the communication I / F 46 are connected to one another via a bus 47.
[0034] The storage unit 43 can be realized by a hard disk drive (HDD), a solid state drive (SSD), a flash memory, or the like. A machine learning program 50 for causing the computer 40 to function as the machine learning device 10 is stored in the storage unit 43 as a storage medium. The machine learning program 50 has a learning process 52, an acquisition process 54, a skip setting process 56, and a resume setting process 58. The storage unit 43 also has an information storage area 60 in which information constituting each of the training data DB 24, the model 22, and the evaluation value DB 26 is stored.
[0035] The CPU 41 reads out the machine learning program 50 from the storage unit 43, expands it in the memory 42, and sequentially executes the processes of the machine learning program 50. The CPU 41 operates as the learning processing unit 12 shown in FIG. 1 by executing the learning process 52. The CPU 41 also operates as the acquisition unit 14 shown in FIG. 1 by executing the acquisition process 54. The CPU 41 also operates as the skip setting unit 16 shown in FIG. 1 by executing the skip setting process 56. The CPU 41 also operates as the resume setting unit 18 shown in FIG. 1 by executing the resume setting process 58. The CPU 41 also reads out information from the information storage area 60, and expands each of the training data DB 24, the model 22, and the evaluation value DB 26 in the memory 42. As a result, the computer 40 that has executed the machine learning program 50 functions as the machine learning device 10. The CPU 41 that executes the program is hardware.
[0036] The functions realized by the machine learning program 50 can also be realized by, for example, a semiconductor integrated circuit, more specifically, an ASIC (Application Specific Integrated Circuit) or the like.
[0037] Next, the operation of the machine learning device 10 according to the present embodiment will be described. When machine learning of the model 22 is instructed, the machine learning device 10 executes the learning process shown in Fig. 13 and the skip setting process shown in Fig. 14. Furthermore, when a skip is set for any layer, the machine learning device 10 executes the resume setting process shown in Fig. 15. Note that the learning process, the skip setting process, and the resume setting process are examples of the machine learning method of the disclosed technology. Below, the learning process, the skip setting process, and the resume setting process will each be described in detail.
[0038] First, the learning process shown in FIG. 13 will be described.
[0039] In step S12, the learning processing unit 12 sets a variable i indicating the number of iterations to 1. Next, in step S14, the learning processing unit 12 starts the learning process for the i-th iteration.
[0040] Next, in step S16, the learning processing unit 12 determines whether or not there is a layer to which skip is set among the layers included in the model 22. If there is a layer to which skip is set, the process proceeds to step S18, and if no layer is set to skip, the process proceeds to step S20. In step S18, the learning processing unit 12 skips the second and third processes for the first layer group (on the input side from Ln in the example of FIG. 6) to which skip is set, and executes the learning process. That is, for the first layer group, the error calculation process by forward propagation is executed, and the error gradient calculation process by backward propagation and the weight update are skipped. Meanwhile, for the second layer group (on the output side from Ln+1 in the example of FIG. 6), all learning processes are executed, while in step S20, the learning processing unit 12 executes all learning processes for all layers.
[0041] Next, in step S22, the acquisition unit 14 acquires the weight w, error gradient g, and momentum m of each layer obtained in the process of step S18 or S20, and stores them in the evaluation value DB 26.
[0042] Next, in step S24, the learning processing unit 12 increments i by 1. Next, in step S26, the learning processing unit 12 determines whether i exceeds the upper limit value imax of the number of iterations. If i≦imax, the process returns to step S14, and if i>imax, the learning process ends.
[0043] Next, the skip setting process shown in FIG. 14 will be described.
[0044] In step S32, the skip setting unit 16 sets a variable i indicating the number of iterations to 1. Next, in step S34, the skip setting unit 16 determines whether or not i exceeds 1. If i>1, the process proceeds to step S36, and if i≦1, the process proceeds to step S42.
[0045] In step S36, the skip setting unit 16 obtains the weights w for the i-th iteration and the (i-1)-th iteration for each layer from the evaluation value DB 26, and calculates the difference between the weights as an index showing the progress of learning.
[0046] Next, in step S38, the skip setting unit 16 determines whether or not there is a layer for which the weight difference calculated in step S36 is equal to or greater than the threshold TH1. If there is a layer for which the weight difference is equal to or greater than the threshold TH1, the process proceeds to step S40; if there is no layer for which the weight difference is equal to or greater than the threshold TH1, the process proceeds to step S42. In step S40, the skip setting unit 16 determines the layer closest to the output layer, in succession from the input layer, for which the calculated weight difference is equal to or less than the threshold TH1, as a specific layer Ln. Then, the skip setting unit 16 sets each layer included in the first group of layers from the input layer to the specific layer to skip a part of the learning process.
[0047] Next, in step S42, the skip setting unit 16 increments i by 1. Next, in step S44, the skip setting unit 16 determines whether i exceeds the upper limit value imax of the number of iterations. If i≦imax, the process returns to step S34, and if i>imax, the skip setting process ends.
[0048] Next, the restart setting process shown in FIG. 15 will be described.
[0049] In step S52, the restart setting unit 18 sets N to a variable n indicating a point at which it is determined whether the change in the evaluation value exceeds the threshold range TH2. This point is set for every predetermined number k of iterations (k is, for example, 100 times, the number of iterations for one epoch, etc.). N is the number of points that have ended at the time when the skip is set. For example, when making a determination every 100 iterations and the skip is set at the 500th iteration, k=100 and N=5.
[0050] Next, in step S54, the restart setting unit 18 judges whether or not the weight w, error gradient g, and momentum m of the i-th iteration, where i=n×k, are stored in the evaluation value DB 26. That is, the restart setting unit 18 judges whether or not the weight w, error gradient g, and momentum m are stored for k iterations that can calculate the average evaluation value of the n-th point. If each piece of information is stored in the evaluation value DB 26, the process proceeds to step S56, and if not, the judgment in this step is repeated.
[0051] In step S56, the restart setting unit 18 calculates an evaluation value for each iteration from the (n-1)xk iteration to the nxk iteration, averages the calculated evaluation values, and calculates an average evaluation value as the evaluation value of the nth point.Then, the restart setting unit 18 calculates the difference between the evaluation value calculated at the nth point and the evaluation value calculated at the n-1th point as the amount of change in evaluation value.
[0052] Next, in step S58, the restart setting unit 18 determines whether or not the amount of change in the evaluation value calculated in step S56 exceeds a predetermined threshold range T2. If the amount of change in the evaluation value exceeds the threshold range TH2, the process proceeds to step S60, and if it is within the threshold range TH2, the process proceeds to step S62. In step S60, the restart setting unit 18 cancels the skip setting and sets the learning process of the first layer group to be restarted.
[0053] In step S62, the restart setting unit 18 increments n by 1. Next, in step S64, the restart setting unit 18 determines whether n exceeds the upper limit value nmax (nmax=imax / k) of points. If n≦nmax, the process returns to step S54, and if n>nmax, the restart setting process ends.
[0054] 16, when part of the learning process has been skipped in the first layer group of model 22, the above-mentioned restart setting process is executed to determine whether the amount of change P in the evaluation value exceeds the threshold range TH2 in any layer of the second layer group. If P>TH2, the part of the learning process that was skipped in the first layer group is restarted.
[0055] As described above, the machine learning device according to the present embodiment acquires information indicating the learning status, such as weights, error gradients, and momentum, for each iteration of the learning process in deep learning of a model including a plurality of layers including an input layer and an output layer. The machine learning device also determines the learning progress of each layer based on the information indicating the learning status, and sets to skip a part of the learning process of each layer included in the first layer group from the input layer to a specific layer where the learning progress satisfies a predetermined condition. Specifically, the calculation of the error gradient and the update of the weights by backward propagation are skipped. Then, when a part of the learning process of each layer included in the first layer group is skipped, the learning processing unit determines whether or not the change amount of the evaluation value of any layer included in the second layer group from the next layer on the output layer side of the specific layer to the output layer exceeds a predetermined threshold range. The evaluation value is calculated based on the information indicating the learning status. When the change amount of the evaluation value exceeds a predetermined threshold range, the machine learning device resumes a part of the learning process skipped in each layer included in the first layer group.
[0056] In this way, the machine learning device according to the present embodiment determines, based on the amount of change in the evaluation value, whether or not a situation that leads to a decrease in prediction accuracy or an increase in learning time has occurred in the learning process of a layer on the output side of the layer for which a skip has been set. This allows the machine learning device according to the present embodiment to avoid inappropriate skipping of learning processes that lead to a decrease in prediction accuracy or an increase in learning time.
[0057] Here, the results of comparing accuracy evaluation between the method in this embodiment (hereinafter referred to as "this method") and two comparative examples will be described. The first comparative example is a method in which skip is not set (hereinafter referred to as "no skip"), and the second comparative example is a method in which skip is set but restart is not set (hereinafter referred to as "no restart"). Both methods use ResNet50 as a model, and the amount of change in evaluation value is determined for each epoch. In addition, for this method and no restart, skip was set for each layer up to the 33rd layer at the 40th epoch. In addition, in this method, the learning process was restarted one epoch after the skip was set. FIG. 17 shows g_norm for each epoch for this method.
[0058] As shown in Figure 18, the accuracy of our method (dashed line) is much higher than that of the method without skipping (dash-dotted line), but not as high as that of the method without restarting (solid line). This indicates that our method was able to avoid inappropriate steps.
[0059] In the above embodiment, the learning process may be performed by a plurality of computing units. In this case, the machine learning device can be realized by a computer 210 having a hardware configuration as shown in FIG. 19. The computer 210 includes a CPU 41, a memory 42, a storage unit 43, an input / output device 44, an R / W unit 45, a communication I / F 46, as well as a plurality of (four in the example of FIG. 19) GPUs (Graphics Processing Units) 71A, 71B, 71C, and 71D, and a GPU memory 72. The above elements are connected to each other via a bus 47. Hereinafter, when the GPUs 71A, 71B, 71C, and 71D are described without distinction, they will be simply referred to as "GPU 71".
[0060] In this case, the CPU 41 stores the model 22 in the GPU memory 72, and inputs different training data to each GPU 71. Each GPU 71 executes a first process (calculation of error by forward propagation) and a second process (calculation of error gradient by backward propagation) using the input training data. Then, the error gradients calculated by each GPU 71 are integrated by communicating between the GPUs 71 by, for example, AllReduce, and a common error gradient is calculated for use when each GPU 71 executes a third process (updating weights).
[0061] This configuration can reduce the amount of calculations related to the calculation of error gradients and the update of weights in each GPU 71 for each layer included in the first layer group for which the learning process has been skipped. Also, the amount of communication between the GPUs 71 for integrating the error gradients calculated by each GPU 71 can be reduced.
[0062] In the above embodiment, the machine learning program is stored (installed) in the storage unit in advance, but the present invention is not limited to this. The program according to the disclosed technology can also be provided in a form stored in a storage medium such as a CD-ROM, a DVD-ROM, or a USB memory.
[0063] Regarding the above embodiment, the following supplementary notes are further disclosed.
[0064] (Appendix 1) In deep learning of a model including a plurality of layers including an input layer and an output layer, information indicating a learning status is acquired for each iteration of a learning process; determining a learning progress of each layer based on the information indicating the learning status, and skipping a part of the learning process of each layer included in a first group of layers from the input layer to a specific layer where the learning progress satisfies a predetermined condition; When a part of the learning process of each layer included in the first group of layers is skipped, if a change amount of an evaluation value based on information indicating the learning status of any layer included in a second group of layers from the next layer on the output layer side of the specific layer to the output layer exceeds a predetermined threshold range, the part of the learning process skipped in each layer included in the first group of layers is resumed. A machine learning program that causes a computer to perform processes including:
[0065] (Appendix 2) The learning process includes a first process of inputting training data from the input layer and calculating an error between an output value output from the output layer and a correct answer for the training data, a second process of backpropagating information on the error from the output layer to the input layer and calculating an error gradient for an inter-layer weight, and a third process of updating the inter-layer weight using the calculated error gradient, When a part of the learning process is skipped, the second process and the third process are skipped. Attachment 1, a machine learning program.
[0066] (Appendix 3) The machine learning program of claim 2, wherein when the learning process is performed by a plurality of computing units, the error gradients calculated by executing the first process and the second process using different training data in each of the plurality of computing units are integrated to obtain an error gradient to be used in the third process.
[0067] (Appendix 4) 4. The machine learning program according to claim 1, wherein the evaluation value is a value expressed using at least one of an inter-layer weight, an error gradient, and a momentum.
[0068] (Appendix 5) 5. The machine learning program according to claim 4, wherein the evaluation value is an inner product of the error gradient and the momentum.
[0069] (Appendix 6) The process of acquiring information indicating the learning status includes acquiring information indicating the learning status for each iteration, which is a minimum unit of the repeated learning process; The change in the evaluation value is the change between an evaluation value based on the information indicating the learning status acquired in a current iteration and an evaluation value based on the information indicating the learning status acquired in an immediately previous iteration, or the change between a statistical value of an evaluation value based on the information indicating the learning status acquired in a predetermined number of iterations in a first period including the current iteration and a statistical value of an evaluation value based on the information indicating the learning status acquired in a predetermined number of iterations in a second period prior to the first period. 6. The machine learning program according to claim 1,
[0070] (Appendix 7) In deep learning of a model including a plurality of layers including an input layer and an output layer, an acquisition unit that acquires information indicating a learning status for each iteration of a learning process; a skip setting unit that determines a learning progress of each layer based on the information indicating the learning status, and sets a part of the learning process of each layer included in a first layer group from the input layer to a specific layer where the learning progress satisfies a predetermined condition to be skipped; a restart setting unit that sets, when a part of the learning process of each layer included in the first group of layers has been skipped, to restart a part of the learning process that has been skipped in each layer included in the first group of layers if an amount of change in an evaluation value based on information indicating the learning status of any layer included in a second group of layers from the next layer on the output layer side of the specific layer to the output layer exceeds a predetermined threshold range; A machine learning device including:
[0071] (Appendix 8) The learning process includes a first process of inputting training data from the input layer, calculating an error between an output value output from the output layer and a correct answer for the training data, a second process of backpropagating information on the error from the output layer to the input layer and calculating an error gradient for an inter-layer weight, and a third process of updating the inter-layer weight using the calculated error gradient, The skip setting unit sets the second process and the third process to be skipped. 8. The machine learning device of claim 7.
[0072] (Appendix 9) The machine learning device of claim 8, wherein, when the learning process is processed by a plurality of computing units, the error gradients calculated by executing the first process and the second process using different training data in each of the plurality of computing units are integrated to obtain an error gradient to be used in the third process.
[0073] (Appendix 10) 10. The machine learning device according to any one of appendix 7 to appendix 9, wherein the evaluation value is a value expressed using at least one of an inter-layer weight, an error gradient, and a momentum.
[0074] (Appendix 11) 11. The machine learning device according to claim 10, wherein the restart setting unit uses an inner product of the error gradient and the momentum as the evaluation value.
[0075] (Appendix 12) the acquisition unit acquires information indicating a state of the learning for each iteration, which is a minimum unit of the repeated learning process; The restart setting unit calculates, as the amount of change in the evaluation value, an amount of change between an evaluation value based on the information indicating the learning status acquired in a current iteration and an evaluation value based on the information indicating the learning status acquired in an immediately previous iteration, or an amount of change between a statistical value of evaluation values based on the information indicating the learning status acquired in a predetermined number of iterations in a first period including the current iteration and a statistical value of evaluation values based on the information indicating the learning status acquired in a predetermined number of iterations in a second period prior to the first period. The machine learning device according to any one of Supplementary Note 7 to Supplementary Note 11.
[0076] (Appendix 13) In deep learning of a model including a plurality of layers including an input layer and an output layer, information indicating a learning status is acquired for each iteration of a learning process; determining a learning progress of each layer based on the information indicating the learning status, and skipping a part of the learning process of each layer included in a first group of layers from the input layer to a specific layer where the learning progress satisfies a predetermined condition; When a part of the learning process of each layer included in the first group of layers is skipped, if a change amount of an evaluation value based on information indicating the learning status of any layer included in a second group of layers from the next layer on the output layer side of the specific layer to the output layer exceeds a predetermined threshold range, the part of the learning process skipped in each layer included in the first group of layers is resumed. A machine learning method in which a computer performs a process including:
[0077] (Appendix 14) The learning process includes a first process of inputting training data from the input layer and calculating an error between an output value output from the output layer and a correct answer for the training data, a second process of backpropagating information on the error from the output layer to the input layer and calculating an error gradient for an inter-layer weight, and a third process of updating the inter-layer weight using the calculated error gradient, When a part of the learning process is skipped, the second process and the third process are skipped. 14. The machine learning method of claim 13.
[0078] (Appendix 15) The machine learning method according to claim 14, wherein, when the learning process is performed by a plurality of computing units, the error gradients calculated by executing the first process and the second process using different training data in each of the plurality of computing units are integrated to obtain an error gradient to be used in the third process.
[0079] (Appendix 16) 16. The machine learning method according to any one of claims 13 to 15, wherein the evaluation value is a value expressed using at least one of an inter-layer weight, an error gradient, and a momentum.
[0080] (Appendix 17) 17. The machine learning method according to claim 16, wherein an inner product of the error gradient and the momentum is used as the evaluation value.
[0081] (Appendix 18) The process of acquiring information indicating the learning status includes acquiring information indicating the learning status for each iteration, which is a minimum unit of the repeated learning process; The change in the evaluation value is the change between an evaluation value based on the information indicating the learning status acquired in a current iteration and an evaluation value based on the information indicating the learning status acquired in an immediately previous iteration, or the change between a statistical value of an evaluation value based on the information indicating the learning status acquired in a predetermined number of iterations in a first period including the current iteration and a statistical value of an evaluation value based on the information indicating the learning status acquired in a predetermined number of iterations in a second period prior to the first period. The machine learning method according to any one of Supplementary Note 13 to Supplementary Note 17.
[0082] (Appendix 19) In deep learning of a model including a plurality of layers including an input layer and an output layer, information indicating a learning status is acquired for each iteration of a learning process; determining a learning progress of each layer based on the information indicating the learning status, and skipping a part of the learning process of each layer included in a first group of layers from the input layer to a specific layer where the learning progress satisfies a predetermined condition; When a part of the learning process of each layer included in the first group of layers is skipped, if a change amount of an evaluation value based on information indicating the learning status of any layer included in a second group of layers from the next layer on the output layer side of the specific layer to the output layer exceeds a predetermined threshold range, the part of the learning process skipped in each layer included in the first group of layers is resumed. A storage medium storing a machine learning program for causing a computer to execute processes including the above. [Explanation of symbols]
[0083] 10 Machine Learning Device 12 Learning processing unit 14 Acquisition Department 16 Skip setting section 18 Resume setting section 22 Models 24 Training Data DB 26 Evaluation Value DB 40 Computer 41 CPU 42 Memory 43 Storage section 49 Storage medium 50 Machine Learning Programs 71A, 71B, 71C, 71D GPUs 72 GPU Memory 210 Computer
Claims
1. In deep learning of a model including a plurality of layers including an input layer and an output layer, information indicating a learning status is acquired for each iteration of a learning process; determining a learning progress of each layer based on the information indicating the learning status, and skipping a part of the learning process of each layer included in a first group of layers from the input layer to a specific layer where the learning progress satisfies a predetermined condition; When a part of the learning process of each layer included in the first group of layers is skipped, if a change amount of an evaluation value based on information indicating the learning status of any layer included in a second group of layers from the next layer on the output layer side of the specific layer to the output layer exceeds a predetermined threshold range, the part of the learning process skipped in each layer included in the first group of layers is resumed. A machine learning program that causes a computer to perform processes including:
2. The learning process includes a first process of inputting training data from the input layer and calculating an error between an output value output from the output layer and a correct answer for the training data, a second process of backpropagating information of the error from the output layer to the input layer and calculating an error gradient for an inter-layer weight, and a third process of updating the inter-layer weight using the calculated error gradient, When a part of the learning process is skipped, the second process and the third process are skipped. The machine learning program according to claim 1 .
3. 3. The machine learning program according to claim 2, wherein when the learning process is performed by a plurality of computing elements, the error gradients calculated by executing the first process and the second process using different training data in each of the plurality of computing elements are integrated to obtain the error gradient used in the third process.
4. The machine learning program according to any one of claims 1 to 3, wherein the evaluation value is a value expressed using at least one of an interlayer weight, an error gradient, and a momentum.
5. The machine learning program according to claim 4 , wherein an inner product of the error gradient and the momentum is used as the evaluation value.
6. the process of acquiring information indicating a learning status includes acquiring information indicating a learning status for each iteration, which is a minimum unit of the repeated learning process; The change in the evaluation value is the change between an evaluation value based on the information indicating the learning status acquired in a current iteration and an evaluation value based on the information indicating the learning status acquired in an immediately previous iteration, or the change between a statistical value of an evaluation value based on the information indicating the learning status acquired in a predetermined number of iterations in a first period including the current iteration and a statistical value of an evaluation value based on the information indicating the learning status acquired in a predetermined number of iterations in a second period prior to the first period. The machine learning program according to any one of claims 1 to 5.
7. In deep learning of a model including a plurality of layers including an input layer and an output layer, an acquisition unit that acquires information indicating a learning status for each iteration of a learning process; a skip setting unit that determines a learning progress of each layer based on the information indicating the learning status, and sets a part of the learning process of each layer included in a first layer group from the input layer to a specific layer where the learning progress satisfies a predetermined condition to be skipped; a restart setting unit that sets, when a part of the learning process of each layer included in the first layer group has been skipped, to restart a part of the learning process that has been skipped in each layer included in the first layer group when an amount of change in an evaluation value based on information indicating the learning status of any layer included in the second layer group from the next layer on the output layer side of the specific layer to the output layer exceeds a predetermined threshold range; A machine learning device including:
8. In deep learning of a model including a plurality of layers including an input layer and an output layer, information indicating a learning status is acquired for each iteration of a learning process; determining a learning progress of each layer based on the information indicating the learning status, and skipping a part of the learning process of each layer included in a first group of layers from the input layer to a specific layer where the learning progress satisfies a predetermined condition; When a part of the learning process of each layer included in the first group of layers is skipped, if a change amount of an evaluation value based on information indicating the learning status of any layer included in a second group of layers from the next layer on the output layer side of the specific layer to the output layer exceeds a predetermined threshold range, the part of the learning process skipped in each layer included in the first group of layers is resumed. A machine learning method in which a computer performs a process including:
Citation Information
Patent Citations
Training a neural network using selective weight updates
CN112016669A
Information estimation apparatus and information estimation method
JP2019070950A
Learning device, learning method, and learning program
JP2019074947A
Information processing device, information processing method, and information processing program
JP2020191017A
Method, apparatus, and system for providing skip areas for machine learning
US20190188538A1
