METHOD FOR FINDING AN OPTIMAL COMBINATION OF HYPERPARAMETERS FOR A MACHINE LEARNING MODEL

The method dynamically adjusts training data usage in hyperparameter searches, accelerating the process by initial partial data use and ensuring high-quality model performance through incremental data expansion.

FR3147406A1Pending Publication Date: 2024-10-04STMICROELECTRONICS INT NV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
FR2023003291
Authority / Receiving Office
FR · FR
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-04-03
Publication Date
2024-10-04

AI Technical Summary

Technical Problem

The existing methods for searching optimal hyperparameters in machine learning models are time-consuming, especially when large amounts of training data are involved, and inefficient combinations require full training phases despite poor performance.

Method used

A computer-implemented method that dynamically adjusts the quantity of training data used during hyperparameter combination tests by applying a weighting coefficient, allowing faster evaluation of hyperparameter combinations while ensuring accurate performance assessment.

Benefits of technology

This approach significantly reduces the time required to find an optimal hyperparameter combination by using a reduced amount of training data for initial tests, while maintaining the quality of the final model performance through gradual data increase.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

According to one aspect, a computer-implemented method is proposed for finding an optimal combination of hyperparameters to define a machine learning model. The method comprises several tests (21) of hyperparameter combinations, each hyperparameter combination test having a training phase and a test phase. The training phase is adapted to train the machine learning model from training data, and the test phase is adapted to calculate a performance score associated with the tested hyperparameter combination from test data. The method further comprises defining a weighting coefficient (α) to adjust the amount of training data used for the training phase. This weighting coefficient is dynamically adjusted (24, 26) during the various tests of the hyperparameter combinations. Figure for the abstract: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

Title of the invention: METHOD FOR SEARCHING FOR AN OPTIMAL COMBINATION OF HYPERPARAMETERS FOR A MACHINE LEARNING MODEL

[0001] Implementations and embodiments relate to machine learning, including optimization of hyperparameters of a machine learning model. Machine learning is a branch of artificial intelligence that allows a computer system to learn from data, without having been explicitly programmed to perform a given task.

[0003] Machine learning allows a machine to acquire knowledge and skills from a set of data, in order to perform predictions, classifications or other types of processing on new data.

[0004] A machine learning model is a mathematical representation of a system or process that allows a machine to learn from data.

[0005] The model is created using a machine learning algorithm that learns from a training data set to produce a predicted output for a given input.

[0006] The choice of model depends on the type of problem to be solved and the characteristics of the available data. There are different types of machine learning models. Examples include linear models, decision trees, and artificial neural networks.

[0007] Machine learning uses hyperparameters defined for training a model. Hyperparameters are parameters defined before model training begins.

[0008] Hyperparameters may for example include a learning rate (factor determining the size of the steps for updating the model weights during training), a number of iterations (number of times the model runs through the entire data set during training), a structure of the model (number of layers for a neural network and the number of neurons per layer for example).

[0009] Hyperparameters can have a significant impact on model performance. It is therefore appropriate to search for, i.e. optimize, hyperparameters that can improve or even optimize the model's results.

[0010] Hyperparameter optimization is a method in which multiple combinations of hyperparameters are evaluated on a validation data set.

[0011] Different methods for searching for combinations of hyperparameters exist. These methods include grid search, random search and Bayesian search for example.

[0012] The hyperparameter combinations are evaluated by performing a training phase of the machine learning model and then a testing phase.

[0013] The training phase is adapted to train the machine learning model from a training data set. The testing phase is adapted to calculate a performance score associated with the tested hyperparameter combination from a test data set.

[0014] The training data set and the test data set are provided by a user. These data are representative of the intended application for the machine learning model.

[0015] The amount of training data impacts the duration of the training phase. The more training data there is, the longer the training phase. Thus, finding an optimal combination of hyperparameters can take a relatively long time when the amount of training data is large.

[0016] In addition, some desired hyperparameter combinations may be complex. These complex hyperparameter combinations involve a longer training phase.

[0017] However, some complex combinations of hyperparameters are not very efficient. However, even if a combination is not very efficient, it is necessary to carry out a training phase in order to determine the performance of these complex combinations of hyperparameters.

