Hyperparameter selection method, use method, device and electronic device

By selecting multiple candidate hyperparameter values ​​and selecting the optimal value based on the evaluation indicators after training, the problem of existing hyperparameter selection relying on manual experience is solved, and the training efficiency and performance of the deep learning network are improved.

CN109711548BActive Publication Date: 2024-09-06GOERTEK OPTICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201811604530.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-12-26
Publication Date
2024-09-06
Estimated Expiration
2038-12-26

AI Technical Summary

Technical Problem

Existing hyperparameter selection methods rely on manual experience, which is difficult to ensure the accuracy of hyperparameters and affects the training efficiency and performance of deep learning networks.

Method used

By obtaining multiple candidate hyperparameter values, the deep learning network is trained separately, and the optimal hyperparameter value is selected based on the evaluation index after training to form an optimal hyperparameter value set for training of the deep learning network.

Benefits of technology

It improves the training speed and accuracy of deep learning networks, and improves the performance and training efficiency of machine learning network models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109711548B
    Figure CN109711548B
Patent Text Reader

Abstract

The present invention discloses a method for selecting a hyperparameter, a method for using the hyperparameter, a device and an electronic device. The method for selecting a hyperparameter includes: obtaining multiple candidate hyperparameter values ​​of a target hyperparameter; using each candidate hyperparameter value as a hyperparameter value of a corresponding target hyperparameter of a preset deep learning network, respectively, and performing training in accordance with a preset number of training steps on a training sample set including multiple training samples based on a preset deep learning network, obtaining an evaluation index after each step of training for each candidate hyperparameter value as a hyperparameter value of a corresponding target hyperparameter of the preset deep learning network; selecting the optimal hyperparameter value of each step of training according to the evaluation index, and obtaining an optimal hyperparameter value set of the target hyperparameter composed of the optimal hyperparameter value of each step of training in the number of training steps.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and more specifically, to a hyperparameter selection method, a use method, a device, and an electronic device. Background Art

[0002] As artificial intelligence technology based on machine learning network models becomes more and more common in scenarios such as image recognition, natural language processing, and sequence decision-making, it significantly improves the operational efficiency in application scenarios and brings great convenience to people's production and life.

[0003] The use of machine learning network models is inseparable from the training of machine learning network models. The training of machine learning network models includes adjusting the parameters of the deep learning network on which the machine learning network model is based. In addition to the weight parameters of the network structure itself, the parameters of the deep learning network also include some parameters that are not solved by the deep learning network itself during the learning and training process. These parameters are called hyperparameters.

[0004] Commonly used deep learning networks include R-CNN (Region-Convolutional Neural Networks), resnet (Residual Neural Network), etc., and their hyperparameters usually include learning rate, batch size, network unit dropout rate, etc.

[0005] The hyperparameters of the deep learning network will affect the convergence accuracy and convergence speed of the deep learning network, as well as the detection performance of the machine learning network model based on the deep learning network training. Therefore, the selection of hyperparameters is crucial for the training of the machine learning network model.

[0006] The existing selection of hyperparameters mainly relies on the training personnel who implement the machine learning model training based on their own model training experience. The trainers usually compare the training results of the model training and select the hyperparameters corresponding to the set of training results that they think are better. However, such a hyperparameter selection method is often limited by the trainers' own experience and cannot guarantee the accuracy of the selected hyperparameters. Summary of the invention

[0007] An object of the present invention is to provide a new technical solution for selecting hyperparameters.

[0008] According to a first aspect of the present invention, a method for selecting a hyperparameter is provided, comprising:

[0009] Obtain multiple candidate hyperparameter values ​​for the target hyperparameter;

[0010] Respectively taking each of the candidate hyperparameter values ​​as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, and performing training for a preset number of training steps on a training sample set including a plurality of training samples based on the preset deep learning network, to obtain an evaluation index after each step of training for each of the candidate hyperparameter values ​​when the candidate hyperparameter value is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network;

[0011] According to the evaluation index, the optimal hyperparameter value of each training step is selected to obtain the optimal hyperparameter value set of the target hyperparameter, which is composed of the optimal hyperparameter value of each training step in the training steps.

[0012] Optionally, the step of obtaining multiple candidate hyperparameter values ​​of the target hyperparameter includes:

[0013] In a preset value range, multiple values ​​that meet the preset accuracy requirements are selected as the candidate hyperparameter values;

[0014] and / or,

[0015] The step of selecting the optimal hyperparameter value for each step of training according to the evaluation index comprises:

[0016] From the multiple candidate hyperparameter values, the candidate hyperparameter value with the highest evaluation index after each step of training is selected as the optimal hyperparameter value for each step of training.

[0017] Optionally, the step of obtaining the evaluation index after each step of training when each candidate hyperparameter value is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network includes:

[0018] Respectively taking each of the candidate hyperparameter values ​​as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, and performing each step of training on the training sample set based on the preset deep learning network, when each of the candidate hyperparameter values ​​is obtained as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, an intermediate model after each step of training;