[0018] The evaluation of certain complex combinations of hyperparameters is therefore time-consuming if their calculated performance proves to be insufficient.

[0019] There is therefore a need to propose a solution making it possible to reduce the duration of the search for the optimal combination of hyperparameters, in particular when the quantity of training data provided by a user is significant.

[0020] According to one aspect, there is provided a computer-implemented method for finding an optimal combination of hyperparameters for defining a machine learning model, the method comprising a plurality of hyperparameter combination tests, each hyperparameter combination test comprising a training phase and a testing phase, the training phase being adapted to train the machine learning model from training data and the testing phase being adapted to calculate a performance score associated with the tested hyperparameter combination from test data, the optimal hyperparameter combination corresponding to the hyperparameter combination having obtained the best performance score among the tested hyperparameter combinations, the method further comprising defining a weighting coefficient for adjusting the amount of training data used for the training phase, said weighting coefficient being dynamically adapted during the different tests of the hyperparameter combinations.

[0021] In such a method, the training phase of the hyperparameter combination tests is carried out with training data whose quantity is dynamically adjusted.

[0022] The amount of training data for a training phase is dynamically adjusted to use only a reduced amount of training data for certain hyperparameter combination tests so as to accelerate the process of finding an optimal hyperparameter combination.

[0023] Indeed, it is not necessary to train the machine learning model with the entire training data set to measure an approximation of the performance of a combination of hyperparameters.

[0024] In particular, a portion of the training data is generally sufficient to measure an approximation of the performance of a combination of hyperparameters. For example, a portion corresponding to 10% of the training data makes it possible to obtain an approximation of the performance of a combination of hyperparameters.

[0025] Using only a portion of the training data allows the training phase to be performed more quickly. The training phase of testing the hyperparameter combinations corresponds to the step of the search process that takes the longest to perform.

[0026] As a result, reducing the execution time of the training phases also makes it possible to carry out the hyperparameter combination search method more quickly for a given number of hyperparameter combinations to be tested, or to increase the number of hyperparameter combinations to be tested for a given period of execution of the hyperparameter combination search method.

[0027] Using the user-provided test data set to evaluate the performance of the hyperparameter combination ensures that all tested hyperparameter combinations are evaluated in the same manner.

[0028] Once the optimal combination of hyperparameters is found, the optimal model can be trained with the entire training data set, so as to obtain the best performance of this machine learning model. Thus, the quality of the optimal model is guaranteed.

[0029] Advantageously, the weighting coefficient is initialized to a pon- coefficient initial deration.

[0030] Preferably, the initial weighting coefficient is less than or equal to 1.

[0031] Advantageously, said weighting coefficient is updated for each hyperparameter combination test.

[0032] In an advantageous embodiment, updating the weighting coefficient to be used for a given hyperparameter combination test comprises calculating a new weighting coefficient from an old weighting coefficient used during the hyperparameter combination test directly preceding said given hyperparameter combination test.

[0033] Preferably, the new weighting coefficient is calculated by the formula k*a, where a is the old weighting coefficient and k is a coefficient greater than 1, for example between 1 and 2. Alternatively, it is possible to calculate the new weighting coefficient by adding a given value to the old weighting coefficient. For example, it is possible to add a value of 1% to the old weighting coefficient to obtain the new weighting coefficient.

[0034] In an advantageous embodiment, the method further comprises a definition of a best weighting coefficient defined dynamically, this best weighting coefficient corresponding to the weighting coefficient used for the training phase of the test of the combination of hyperparameters having obtained the best performance score among the combinations of hyperparameters already tested.

[0035] Preferably, the updating of the weighting coefficient comprises a comparison of the new weighting coefficient with the value 100% and with the value w*A, where A is the best defined weighting coefficient and w is a coefficient greater than 1, for example between 2 and 8, in particular equal to 4, the weighting coefficient being updated to the value of the new weighting coefficient if the new calculated weighting coefficient is less than or equal to the value 100% or to the value w*A, or else updated to the value of the initial weighting coefficient otherwise.