[0019] According to the intermediate model after each step of training, each of the training samples included in the training sample set is identified to obtain an identification result after each step of training when each candidate hyperparameter value is used as a hyperparameter value of a corresponding target hyperparameter of the preset deep learning network;

[0020] The recognition result includes whether each training sample in the training sample set is recognized as a positive sample;

[0021] According to the recognition result, each of the candidate hyperparameter values ​​is obtained as an evaluation indicator after each step of training when the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network is used.

[0022] Optionally,

[0023] The training sample set has a corresponding verification sample set, the verification sample set includes a plurality of verification samples, each verification sample uniquely corresponds to a training sample in the training sample set, and the verification samples are divided into positive samples or negative samples;

[0024] The step of obtaining each candidate hyperparameter value as an evaluation index after each step of training for the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network includes:

[0025] According to the recognition result of each candidate hyperparameter value after each step of training and the verification sample set, the accuracy and recall rate of each candidate hyperparameter value after each step of training are obtained;

[0026] According to the accuracy and recall rate of each candidate hyperparameter value after each step of training, an evaluation index of each candidate hyperparameter value after each step of training is obtained.

[0027] Optionally,

[0028] The step of obtaining the accuracy and recall of each candidate hyperparameter value after each step of training includes:

[0029] According to the recognition result of each candidate hyperparameter value after each step of training, the number of training samples recognized as positive samples in the recognition result is obtained;

[0030] The accuracy rate is obtained based on the number of training samples identified as positive samples in the recognition result and the number of verification samples included in the verification sample set, and the recall rate is obtained based on the number of training samples identified as positive samples in the recognition result and the number of verification samples included in the verification sample set that are positive samples.

[0031] Optionally, the step of obtaining an evaluation index of each candidate hyperparameter value after each step of training includes:

[0032] The evaluation index is obtained by summing the product value of the accuracy and the preset first weight and the product value of the recall and the preset second weight.

[0033] According to a second aspect of the present invention, a method for using a hyperparameter is provided, comprising:

[0034] Before each step of training based on a preset deep learning network, a corresponding optimal hyperparameter value is selected from a set of optimal hyperparameter values ​​of a target hyperparameter, and is set as the hyperparameter value of the target hyperparameter of the preset deep learning network to perform each step of training;

[0035] The optimal hyperparameter value set is obtained according to the hyperparameter selection method of the first aspect of the present invention, and the optimal hyperparameter value set includes the optimal hyperparameter value used in each training step of the target hyperparameter in a preset number of training steps.

[0036] According to a third aspect of the present invention, a hyperparameter selection device is provided, comprising:

[0037] An acquisition unit, used for acquiring multiple candidate hyperparameter values ​​of a target hyperparameter;

[0038] An evaluation unit, configured to respectively use each of the candidate hyperparameter values ​​as a hyperparameter value of a corresponding target hyperparameter of a preset deep learning network, and to perform training for a preset number of training steps on a training sample set including a plurality of training samples based on a preset deep learning network, to obtain an evaluation index after each step of training for each of the candidate hyperparameter values ​​when the candidate hyperparameter value is used as a hyperparameter value of a corresponding target hyperparameter of the preset deep learning network;

[0039] A selection unit is used to select the optimal hyperparameter value of each training step according to the evaluation index, and obtain an optimal hyperparameter value set of the target hyperparameter composed of multiple optimal hyperparameter values.

[0040] According to a fourth aspect of the present invention, there is provided a device for using a hyperparameter, comprising:

[0041] A device for selecting a corresponding optimal hyperparameter value from a set of optimal hyperparameter values ​​of a target hyperparameter before each step of training based on a preset deep learning network, and setting the value as the hyperparameter value of the target hyperparameter of the preset deep learning network, so as to perform each step of training;

[0042] The optimal hyperparameter value set is obtained according to the hyperparameter selection method of the first aspect of the present invention, and the optimal hyperparameter value set includes the optimal hyperparameter value of the target hyperparameter in each training step in a preset number of training steps.

[0043] According to a fifth aspect of the present invention, there is provided an electronic device, comprising:

[0044] A memory for storing executable instructions;

[0045] The processor is used to run the electronic device to execute the method for selecting hyperparameters according to the first aspect of the present invention or the method for using hyperparameters according to the second aspect of the present invention under the control of the executable instructions.

[0046] According to an embodiment of the present disclosure, each of the multiple candidate hyperparameter values ​​of the obtained target hyperparameter is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, and a training sample set including multiple training samples is trained in accordance with a preset number of training steps to obtain an evaluation index for each candidate hyperparameter value after each step of training, so as to select the optimal hyperparameter value of the target hyperparameter in each step of training according to the evaluation index to obtain a corresponding optimal hyperparameter value set, and according to the optimal hyperparameter value set, the optimal hyperparameter value of the target hyperparameter is provided for training in each step of training based on the deep learning network. Compared with the entire training process relying on manual experience to select a fixed hyperparameter value of the target hyperparameter for training, the training process based on the deep learning network can have a faster convergence speed and a higher convergence accuracy, and accordingly improve the performance of the machine learning network model based on deep learning network training, and improve the training efficiency.