[0036] Such an update of the weighting coefficient makes it possible to prevent the weighting coefficient from being too high at the start of the search for an optimal combination of hyperparameters. Such an update of the weighting coefficient also makes it possible to test weighting coefficients higher than the best weighting coefficient, the new weighting coefficient not being able to be greater than w*A. Such an update of the weighting coefficient makes it possible to gradually increase the weighting coefficient.

[0037] According to another aspect, there is provided a computer program product comprising instructions which, when the program is executed by a computer, cause the latter to implement a method as described above.

[0038] According to another aspect, there is provided a computer system comprising: - a memory in which is stored a computer program as described above, and - a processing unit configured to implement the computer program.

[0039] Other advantages and characteristics of the invention will appear on examining the detailed description of embodiments, which are in no way limiting, and the appended drawings in which:

[0040] [Fig.l]

[0041] [Fig.2] illustrate embodiments and implementations of the invention.

[0042] [Fig.l] illustrates a computer system SYS configured to implement a method of searching for an optimal combination of hyperparameters as described below in relation to [Fig.2].

[0043] The computer system SYS comprises a processing unit UT and a memory MEM.

[0044] The MEM memory is in particular a non-volatile memory.

[0045] The MEM memory is configured to store a computer program PRG. This computer program PRG comprises instructions which, when executed by the processing unit UT, cause the latter to implement the method as described below.

[0046] The computer system SYS can for example be a server or a personal computer.

[0047] [Fig.2] illustrates a method for searching for an optimal combination of hyperparameters for a machine learning model. Such a method can be implemented by a computer system SYS as described previously.

[0048] The machine learning model is chosen according to a user-defined application. The model can be a linear model, a decision tree or an artificial neural network for example.

[0049] It is important to note that these models are not exhaustive and there are many other machine learning models used to solve different types of problems to be solved relating to the user-defined application.

[0050] The machine learning model is associated with a combination of hyperparameters. In order to obtain a machine learning model with good performance, it is necessary to search for an optimal combination of hyperparameters for this machine learning model.

[0051] In particular, each desired combination of hyperparameters is tested to measure a performance of this combination of hyperparameters.

[0052] The optimal combination of hyperparameters corresponds to the combination of hyperparameters obtaining a best performance score among a set of combinations of sought hyperparameters.

[0053] More particularly, the method comprises an initialization step 20. In this initialization step, a first combination of hyperparameters is generated randomly.

[0054] In this initialization step 20, a best score is initialized to a predefined value, for example 0.

[0055] As described below, during the optimal hyperparameter combination search process, the best score is updated whenever a performance score of a hyperparameter combination test is higher than the old defined best score. The best score is then updated by this performance score.

[0056] The method then comprises an evaluation step 21. As described below, this evaluation step 21 is carried out for each combination of hyperparameters sought. In this evaluation step 21, a performance of the combination of hyperparameters to be tested is evaluated.

[0057] For example, the evaluation of the performance of a combination of hyperparameters can be carried out by a cross-validation method well known to those skilled in the art.

[0058] Cross-validation can be chosen from validations of the type “Leave p out cross-validation”, “Leave one out cross-validation”, “Holdout cross-validation”, “Repeated random subsampling validation”, “k-fold cross-validation”, “Stratified k-fold cross-validation”, “Time Series cross-validation”, “Nested cross-validation”.

[0059] More particularly, the evaluation of the performance of a combination of hyperparameters comprises a phase of training the machine learning model and a phase of testing the machine learning model.

[0060] The training phase of the machine learning model uses TRND training data. The training data is provided by the user.

[0061] More particularly, the quantity of TRND training data used for the training phase depends on a weighting coefficient a less than or equal to 100%.

[0062] The weighting coefficient a makes it possible to select a portion of the training data provided by the user. The ratio between a size of this portion of the training data and a size of the entire training data corresponds to the weighting coefficient a.

[0063] The training data of said portion may be randomly selected.

[0064] The weighting coefficient a is initialized to an initial weighting coefficient a0 provided by the user. Preferably, the initial weighting coefficient a0 is close to 0%. For example, the initial weighting coefficient a0 may be initialized to 1%.

[0065] In this way, the amount of training data used for the evaluation of the first combination of hyperparameters is relatively small.

[0066] The weighting coefficient a then evolves during the process of searching for the optimal combination of hyperparameters until it approaches 100% at the end of the search for the optimal combination of hyperparameters.