[0047] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0049] Figure 1 1 is a block diagram showing an example of a hardware configuration of an electronic device 1000 that can be used to implement an embodiment of the present invention.

[0050] Figure 2 A flow chart of a method for selecting hyperparameters according to an embodiment of the present invention is shown.

[0051] Figure 3 A schematic diagram showing an example of changes in the evaluation index of the hyperparameter value of the present invention.

[0052] Figure 4 A block diagram of a hyperparameter selection device 3000 according to an embodiment of the present invention is shown.

[0053] Figure 5 A block diagram of an electronic device 4000 according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0054] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.

[0055] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0056] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0057] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0058] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0059] <Hardware Configuration>

[0060] Figure 1 1 is a block diagram showing a hardware configuration of an electronic device 1000 that can implement an embodiment of the present invention.

[0061] The electronic device 1000 may be a portable computer, a desktop computer, a mobile phone, a tablet computer, etc. Figure 1 As shown, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. Among them, the processor 1100 may be a central processing unit CPU, a microprocessor MCU, and the like. The memory 1200 includes, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a headphone interface, and the like. The communication device 1400 is, for example, capable of wired or wireless communication, and may specifically include Wifi communication, Bluetooth communication, 2G / 3G / 4G / 5G communication, and the like. The display device 1500 is, for example, a liquid crystal display screen, a touch display screen, and the like. The input device 1600 may include, for example, a touch screen, a keyboard, a somatosensory input, and the like. The user may input / output voice information through the speaker 1700 and the microphone 1800.

[0062] Figure 1The electronic device shown is merely illustrative and does not in any way limit the present invention, its application or use. In the embodiments of the present invention, the memory 1200 of the electronic device 1000 is used to store instructions, and the instructions are used to control the processor 1100 to operate to perform any one of the hyperparameter selection methods or hyperparameter use methods provided in the embodiments of the present invention. It should be understood by those skilled in the art that although Figure 1 In the electronic device 1000, multiple devices are shown, but the present invention may only involve some of the devices, for example, the electronic device 1000 only involves the processor 1100 and the storage device 1200. A technician can design instructions according to the scheme disclosed in the present invention. How instructions control the processor to operate is well known in the art, so it will not be described in detail here.

[0063] <First Embodiment>

[0064] In this embodiment, a method for selecting hyperparameters is provided. Hyperparameters are a type of parameters of the deep learning network on which the machine learning network model is based. Hyperparameters are different from the weight parameters of the network results of the deep learning network itself, and are not parameters solved in the training of the machine learning network model. In this embodiment, the hyperparameters may be the learning rate (Learning Rate), batch size (batch size), or network unit dropout rate (dropout) of the deep learning network. The learning rate is a hyperparameter used to control the speed of adjusting the weights of the deep learning network based on the loss gradient. Batch size refers to the number of training samples selected from the training set each time the deep learning network is trained. The network unit dropout rate refers to the process of temporarily discarding a neural network unit from the network according to a certain probability during the training process of the deep learning network.

[0065] like Figure 2 As shown, the method for selecting hyperparameters includes: steps S2100-S2300.

[0066] Step S2100, obtaining multiple candidate hyperparameter values ​​of the target hyperparameter.

[0067] The target hyperparameter is a hyperparameter of a certain category that is expected to be selected. For example, the target hyperparameter can be the learning rate, batch size, or network unit dropout rate.

[0068] Candidate hyperparameter values ​​are possible values ​​for the target hyperparameter.

[0069] In this embodiment, a plurality of candidate hyperparameter values ​​may be pre-set based on experimental simulation or engineering experience and stored in a readable storage medium for acquisition when the hyperparameter selection method of this embodiment is implemented.

[0070] In one example, the step of obtaining multiple candidate hyperparameter values ​​of the target hyperparameter may include:

[0071] In the preset value range, multiple values ​​that meet the preset accuracy requirements are selected as candidate hyperparameter values.

[0072] The preset value range can be set according to experimental simulation or engineering experience. The preset accuracy requirement can be set according to specific application scenarios or application requirements.

[0073] In the preset value range, multiple values ​​that meet the preset accuracy requirements are selected as candidate hyperparameter values, so that the candidate hyperparameter values ​​are more in line with the training scenarios or training requirements of the deep learning network, so as to select more accurate hyperparameter values ​​for the target hyperparameters in combination with subsequent steps.

[0074] In this embodiment, the specific number of candidate hyperparameter values ​​can be set according to specific application requirements or application scenarios, and is not uniquely limited here.

[0075] Step S2200, respectively use each candidate hyperparameter value as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, perform training for a preset number of training steps on a training sample set including multiple training samples based on the preset deep learning network, and obtain evaluation indicators after each step of training for each candidate hyperparameter value when it is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network.

[0076] In this embodiment, the preset deep learning network can be set according to the specific application scenario or application requirements. For example, the preset deep learning network can adopt various common convolutional neural networks, such as ResNet (Deepresidual network) or other open source available convolutional neural networks. The preset deep learning network can extract features as training samples (such as pictures) through convolution, maximum pooling and other processing. The activation function of the preset deep learning network can also be set according to the specific application scenario or application requirements, for example, using ReLU (Rectified Linear Unit, linear rectification) function as the activation function.

[0077] In this embodiment, the training sample set can be constructed according to the application scenario or application requirements. For example, the images provided by the training set and the verification set in the open source training set MNIST project can be processed using the open source data flow programming-based mathematical system TensorFlow, and each original image can be converted into a training sample of a preset size, and the specific contents of the training sample including image data, storage path, image encoding format, image features, etc. are stored as a TensorFlow format file that can be directly read when training the deep learning network, so as to realize the construction of a training set including multiple training samples.

[0078] The preset number of training steps can be set according to specific training needs or training scenarios, and is not limited here.

[0079] The evaluation index is an index used to evaluate the training performance obtained when a corresponding hyperparameter value is selected for a certain hyperparameter as the hyperparameter value for training the neural learning network. The training performance includes the convergence accuracy and convergence speed of the training based on the neural learning network.

[0080] In the research and development of deep learning network training, the applicant has found through a lot of work that for the same target hyperparameter, when different hyperparameter values ​​are used for training, the level of the evaluation index obtained from the training is not relatively constant, that is, the quality of the training effect shown by different hyperparameter values ​​is not constant, but will change with the number of training steps of the deep learning network. For example, Figure 3 As shown, for the preset deep learning network, the corresponding target hyperparameters use three hyperparameter values: lr1, lr2, and lr3. When the number of training steps is x1, the evaluation index of the hyperparameter value lr3 is the highest. When the number of training steps is x2, the evaluation index of the hyperparameter value lr2 is the highest. When the number of training steps is x3, the evaluation index of the hyperparameter value lr3 is the highest again. When the number of training steps is greater than x3, the evaluation index of the hyperparameter value lr1 is the highest.

[0081] Therefore, each candidate hyperparameter value is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network for corresponding training, and the corresponding evaluation indicators after each step of training are obtained. The optimal hyperparameter value of each step of training can be selected in combination with subsequent steps. The optimal hyperparameter value of the target hyperparameter can be provided for training in each step of training based on the deep learning network. Compared with the entire training process relying on manual experience to select fixed hyperparameter values ​​of the target hyperparameter for training, the training process based on the deep learning network can have a faster convergence speed and higher convergence accuracy, thereby correspondingly improving the performance of the machine learning network model based on deep learning network training and improving training efficiency.

[0082] In one example, when obtaining each candidate hyperparameter value as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, the step of obtaining the evaluation index after each step of training may include: steps S2210-S2230.

[0083] Step S2210, respectively use each candidate hyperparameter value as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, and after each step of training on the training sample set based on the preset deep learning network, when each candidate hyperparameter value is obtained as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, the intermediate model after each step of training.

[0084] Usually, when training a machine learning model based on a deep learning network, a final target machine learning model is output after multiple training steps. In this case, an intermediate model is output after each step of training the training sample set based on the preset deep learning network training based on each candidate hyperparameter value. For example, assuming there are N candidate hyperparameter values ​​and the preset number of training steps is N, correspondingly, N*M intermediate models can be obtained and output.

[0085] In this example, the specific form of the intermediate model is related to the specific training samples included in the training sample set and the actual number of training steps, and is not specifically limited.

[0086] Step S2220, based on the intermediate model after each step of training, each training sample included in the training sample set is identified, and the identification result after each step of training is obtained when each candidate hyperparameter value is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network.

[0087] In this example, the recognition result includes whether each training sample in the training sample set is recognized as a positive sample.

[0088] By using each candidate hyperparameter value as the intermediate model after each step of training of the corresponding target hyperparameter of the preset deep learning network, the recognition result obtained by identifying the training sample set can be used to characterize the corresponding training performance after each step of training when each candidate hyperparameter value is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network. Correspondingly, the corresponding evaluation indicators can be obtained through the recognition results of each step of training in combination with subsequent steps.

[0089] Step S2230, based on the recognition result, obtaining each candidate hyperparameter value as an evaluation indicator after each step of training when the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network is used.

[0090] In a specific example, the training sample set has a corresponding validation sample set. The validation sample set includes multiple validation samples, each validation sample uniquely corresponds to a training sample in the training sample set, and the validation samples are divided into positive samples or negative samples.

[0091] The step of obtaining each candidate hyperparameter value as an evaluation indicator after each step of training when the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network includes: steps S2231-S2232.

[0092] Step S2231, according to the recognition result of each candidate hyperparameter value after each step of training and the verification sample set, the accuracy and recall rate of each candidate hyperparameter value after each step of training are obtained.

[0093] The accuracy rate is the ratio of the recognition results that are identified as positive samples.

[0094] The recall rate is the ratio of positive samples to all positive samples in the recognition results.

[0095] The step of obtaining the accuracy and recall of each candidate hyperparameter value after each step of training may include: steps S22311-S22312.