[0067] It is also possible to impose a minimum quantity of training data to be used for the training phase. In particular, when the trained model is a classification model, it is possible to provide, for each defined class, a minimum number of samples representative of this class, for example 50 samples.

[0068] The testing phase of the machine learning model uses a set of user-provided TSTD test data to evaluate the performance of the hyperparameter combination.

[0069] The amount of test data used when evaluating the different combinations of hyperparameters sought is always the same.

[0070] Preferably, the testing phase of each evaluation step uses all user-provided TSTD test data to evaluate the performance of the hyperparameter combination. This ensures that all tested hyperparameter combinations are evaluated in the same manner.

[0071] The evaluation step makes it possible to calculate a performance score associated with the combination of hyperparameters. The calculated performance score, the tested combination of hyperparameters and the weighting coefficient a form a DAT data set delivered at the output of the evaluation step 21.

[0072] The calculated performance score, the tested hyperparameter combination and the weighting coefficient a used are stored during a step 22 in a DATB part of the MEM memory of the computer system SYS.

[0073] The method then comprises a step 23 of searching for a new combination of hyperparameters. In this step, a new combination of hyperparameters is searched for.

[0074] The new combination of hyperparameters is searched using a search algorithm well known to those skilled in the art.

[0075] For example, the search algorithm can be chosen from a grid search, a random search or a Bayesian search.

[0076] The search for a new combination of hyperparameters makes it possible to obtain a new combination of HPCMB hyperparameters which will be tested subsequently by repeating the method from evaluation step 21.

[0077] The method also comprises a step 24 of calculating a new coefficient of weighting. This new weighting coefficient will be used for the next iteration of evaluation step 21 if its value meets the conditions defined in verification step 25 described below.

[0078] In particular, the new weighting coefficient a is calculated from the old weighting coefficient a. For example, the new weighting coefficient a corresponds to the value k*a, where a is the old weighting coefficient and k is a coefficient greater than 1 defined by the user, for example between 1 and 2. Alternatively, it is possible to calculate the new weighting coefficient by adding a given value to the old weighting coefficient. For example, it is possible to add a value of 1% to the old weighting coefficient to obtain the new weighting coefficient.

[0079] The method then comprises a verification step 25. In this step 25, the new weighting coefficient is compared to two thresholds. In particular, the new weighting coefficient a is compared to 100% and to a value w*A, where A corresponds to a better weighting coefficient, and w is a coefficient greater than 1 defined by the user. The coefficient w is for example between 2 and 8, in particular equal to 4.

[0080] The best weighting coefficient A corresponds to the weighting coefficient a used to evaluate the combination of hyperparameters which made it possible to obtain the last best score among the combinations of hyperparameters already tested.

[0081] If the new weighting coefficient a is greater than 100% or the value w*A, then the new weighting coefficient is modified during a step 26 to be equal to the initial weighting coefficient.

[0082] If the new weighting coefficient a is less than or equal to 100% or to the value w*A, then the new weighting coefficient is maintained.

[0083] The new weighting coefficient defined is then used for the next iteration of evaluation step 21

[0084] Following each evaluation step 21, the method also comprises a step 27 of comparing the performance score. In this step 27, the performance score calculated during the evaluation step 21 is compared to a better performance score.

[0085] If the performance score calculated during the evaluation step 21 is higher than the best score, then the method comprises a step 28 of updating the best score. In this step 28, the best score is updated by the performance score calculated during the evaluation step.

[0086] If the calculated performance score is higher than the best score, then the method also comprises a step 29 of updating the best weighting coefficient A. In this step 29, the best weighting coefficient A is updated by the weighting coefficient used for the evaluation of the combination of hyperparameters having obtained the performance score higher than the best score.

[0087] This best weighting coefficient A is initialized to the value of the initial weighting coefficient a0.

[0088] As indicated previously, for each new combination of hyperparameters sought, the method is repeated from the evaluation step 21 to evaluate the new combination of hyperparameters.

[0089] Nevertheless, the training phase of each evaluation step 21 is carried out from training data whose quantity depends on the weighting coefficient a which is increased at each iteration of the evaluation step until reaching 100% or the value w*A.