[0096] Step S22311, according to the recognition result of each candidate hyperparameter value after each step of training, obtain the number of training samples identified as positive samples in the recognition result.

[0097] Step S22312, obtain the accuracy rate according to the number of training samples identified as positive samples in the recognition result and the number of verification samples included in the verification sample set, and obtain the recall rate according to the number of training samples identified as positive samples in the recognition result and the number of verification samples included in the verification sample set that are positive samples.

[0098] Assume that the number of training samples identified as positive samples in the recognition result is N1, the number of verification samples included in the verification sample set is N2, and the number of verification samples included in the verification sample set that are positive samples is N3. Correspondingly, the accuracy rate P = N1 / N2, and the recall rate R = N1 / N3.

[0099] After obtaining the accuracy and recall of each candidate hyperparameter value after each step of training, proceed to:

[0100] Step S2232, obtaining the evaluation index of each candidate hyperparameter value after each step of training according to the accuracy and recall rate of each candidate hyperparameter value after each step of training.

[0101] In a specific example, the step of obtaining the evaluation index of each candidate hyperparameter value after each step of training includes:

[0102] The product value of the accuracy and the preset first weight is summed with the product value of the recall and the preset second weight to obtain the evaluation index.

[0103] The preset first weight and second weight can be set according to specific application scenarios or application requirements.

[0104] For example, assuming that the preset first weight is α, the preset second weight is β, and the accuracy of a candidate hyperparameter value after a certain step of training is P, and the recall rate is R, the corresponding evaluation indicators are:

[0105] Y = α*P + β*R.

[0106] The first weight and the second weight are both constants and can be preset based on experience.

[0107] Similarly, the evaluation index of each candidate hyperparameter value after each step of training can be obtained.

[0108] After obtaining the evaluation indicators of each candidate hyperparameter value after each step of training, enter:

[0109] Step S2300, selecting the optimal hyperparameter value of each training step according to the evaluation index, and obtaining the optimal hyperparameter value set of the target hyperparameter composed of the optimal hyperparameter value of each training step in the training steps.

[0110] The evaluation index of each candidate hyperparameter value after each step of training can reflect the training performance of the corresponding step of training when the deep learning network is trained based on the candidate hyperparameter value. The optimal hyperparameter value of the target hyperparameter in each step of training is selected according to the evaluation index to obtain the corresponding optimal hyperparameter value set. According to the optimal hyperparameter value set, the optimal hyperparameter value of the target hyperparameter is provided for training in each step of training based on the deep learning network. Compared with the entire training process relying on manual experience to select fixed hyperparameter values ​​of the target hyperparameter for training, the training process based on the deep learning network can have a faster convergence speed and higher convergence accuracy, thereby correspondingly improving the performance of the machine learning network model based on deep learning network training and improving training efficiency.

[0111] In one example, the steps of selecting the optimal hyperparameter value for each step of training according to the evaluation index include:

[0112] From multiple candidate hyperparameter values, the candidate hyperparameter value with the highest evaluation index after each step of training is selected as the optimal hyperparameter value for each step of training.

[0113] The candidate hyperparameter value with the highest evaluation index after each step of training corresponds to the candidate hyperparameter value with the best training performance in that step of training. The candidate hyperparameter value is used as the hyperparameter value of the target hyperparameter in that step of training as the optimal hyperparameter value. This ensures that the hyperparameter value with the best training performance is provided for training in each step of training. Compared with the entire training process that relies on manual experience to select a fixed hyperparameter value for the target hyperparameter for training, the training process based on the deep learning network can have a faster convergence speed and a higher convergence accuracy, thereby correspondingly improving the performance of the machine learning network model based on deep learning network training and improving training efficiency.

[0114] <Hyperparameter selection device>

[0115] In this embodiment, a hyperparameter selection device 3000 is provided, such as Figure 4 As shown, it includes: an acquisition unit 3100, an evaluation unit 3200 and a selection unit 3300, which are used to implement the method for selecting the hyperparameters provided in this embodiment, which will not be repeated here.

[0116] The acquisition unit 3100 is used to acquire multiple candidate hyperparameter values ​​of the target hyperparameter.

[0117] Optionally, the acquiring unit 3100 includes:

[0118] A device for selecting a plurality of values ​​that meet preset accuracy requirements in a preset value range as the candidate hyperparameter values.

[0119] The evaluation unit 3200 is used to respectively use each of the candidate hyperparameter values ​​as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, and perform training for a preset number of training steps on a training sample set including multiple training samples based on the preset deep learning network to obtain evaluation indicators after each step of training for each candidate hyperparameter value when the candidate hyperparameter value is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network.

[0120] The selection unit 3300 is used to select the optimal hyperparameter value for each step of training according to the evaluation index, and obtain an optimal hyperparameter value set of the target hyperparameter consisting of multiple optimal hyperparameter values.

[0121] Optionally, the selection unit 3300 selects the optimal hyperparameter value for each training step according to the evaluation index, including: selecting, from multiple candidate hyperparameter values, the candidate hyperparameter value with the highest evaluation index after each training step as the optimal hyperparameter value for each training step.

[0122] Optionally, the evaluation unit 3200 includes:

[0123] A device for respectively using each of the candidate hyperparameter values ​​as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, and for performing each step of training on the training sample set based on the preset deep learning network, when each of the candidate hyperparameter values ​​is obtained as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, an intermediate model after each step of training;

[0124] A device for identifying each of the training samples included in the training sample set according to the intermediate model after each step of training, and obtaining each of the candidate hyperparameter values ​​as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network after each step of training;

[0125] The recognition result includes whether each training sample in the training sample set is recognized as a positive sample;

[0126] A device for obtaining, based on the recognition result, each of the candidate hyperparameter values ​​as an evaluation indicator after each step of training for the hyperparameter value corresponding to the target hyperparameter of the preset deep learning network.

[0127] Further optionally,

[0128] The training sample set has a corresponding verification sample set, the verification sample set includes a plurality of verification samples, each verification sample uniquely corresponds to a training sample in the training sample set, and the verification samples are divided into positive samples or negative samples;

[0129] The device for obtaining, according to the recognition result, each of the candidate hyperparameter values ​​as an evaluation index after each step of training for the hyperparameter value corresponding to the target hyperparameter of the preset deep learning network comprises:

[0130] A device for obtaining the accuracy and recall rate of each candidate hyperparameter value after each step of training according to the recognition result of each candidate hyperparameter value after each step of training and the verification sample set;

[0131] A device for obtaining an evaluation index of each candidate hyperparameter value after each step of training according to the accuracy and recall rate of each candidate hyperparameter value after each step of training.

[0132] Further optionally, the device for obtaining the accuracy and recall rate of each candidate hyperparameter value after each step of training according to the recognition result of each candidate hyperparameter value after each step of training and the verification sample set includes:

[0133] A device for obtaining the number of training samples identified as positive samples in the recognition result according to the recognition result of each candidate hyperparameter value after each step of training;

[0134] A device for obtaining the accuracy rate based on the number of training samples identified as positive samples in the recognition result and the number of verification samples included in the verification sample set, and a device for obtaining the recall rate based on the number of training samples identified as positive samples in the recognition result and the number of verification samples included in the verification sample set that are positive samples.

[0135] Further optionally, the device for obtaining the evaluation index of each candidate hyperparameter value after each step of training according to the accuracy and recall rate of each candidate hyperparameter value after each step of training includes:

[0136] A device for obtaining the evaluation index by summing the product value of the accuracy rate and a preset first weight and the product value of the recall rate and a preset second weight.

[0137] Those skilled in the art should understand that the hyperparameter selection device 3000 can be implemented in various ways. For example, the hyperparameter selection device 3000 can be implemented by configuring the processor with instructions. For example, the instructions can be stored in a ROM, and when the device is started, the instructions are read from the ROM into a programmable device to implement the hyperparameter selection device 3000. For example, the hyperparameter selection device 3000 can be solidified into a special device (such as an ASIC). The hyperparameter selection device 3000 can be divided into independent units, or they can be combined together for implementation. The hyperparameter selection device 3000 can be implemented by one of the various implementations described above, or can be implemented by a combination of two or more of the various implementations described above.

[0138] <Electronic equipment>

[0139] In this embodiment, an electronic device 4000 is provided, such as Figure 5 As shown, including:

[0140] Memory 4100, used to store executable instructions;

[0141] The processor 4200 is used to run the electronic device 4000 to execute the hyperparameter selection method provided in this embodiment according to the control of the executable instructions.

[0142] In this embodiment, the electronic device 4000 may have various physical forms, for example, it may be a single chip microcomputer, a computer, a server, etc. having a memory and a processor, or it may be a Figure 1 An electronic device 1000 is shown.

[0143] The first embodiment of the present invention has been described above in conjunction with the accompanying drawings. According to this embodiment, a method, device and electronic device for selecting a hyperparameter are provided. Each of the multiple candidate hyperparameter values ​​of the obtained target hyperparameter is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network. A training sample set including multiple training samples is trained in accordance with a preset number of training steps to obtain an evaluation index for each candidate hyperparameter value after each step of training. The optimal hyperparameter value of the target hyperparameter in each step of training is selected according to the evaluation index to obtain a corresponding optimal hyperparameter value set. According to the optimal hyperparameter value set, the optimal hyperparameter value of the target hyperparameter is provided for training in each step of training based on the deep learning network. Compared with the entire training process relying on manual experience to select a fixed hyperparameter value of the target hyperparameter for training, the training process based on the deep learning network can have a faster convergence speed and a higher convergence accuracy, and accordingly improve the performance of the machine learning network model based on deep learning network training, and improve the training efficiency.

[0144] <Second Embodiment>

[0145] In this embodiment, a method for using a hyperparameter is provided, including:

[0146] Before each step of training based on the preset deep learning network, the corresponding optimal hyperparameter value is selected from the optimal hyperparameter value set of the target hyperparameter and set as the hyperparameter value of the target hyperparameter of the preset deep learning network for each step of training.