[0090] This makes it possible to increase the quantity of training data taken into account during the training phase of the evaluation step during the different iterations of the evaluation step 21, until the weighting coefficient reaches 100% or the value w*A.

[0091] In such a method, the training phase of the steps of evaluating the hyperparameter combinations is carried out with training data whose quantity is dynamically adjusted.

[0092] The amount of training data for a training phase is dynamically adjusted to use only a reduced amount of training data for certain hyperparameter combination tests so as to accelerate the process of finding an optimal hyperparameter combination.

[0093] Indeed, it is not necessary to train the machine learning model with the entire training data set to measure an approximation of the performance of a combination of hyperparameters.

[0094] In particular, a portion of the training data is generally sufficient to measure an approximation of the performance of a combination of hyperparameters. For example, a portion corresponding to 10% of the training data makes it possible to obtain a sufficient approximation of the performance of a combination of hyperparameters.

[0095] Using only a portion of the training data allows the training phase of the evaluation step to be performed more quickly. The training phase of the hyperparameter combination evaluation steps corresponds to the step of the search process that takes the longest to perform.

[0096] As a result, reducing the execution time of the training phases also makes it possible to carry out the hyperparameter combination search process more quickly for a given number of hyperparameter combinations to be tested, or to increase the number of hyperparameter combinations to be tested for a given period of execution of the hyperparameter combination search method.

[0097] Once the optimal combination of hyperparameters is found, the optimal model can be trained with the entire training data set, so as to obtain the best performance of this machine learning model. Thus, the quality of the optimal model is guaranteed.

Claims

Claims

1. A computer-implemented method for finding an optimal combination of hyperparameters for defining a machine learning model, the method comprising a plurality of hyperparameter combination tests (21), each hyperparameter combination test comprising a training phase and a testing phase, the training phase being adapted to train the machine learning model from training data and the testing phase being adapted to calculate a performance score associated with the tested hyperparameter combination from testing data, the optimal hyperparameter combination corresponding to the hyperparameter combination having obtained the best performance score among the tested hyperparameter combinations, the method further comprising a definition of a weighting coefficient (a) for adjusting the amount of training data used for the training phase,said weighting coefficient being dynamically adapted (24, 26) during the different tests of the combinations of hyperparameters.,

2. The method of claim 1, wherein the weighting coefficient (a) is initialized to an initial weighting coefficient (a0).

3. The method of claim 2, wherein the initial weighting coefficient (a0) is less than or equal to 1%.

4. Method according to one of claims 1 to 3 wherein said weighting coefficient (a) is updated (24, 26) for each test (21) of combination of hyperparameters.

5. The method of claim 4, wherein updating the weighting coefficient (a) to be used for a given hyperparameter combination test comprises calculating (24) a new weighting coefficient from an old weighting coefficient used in the hyperparameter combination test directly preceding said given hyperparameter combination test.

6. The method of claim 5, wherein the new weighting coefficient is calculated by the formula k*a, where a is the old weighting coefficient and k is a coefficient greater than 1.

7. Method according to one of claims 1 to 6, further comprising a definition of a dynamically defined best weighting coefficient, this best weighting coefficient corresponding to the co- efficient weighting used for the training phase of the test of the hyperparameter combination that obtained the best performance score among the hyperparameter combinations already tested.

8. The method of claim 7 wherein updating the weighting coefficient comprises comparing the new weighting coefficient to the value 100% and the value w*A, where A is the best defined weighting coefficient and w is a coefficient greater than 1, the weighting coefficient being updated to the value of the new weighting coefficient if the new calculated weighting coefficient is less than or equal to the value 100% or the value w*A, or updated to the value of the initial weighting coefficient otherwise.

9. Computer program product comprising instructions which, when the program is executed by a computer, cause the latter to implement a method according to one of claims 1 to 8.

10. Computer system comprising: - a memory (MEM) in which a computer program (PRG) according to claim 9 is stored, and - a processing unit (UT) configured to implement the computer program (PRG).

Citation Information

Patent Citations

  • Apparatus and method for managing machine learning

    US20180018586A1

  • Hyperparameter recommendation for machine learning method

    WO2021000244A1