[0147] The optimal hyperparameter value set is obtained according to the hyperparameter selection method provided in the first embodiment, and the optimal hyperparameter value set includes the optimal hyperparameter value used in each training step of the target hyperparameter in a preset number of training steps.

[0148] The target hyperparameters, preset training steps, and preset deep learning network can all be set according to specific application scenarios or application requirements and will not be described in detail here.

[0149] By using the optimal hyperparameter value of the target hyperparameter for training in each step of training based on the deep learning network, the training process based on the deep learning network can have a faster convergence speed and higher convergence accuracy, thereby correspondingly improving the performance of the machine learning network model based on deep learning network training and improving training efficiency.

[0150] <Device using hyperparameters>

[0151] In this embodiment, a hyperparameter using device 5000 is provided, including:

[0152] A device for selecting a corresponding optimal hyperparameter value from a set of optimal hyperparameter values ​​of a target hyperparameter before each step of training based on a preset deep learning network, and setting the value as the hyperparameter value of the target hyperparameter of the preset deep learning network, so as to perform each step of training;

[0153] The optimal hyperparameter value set is obtained according to the hyperparameter selection method provided in the first embodiment, and the optimal hyperparameter value set includes the optimal hyperparameter value of the target hyperparameter in each training step in a preset number of training steps.

[0154] It should be understood by those skilled in the art that the device 5000 for using the hyperparameter can be implemented in various ways. For example, the device 5000 for using the hyperparameter can be implemented by configuring the processor with instructions. For example, the instructions can be stored in a ROM, and when the device is started, the instructions are read from the ROM into a programmable device to implement the device 5000 for using the hyperparameter. For example, the device 5000 for using the hyperparameter can be solidified into a dedicated device (such as an ASIC). The device 5000 for using the hyperparameter can be divided into independent units, or they can be combined together for implementation. The device 5000 for using the hyperparameter can be implemented by one of the various implementations described above, or can be implemented by a combination of two or more of the various implementations described above.

[0155] <Electronic equipment>

[0156] In this embodiment, an electronic device 6000 is provided, including:

[0157] Memory 6100, used to store executable instructions;

[0158] The processor 6200 is used to run the electronic device 6000 to execute the hyperparameter selection method provided in this embodiment according to the control of the executable instructions.

[0159] In this embodiment, the electronic device 6000 may have various physical forms, for example, a single chip microcomputer, a computer, a server, etc. having a memory and a processor, or a Figure 1 The electronic device 1000 is shown. In a specific example, the electronic device 6000 may be the same electronic device as the electronic device 4000 in the first embodiment.

[0160] The first embodiment of the present invention has been described above. According to this embodiment, a method, device and electronic device for using hyperparameters are provided. By using the optimal hyperparameter value of the target hyperparameter for training in each step of training based on a deep learning network, compared with the entire training process relying on manual experience to select a fixed hyperparameter value of the target hyperparameter for training, the training process based on the deep learning network can have a faster convergence speed and a higher convergence accuracy, thereby correspondingly improving the performance of the machine learning network model based on deep learning network training and improving training efficiency.

[0161] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0162] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0163] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0164] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.

[0165] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.

[0166] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0167] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0168] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, and a part of the module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.

[0169] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. A method for selecting hyperparameters, characterized in that: The hyperparameter is a type of parameter of the deep learning network on which the machine learning network model is based, and the method includes: Acquire multiple candidate hyperparameter values ​​of the target hyperparameter, convert the original image into a training sample of a preset size, and construct a training set including multiple training samples; wherein the step of acquiring multiple candidate hyperparameter values ​​of the target hyperparameter comprises: selecting multiple values ​​that meet the preset accuracy requirements in a preset value range as the candidate hyperparameter values; Respectively taking each of the candidate hyperparameter values ​​as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, and performing training in accordance with a preset number of training steps on a training sample set including a plurality of training samples based on the preset deep learning network, to obtain an evaluation index after each step of training when each of the candidate hyperparameter values ​​is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, wherein the evaluation index is used to evaluate the convergence accuracy and convergence speed obtained after each step of training when each of the candidate hyperparameter values ​​is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network; According to the evaluation index, the optimal hyperparameter value of each step of training is selected to obtain the optimal hyperparameter value set of the target hyperparameter, which is composed of the optimal hyperparameter value of each step of training in the training steps; wherein the step of selecting the optimal hyperparameter value of each step of training according to the evaluation index comprises: selecting the candidate hyperparameter value with the highest evaluation index after each step of training from the multiple candidate hyperparameter values ​​as the optimal hyperparameter value of each step of training; as well as, The step of obtaining the evaluation index after each step of training when each candidate hyperparameter value is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network comprises: Respectively taking each of the candidate hyperparameter values ​​as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, and performing each step of training on the training sample set based on the preset deep learning network, when each of the candidate hyperparameter values ​​is obtained as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, an intermediate model after each step of training; According to the intermediate model after each step of training, each of the training samples included in the training sample set is identified to obtain an identification result after each step of training when each candidate hyperparameter value is used as a hyperparameter value of a corresponding target hyperparameter of the preset deep learning network; The recognition result includes whether each training sample in the training sample set is recognized as a positive sample; According to the recognition result, each of the candidate hyperparameter values ​​is obtained as an evaluation indicator after each step of training when the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network is used.

2. The method according to claim 1, characterized in that The training sample set has a corresponding verification sample set, the verification sample set includes a plurality of verification samples, each verification sample uniquely corresponds to a training sample in the training sample set, and the verification samples are divided into positive samples or negative samples; The step of obtaining each candidate hyperparameter value as an evaluation index after each step of training for the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network includes: According to the recognition result of each candidate hyperparameter value after each step of training and the verification sample set, the accuracy and recall rate of each candidate hyperparameter value after each step of training are obtained; According to the accuracy and recall rate of each candidate hyperparameter value after each step of training, an evaluation index of each candidate hyperparameter value after each step of training is obtained.

3. The method according to claim 2, characterized in that The step of obtaining the accuracy and recall of each candidate hyperparameter value after each step of training includes: According to the recognition result of each candidate hyperparameter value after each step of training, the number of training samples recognized as positive samples in the recognition result is obtained; The accuracy rate is obtained based on the number of training samples identified as positive samples in the recognition result and the number of verification samples included in the verification sample set, and the recall rate is obtained based on the number of training samples identified as positive samples in the recognition result and the number of verification samples included in the verification sample set that are positive samples.

4. The method according to claim 3, characterized in that: The step of obtaining the evaluation index of each candidate hyperparameter value after each step of training comprises: The evaluation index is obtained by summing the product value of the accuracy and the preset first weight and the product value of the recall and the preset second weight.

5. A method for using a hyperparameter, characterized in that: include: Before each step of training based on a preset deep learning network, a corresponding optimal hyperparameter value is selected from a set of optimal hyperparameter values ​​of a target hyperparameter, and is set as the hyperparameter value of the target hyperparameter of the preset deep learning network to perform each step of training; The optimal hyperparameter value set is obtained according to the hyperparameter selection method according to any one of claims 1 to 4, and the optimal hyperparameter value set includes the optimal hyperparameter value used in each training step of the target hyperparameter in a preset number of training steps.

6. A device for selecting hyperparameters, characterized in that: The hyperparameter is a type of parameter of the deep learning network on which the machine learning network model is based, and the selection device includes: An acquisition unit, used to acquire multiple candidate hyperparameter values ​​of the target hyperparameter, wherein the acquisition unit includes a device for selecting multiple values ​​that meet a preset accuracy requirement in a preset value interval as the candidate hyperparameter values; An evaluation unit, for respectively using each of the candidate hyperparameter values ​​as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, and performing training in accordance with a preset number of training steps on a training sample set including a plurality of training samples based on the preset deep learning network, to obtain an evaluation index after each step of training when each of the candidate hyperparameter values ​​is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, wherein the evaluation index is used to evaluate the convergence accuracy and convergence speed obtained after each step of training when each of the candidate hyperparameter values ​​is used as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network; the training samples are obtained by converting the original images into a size that meets the preset size, and the training set is constructed by a plurality of training samples; A selection unit is used to select the optimal hyperparameter value of each step of training according to the evaluation index, and obtain an optimal hyperparameter value set of the target hyperparameter consisting of multiple optimal hyperparameter values, wherein the candidate hyperparameter value with the highest evaluation index after each step of training is selected from the multiple candidate hyperparameter values ​​as the optimal hyperparameter value of each step of training; as well as The evaluation unit comprises: A device for respectively using each of the candidate hyperparameter values ​​as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, and for performing each step of training on the training sample set based on the preset deep learning network, when each of the candidate hyperparameter values ​​is obtained as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network, an intermediate model after each step of training; A device for identifying each of the training samples included in the training sample set according to the intermediate model after each step of training, and obtaining each of the candidate hyperparameter values ​​as the hyperparameter value of the corresponding target hyperparameter of the preset deep learning network after each step of training; The recognition result includes whether each training sample in the training sample set is recognized as a positive sample; A device for obtaining, based on the recognition result, each of the candidate hyperparameter values ​​as an evaluation indicator after each step of training for the hyperparameter value corresponding to the target hyperparameter of the preset deep learning network.

7. A device for using hyperparameters, characterized in that: include: A device for selecting a corresponding optimal hyperparameter value from a set of optimal hyperparameter values ​​of a target hyperparameter before each step of training based on a preset deep learning network, and setting the value as the hyperparameter value of the target hyperparameter of the preset deep learning network, so as to perform each step of training; The optimal hyperparameter value set is obtained according to the hyperparameter selection method according to any one of claims 1 to 4, and the optimal hyperparameter value set includes the optimal hyperparameter value of the target hyperparameter in each training step in a preset number of training steps.

8. An electronic device, characterized in that: include: A memory for storing executable instructions; A processor is used to run the electronic device to execute the method for selecting the hyperparameters as described in any one of claims 1 to 4 or the method for using the hyperparameters as described in claim 5 under the control of the executable instructions.