Multitask model training method and device based on serial training, equipment and medium

By using a serial training method and a convergence evaluation mechanism for the rate of change of task loss, the prediction task is trained iteratively one by one, which solves the problems of high resource consumption, difficulty in balancing weights, and difficulty in measuring convergence in multi-task model training, thereby improving training efficiency and performance.

CN120975264APending Publication Date: 2025-11-18PERSAGY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511061697.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as high computational resource consumption, difficulty in balancing task weights, and difficulty in measuring training convergence during the training of multi-task models.

Method used

A serial training method is adopted to iteratively train different prediction tasks one by one, and a convergence evaluation mechanism based on the change rate of task loss is introduced. By obtaining the basic network model and training dataset of the target prediction scenario, the dataset is selected, the model is trained, and the convergence result is judged.

Benefits of technology

It improves the training efficiency of multi-task models, reduces the computational resource requirements, and optimizes the performance of multi-task prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120975264A_ABST
    Figure CN120975264A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-task model training method and device based on serial training, equipment and a medium. The method comprises the following steps: acquiring a basic network model containing a hidden layer and a task layer and a basic training data set corresponding to a target prediction scene; performing data screening on the basic training data set based on the task type of the initial prediction task in the task layer, and determining a target training data set corresponding to the initial prediction task; performing model training on the basic network model based on a preset serial training rule and the target training data set to obtain a to-be-selected network model corresponding to the basic network model and a loss value change rate set; and performing convergence judgment on the loss value change rate set based on a preset convergence condition, generating a convergence result, and determining a target network model corresponding to the to-be-selected network model based on the convergence result. Through the technical scheme of the invention, different tasks can be iteratively trained one by one, the training efficiency is improved, and the computing resource demand is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of machine learning, and in particular to a multi-task model training method and device based on serial training, equipment and medium. BACKGROUND

[0002] With the gradual development of machine learning technology, task models integrating multiple prediction tasks are gradually applied to various business scenarios. However, since each prediction task in the same task model usually has different static and dynamic characteristics, different tasks correspond to different known and unknown predicted variables, and there are various connection relationships between prediction tasks. Therefore, how to train a multi-task model becomes very important.

[0003] In the prior art, a multi-task model training strategy is usually used to train a multi-task model in parallel. That is, the data of multiple tasks is loaded at the same time, and the optimization of different tasks is balanced through weight adjustment. However, the method of training a multi-task model in parallel consumes a large amount of memory and computing resources when facing large-scale and multi-object complex physical systems, as it needs to load data of multiple tasks at the same time, which consumes a large amount of memory and computing resources, resulting in large consumption of computing resources; since the loss ranges of different tasks may differ greatly, it is difficult to find suitable training weights to fit all tasks, making it difficult to balance task weights; and since the loss reduction rates of different tasks are different, it is difficult to determine whether the overall training is truly converged, making it difficult to balance training convergence.

[0004] Therefore, how to solve the problems of large consumption of computing resources, difficult balancing of task weights, and difficult measurement of training convergence in the training process of a multi-task model, improve the training efficiency of a multi-task model, and reduce the demand for computing resources, is a problem that needs to be solved at present. SUMMARY

[0005] The present application provides a multi-task model training method and device based on serial training, which can solve the problems of large consumption of computing resources, difficult balancing of task weights, and difficult measurement of training convergence in the training process of a multi-task model.

[0006] According to an aspect of the present application, a multi-task model training method based on serial training is provided, comprising:

[0007] obtaining a basic network model and a basic training data set corresponding to a target prediction scene; wherein the basic network model comprises a hidden layer and a task layer; the task layer comprises a set number of initial prediction tasks;

[0008] performing data filtering on the basic training data set based on the task type of the initial prediction tasks in the task layer, to determine a target training data set corresponding to the initial prediction tasks;

[0009] train the base network model based on a preset serial training rule and the target training data set, to obtain a candidate network model corresponding to the base network model and a loss value change rate set;

[0010] judge convergence of the loss value change rate set based on a preset convergence condition, generate a convergence result, and determine a target network model corresponding to the candidate network model based on the convergence result.

[0011] According to another aspect of the present application, a serial training based multi-task model training device is provided, comprising:

[0012] a data acquisition module configured to acquire a base network model corresponding to a target prediction scenario and a base training data set; wherein the base network model comprises a hidden layer and a task layer; the task layer comprises a preset number of initial prediction tasks;

[0013] a data filtering module configured to filter the base training data set based on a task type of the initial prediction tasks in the task layer, and determine a target training data set corresponding to the initial prediction tasks;

[0014] a model training module configured to train the base network model based on a preset serial training rule and the target training data set, to obtain a candidate network model corresponding to the base network model and a loss value change rate set;

[0015] a model determination module configured to judge convergence of the loss value change rate set based on a preset convergence condition, generate a convergence result, and determine a target network model corresponding to the candidate network model based on the convergence result.

[0016] According to another aspect of the present application, an electronic device is provided, comprising:

[0017] at least one processor; and

[0018] a memory in communication connection with the at least one processor; wherein,

[0019] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the serial training based multi-task model training method according to any one of the embodiments of the present application.

[0020] According to another aspect of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to execute the serial training based multi-task model training method according to any one of the embodiments of the present application.

[0021] According to another aspect of the present application, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the serial training based multi-task model training method according to any of the embodiments of the present application.

[0022] The technical solution of the embodiment of the present application comprises the following steps: obtaining a basic network model comprising a hidden layer and a task layer and a basic training data set corresponding to a target prediction scenario; performing data filtering on the basic training data set based on a task type of an initial prediction task in the task layer to determine a target training data set corresponding to the initial prediction task; performing model training on the basic network model based on a preset serial training rule and the target training data set to obtain a to-be-selected network model corresponding to the basic network model and a loss value change rate set; and performing convergence judgment on the loss value change rate set based on a preset convergence condition to generate a convergence result and determine a target network model corresponding to the to-be-selected network model based on the convergence result. Due to the serial training strategy, different prediction tasks are iteratively trained one by one, and a convergence evaluation mechanism based on a task loss change rate is introduced, thereby solving the problems of large consumption of computing resources, difficulty in balancing task weights, and difficulty in measuring training convergence in the multi-task model training process, improving the training efficiency of the multi-task model, reducing the demand for computing resources, and optimizing the performance of multi-task prediction.

[0023] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0025] Figure 1 is a flowchart of a serial training based multi-task model training method according to embodiment one of the present application;

[0026] Figure 2 is a schematic diagram of updating a network model according to embodiment one of the present application;

[0027] Figure 3 is a flowchart of a serial training based multi-task model training method according to embodiment two of the present application;

[0028] Figure 4is a structural schematic diagram of a multi-task model training device based on serial training provided according to an embodiment three of the present application;

[0029] Figure 5 is a structural schematic diagram of an electronic device implementing a multi-task model training method based on serial training of an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.

[0031] It should be noted that the terms "first", "second", "target", "initial" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0032] Embodiment one

[0033] Figure 1 A flowchart of a multi-task model training method based on serial training provided for an embodiment one of the present application, the present embodiment can be applicable to the case of training a multi-task model containing multiple prediction tasks, the method can be executed by a multi-task model training device based on serial training, which can be realized in the form of hardware and / or software, and can be configured in an electronic device, for example, in a computer device. As shown in the figure, the method comprises: Figure 1

[0034] S110, obtaining a basic network model corresponding to a target prediction scene and a basic training data set; wherein the basic network model contains a hidden layer and a task layer; the task layer contains a set number of initial prediction tasks.

[0035] ​The prediction scene can refer to a task scene requiring data prediction. For example, the prediction scene can be a specific building space or an outdoor environment. The target prediction scene can refer to a pre-selected prediction scene. Generally, the target prediction scene can be determined according to actual application requirements. The training data can refer to data determined in advance for use in model training. For example, the training data can be pre-constructed parameter data, pre-collected device data or environmental data, etc. The training data set can refer to a set composed of various training data corresponding to the same prediction scene. The basic training data set can refer to an original training data set without processing. Generally, one target prediction scene corresponds to one basic training data set.

[0036] The prediction task can refer to a specific data prediction problem to be solved. Generally, each prediction task corresponds to a mapping relationship from input data to a specific output. The set number can refer to a pre-set value for counting the prediction tasks. Generally, the set number can be determined according to actual application requirements. The initial prediction task can refer to an original prediction task without training. The network model can refer to a multi-task prediction model containing multiple prediction tasks. The basic network model can refer to an original network model without training. Generally, the basic network model contains a hidden layer and a task layer, and the task layer contains a set number of initial prediction tasks.

[0037] S120, data filtering is performed on the basic training data set based on the task type of the initial prediction task in the task layer, and a target training data set corresponding to the initial prediction task is determined.

[0038] The task type can refer to the prediction problem type corresponding to the initial prediction task. For example, if the target prediction scene is a specific building space, the task type can be device state prediction or energy consumption prediction. The data filtering can refer to an operation of filtering and collecting the training data corresponding to the task type in the basic training data set. The target training data set can refer to a set composed of various training data corresponding to the task type in the basic training data set.

[0039] S130, model training is performed on the basic network model based on a pre-set serial training rule and the target training data set, and a candidate network model corresponding to the basic network model and a loss value change rate set are obtained.

[0040] The preset serial training rule can refer to a rule predefined for limiting the serial training process. For example, the preset serial training rule can include a training object and a specific training process of serial training. Specifically, the preset serial training rule can be: sequentially selecting different prediction tasks for training, rather than performing multiple tasks in parallel, training one task at a time, storing the latest model parameters of the task as the initial model parameters of the next task after the training is completed, and ending the overall model training process until all tasks are trained. The candidate network model can refer to a network model that is not evaluated after the preliminary training of the overall model is completed. The loss value change rate can refer to the change speed of the loss function value with the training step or time in the model training process. Generally, the loss value change rate can quantify the decline dynamics of the loss function and reflect the efficiency and stability of model optimization. The loss value change rate set can refer to a set composed of the loss value change rates corresponding to each initial prediction task in the same base network model.

[0041] In S140, a convergence result is generated based on the convergence judgment of the loss value change rate set based on the preset convergence condition, and a target network model corresponding to the candidate network model is determined based on the convergence result.

[0042] The preset convergence condition can refer to a mechanism predefined for convergence evaluation of the overall model training result. The convergence result can refer to a judgment result generated after the convergence judgment of the loss value change rate set based on the preset convergence condition. For example, the convergence result can be training convergence or training non-convergence. The target network model can refer to a final network model trained after the base network model is trained.

[0043] In an optional implementation, after the convergence judgment of the loss value change rate set based on the preset convergence condition, the convergence result is generated, and the target network model corresponding to the candidate network model is determined based on the convergence result, the method can further include:

[0044] In S a1, an incremental prediction task corresponding to the target prediction scene is obtained, and a model update is performed on the target network model based on the incremental prediction task, to obtain an updated network model corresponding to the target network model.

[0045] The incremental prediction task can refer to a newly added prediction task. For example, the incremental prediction task can be a prediction task newly established according to the current application requirement. The model update can refer to an operation of adding the incremental prediction task to the target network model. The updated network model can refer to a network model obtained by improving the model architecture of the target network model using the incremental prediction task.

[0046] Figure 2Fig. 1 shows a schematic diagram of an updating network model according to an embodiment of the present application. Specifically, the target network model includes an input layer, a hidden layer, a task layer, and an output layer. The task layer includes four prediction tasks, i.e., task 1, task 2, task 3, and task 4. The incremental prediction task is task 5. After determining the incremental prediction task (task 5) corresponding to the target prediction scenario, task 5 is added to the task layer of the target network model, thereby forming an updating network model corresponding to the target network model.

[0047] In step a2, the basic training data set is filtered based on the task type of the incremental prediction task, and a target training data set corresponding to the incremental prediction task is determined.

[0048] In step a3, the updating network model is trained based on a preset serial training rule and the target training data set, and an updated target network model is obtained.

[0049] Specifically, after determining the updating network model corresponding to the target network model, the basic training data set can be filtered based on the task type of the incremental prediction task, and the target training data set corresponding to the incremental prediction task is determined. Then, the incremental prediction task in the updating network model is trained based on a preset serial training rule and the target training data set, and an updated target network model is obtained. Thus, the training of the new prediction task can be completed on the basis of saving computing resources, and the model training efficiency is improved.

[0050] In an optional embodiment, after the loss value change rate set is judged based on the preset convergence condition, a convergence result is generated, and the target network model corresponding to the candidate network model is determined based on the convergence result, the method can further include: obtaining prediction task data corresponding to the target prediction scenario; wherein the prediction task data includes a prediction task unique identifier and task collection data; inputting the prediction task data into the target network model, and performing data prediction on the prediction task data based on the target network model to generate a data prediction result corresponding to the prediction task data.

[0051] The prediction task data can refer to input data that needs to be predicted. Generally, the prediction task data includes a prediction task unique identifier and task collection data. The prediction task unique identifier can refer to unique identification information corresponding to the prediction task. Generally, each prediction task in the target network model is distinguished by a unique identifier, and the unique identifier can determine which prediction task needs to be completed. The task collection data can refer to actual parameter data required to complete the prediction task. For example, if the prediction task is device status information, the task collection data can be device operation data that can be collected, such as air conditioner on time, ventilation temperature setting, gear setting, and weather information. The data prediction result can refer to the prediction result obtained by predicting the task collection data using the prediction task. For example, if the prediction task is to predict the power consumption of an air conditioner, the data prediction result can be a specific power consumption value predicted from the task collection data.

[0052] Specifically, after obtaining the target network model, if the prediction task data corresponding to the target prediction scene is received, the prediction task unique identifier in the prediction task data can be matched with the corresponding prediction task in the target network model, and then the task collection data in the prediction task data can be predicted using the prediction task to generate a data prediction result corresponding to the prediction task data. Thus, the data prediction process is completed.

[0053] The technical scheme of the embodiment of the present application obtains a basic network model containing a hidden layer and a task layer and a basic training data set corresponding to a target prediction scene. Then, the basic training data set is filtered based on the task type of an initial prediction task in the task layer to determine a target training data set corresponding to the initial prediction task. Further, the basic network model is trained based on a preset serial training rule and the target training data set to obtain a candidate network model corresponding to the basic network model and a loss value change rate set. Finally, the loss value change rate set is judged for convergence based on a preset convergence condition to generate a convergence result, and a target network model corresponding to the candidate network model is determined based on the convergence result. Due to the serial training strategy, different prediction tasks are iteratively trained one by one, and a convergence evaluation mechanism based on the task loss change rate is introduced, which solves the problems of large consumption of computing resources, difficulty in balancing task weights, and difficulty in measuring training convergence in the multi-task model training process, improves the training efficiency of the multi-task model, reduces the demand for computing resources, and optimizes the performance of multi-task prediction.

[0054] Embodiment two

[0055] Figure 3A flowchart of a multi-task model training method based on serial training is provided for the second embodiment of the present application. The second embodiment is based on the above-mentioned embodiment and is refined. In the second embodiment, the operation of training the base network model based on the preset serial training rule and the target training data set to obtain the candidate network model corresponding to the base network model is refined. Specifically, it can include: obtaining any one initial prediction task in the task layer as a first prediction task, and combining and processing the initial prediction tasks in the task layer except the first prediction task to obtain a candidate prediction task set; training the hidden layer and the first prediction task in the base network model based on the target training data set corresponding to the first prediction task to obtain a first network model; judging the candidate prediction task set based on a preset training cutoff condition to generate a data judgment result, and determining the candidate network model corresponding to the base network model based on the data judgment result and the first network model. As shown in Figure 3 The method comprises:

[0056] S210, obtaining a base network model corresponding to a target prediction scene and a base training data set; wherein the base network model comprises a hidden layer and a task layer; the task layer comprises a set number of initial prediction tasks.

[0057] S220, data filtering the base training data set based on the task type of the initial prediction tasks in the task layer to determine the target training data set corresponding to the initial prediction tasks.

[0058] S230, obtaining any one initial prediction task in the task layer as a first prediction task, and combining and processing the initial prediction tasks in the task layer except the first prediction task to obtain a candidate prediction task set.

[0059] The first prediction task can refer to the initial prediction task in the task layer that is first selected for training. For example, the first prediction task can be any one initial prediction task in the task layer. The candidate prediction task can refer to the remaining initial prediction tasks waiting for training. The candidate prediction task set can refer to a set composed of each candidate prediction task.

[0060] S240, training the hidden layer and the first prediction task in the base network model based on the target training data set corresponding to the first prediction task to obtain a first network model.

[0061] The first network model can refer to the network model obtained after training the hidden layer and the first prediction task in the base network model. That is, each candidate prediction task in the candidate prediction task set in the first network model has not been trained.

[0062] S250, performing data judgment on the set of candidate prediction tasks based on a preset training stop condition to generate a data judgment result, and determining a candidate network model corresponding to the base network model based on the data judgment result and the first network model.

[0063] The preset training stop condition can refer to a rule preset for determining the end of the overall model training process. For example, the preset training stop condition can be to end the overall model training process when all initial prediction tasks are trained. The data judgment result can refer to a judgment result generated after the set of candidate prediction tasks is judged based on the preset training stop condition. For example, the data judgment result can be a null value indicating that the number of initial prediction tasks in the set of candidate prediction tasks is zero, or a non-null value indicating the specific number of initial prediction tasks in the set of candidate prediction tasks.

[0064] Specifically, after determining the base network model corresponding to the target prediction scenario and the target training data set corresponding to the initial prediction task, any initial prediction task in the task layer can be selected as the first prediction task, and all initial prediction tasks in the task layer except the first prediction task can be combined and processed to obtain the set of candidate prediction tasks. Then, the target training data set corresponding to the first prediction task is used to train the hidden layer and the first prediction task in the base network model to obtain the first network model. Finally, the set of candidate prediction tasks is judged based on the preset training stop condition to generate a data judgment result, and the candidate network model corresponding to the base network model is determined based on the data judgment result and the first network model. Thus, the overall training process of the base network model is completed by using a serial training method, each task is optimized independently, the weight does not need to be manually adjusted, and the problem of poor training effect caused by improper selection of task weight is avoided, thereby providing an effective basis for subsequent operations.

[0065] In an optional embodiment, determining the candidate network model corresponding to the base network model based on the data judgment result and the first network model comprises:

[0066] In step b1, if the data judgment result is a null value, the first network model is determined as the candidate network model corresponding to the base network model.

[0067] Step b2, if the data judgment result is a non-empty value, an initial prediction task in the set of candidate prediction tasks is obtained as a second prediction task; the hidden layer and the second prediction task in the first network model are trained based on the target training data set corresponding to the second prediction task, to obtain a second network model; the set of candidate prediction tasks is subjected to data judgment based on a preset training stop condition, to generate a data judgment result, and a candidate network model corresponding to the base network model is determined based on the data judgment result and the second network model.

[0068] The second prediction task can refer to any one of the initial prediction tasks selected from the set of candidate prediction tasks. The second network model can refer to the network model obtained by training the hidden layer and the second prediction task in the first network model. That is, the second prediction task in the second network model has been trained.

[0069] Specifically, after the set of candidate prediction tasks is subjected to data judgment based on the preset training stop condition, to generate a data judgment result, it can be first determined whether the data judgment result is an empty value. If the data judgment result is an empty value, it indicates that the base network model only contains one initial prediction task, and the trained first network model can be directly determined as the candidate network model corresponding to the base network model. Conversely, if the data judgment result is a non-empty value, it indicates that there are still untrained initial prediction tasks in the set of candidate prediction tasks. An initial prediction task in the set of candidate prediction tasks can be obtained as a second prediction task, the hidden layer and the second prediction task in the first network model are trained based on the target training data set corresponding to the second prediction task, to obtain a second network model, the set of candidate prediction tasks is subjected to data judgment based on the preset training stop condition, to generate a data judgment result, and a candidate network model corresponding to the base network model is determined based on the data judgment result and the second network model. It is worth noting that after the initial prediction tasks in the set of candidate prediction tasks are trained, the set of candidate prediction tasks does not contain trained initial prediction tasks. If the data judgment result of the set of candidate prediction tasks is a non-empty value, the above operation is repeated until the number of untrained initial prediction tasks in the set of candidate prediction tasks is empty. Thus, by using the serial training mode of training one task at a time, the consumption of computing resources can be saved, and a larger scale system can be adapted.

[0070] S260, in the process of model training, the iteration number, the current iteration loss value and the previous iteration loss value corresponding to the target prediction task in the task layer are obtained.

[0071] The iteration number can refer to a numerical value used to limit the number of loops for updating the model parameters in the training process. Generally, different initial prediction tasks correspond to different iteration numbers, which can be determined in advance according to actual application requirements. The target prediction task can refer to a prediction task selected for iteration loss value determination. For example, the target prediction task can be the prediction task being trained at the current time.

[0072] The iteration loss value can refer to the loss value generated in one iteration process. For example, the iteration loss value can be a mean square error loss value, a relative confidence sampling loss value, a class balance sampling loss value, or a feature distribution smoothing loss value. Generally, a loss function can be selected for each prediction task according to actual application requirements, and thus the iteration loss value can be determined by the loss function, which is not limited in the embodiments of the present application. The current iteration loss value can refer to the iteration loss value corresponding to the iteration number at the current time. The previous iteration loss value can refer to the iteration loss value corresponding to the iteration number at the previous time.

[0073] S270, determining a loss value change rate sequence corresponding to the target prediction task based on the iteration number, the current iteration loss value, and the previous iteration loss value.

[0074] The loss value change rate sequence can refer to an array composed of each loss value change rate corresponding to the same target prediction task. For example, the loss value of the target prediction task i at each iteration number t is: For example, the total iteration number is n, and the loss value change rate corresponding to the target prediction task i can be represented as: Correspondingly, the loss value change rate sequence can be: It is worth noting that the first iteration t = 1 has no loss value change rate.

[0075] S280, combining the loss value change rate sequences corresponding to each target prediction task in the task layer to obtain a loss value change rate set.

[0076] Combining the loss value change rate sequences corresponding to each target prediction task in the task layer according to the iteration number can refer to combining the loss value change rates of the same iteration number corresponding to different target prediction tasks according to the iteration number. For example, the number of target prediction tasks is N (task 1, task 2,..., task N), the iteration number of each target prediction task is n, the loss value change rate of task 1 is represented as The loss value change rate of task 2 is represented as The loss value change rate of task N is represented as For example, the loss value change rates of the same iteration number can be combined to form a shape like the loss value change rate set comprising n arrays is obtained by combining the arrays corresponding to different iteration numbers.

[0077] S290, converging judgment is performed on the loss value change rate set based on a preset convergence threshold, and a convergence result is generated.

[0078] The preset convergence threshold can refer to a value preset for converging evaluation of the loss value change rate set. For example, the preset convergence threshold can be 2%.

[0079] Specifically, according to the above example, after obtaining the loss value change rate set, the average loss change rate of all prediction tasks in the same array can be calculated according to the formula: Further, all average loss change rates are sequentially combined to obtain an average change rate sequence corresponding to the loss value change rate set Generally, if the average loss change rate in the average change rate sequence gradually decreases, it indicates that the model optimization is effective. Therefore, the convergence trend of the average loss change rate can be used to preliminarily evaluate the loss value change rate set, and the preset convergence threshold can be used to perform converging judgment on the loss value change rate set to generate a convergence result.

[0080] S2100, it is judged whether the convergence result is training convergence; if the convergence result is training convergence, S2110 is performed; if the convergence result is training non-convergence, S2120 is performed.

[0081] S2110, the candidate network model is used as a target network model corresponding to a base network model.

[0082] S2120, model training is performed on the candidate network model based on a preset serial training rule and a target training data set to obtain an intermediate network model corresponding to the candidate network model and a loss value change rate set; converging judgment is performed on the loss value change rate set based on a preset convergence condition to generate a convergence result, and a target network model corresponding to the intermediate network model is determined based on the convergence result.

[0083] The intermediate network model can refer to a network model obtained by performing model training on the candidate network model based on the preset serial training rule and the target training data set.

[0084] Specifically, after the convergence result is generated by performing the convergence judgment on the loss value change rate set based on the preset convergence threshold, if the convergence result is that the training is not converged, the training process from the first prediction task to the last prediction task is repeatedly performed on the to-be-selected network model by using the preset serial training rule and the target training data set until the model training result meets the preset convergence condition, and only then the trained network model is taken as the target network model. Thus, by calculating the loss value change rates of all tasks and setting the change rate threshold, a more accurate convergence judgment mode can be realized to ensure that all tasks reach a stable state.

[0085] The technical scheme of the embodiment of the application comprises the following steps: obtaining a basic network model comprising a hidden layer and a task layer corresponding to a target prediction scene and a basic training data set; performing data screening on the basic training data set based on the task type of an initial prediction task in the task layer to determine a target training data set corresponding to the initial prediction task; taking any one of the initial prediction tasks in the task layer as a first prediction task, combining and processing the initial prediction tasks in the task layer except the first prediction task to obtain a to-be-selected prediction task set, performing model training on the hidden layer and the first prediction task in the basic network model based on the target training data set corresponding to the first prediction task to obtain a first network model, performing data judgment on the to-be-selected prediction task set based on a preset training stop condition to generate a data judgment result, and determining a to-be-selected network model corresponding to the basic network model based on the data judgment result and the first network model. Meanwhile, in the process of model training, the number of iterations, the current iteration loss value and the previous iteration loss value corresponding to a target prediction task in the task layer are obtained, a loss value change rate sequence corresponding to the target prediction task is determined based on the number of iterations, the current iteration loss value and the previous iteration loss value, the loss value change rate sequences corresponding to all target prediction tasks in the task layer are combined and processed according to the number of iterations to obtain a loss value change rate set. Finally, a convergence result is generated by performing convergence judgment on the loss value change rate set based on a preset convergence threshold, and it is judged whether the convergence result is that the training is converged; if the convergence result is that the training is converged, the to-be-selected network model is taken as the target network model corresponding to the basic network model; otherwise, if the convergence result is that the training is not converged, model training is performed on the to-be-selected network model based on a preset serial training rule and a target training data set to obtain an intermediate network model corresponding to the to-be-selected network model and a loss value change rate set, a convergence result is generated by performing convergence judgment on the loss value change rate set based on a preset convergence condition, and a target network model corresponding to the intermediate network model is determined based on the convergence result. Due to the serial training strategy, different prediction tasks are trained iteratively one by one, and the convergence evaluation mechanism based on the task loss change rate is introduced, which solves the problems of large consumption of computing resources, difficulty in balancing task weights and difficulty in measuring training convergence in the process of training of a multi-task model, improves the training efficiency of the multi-task model, reduces the demand for computing resources, and optimizes the performance of multi-task prediction.

[0086] Embodiment three

[0087] Figure 4 A structure schematic diagram of a multi-task model training device based on serial training is provided for embodiment three of the application. As shown in the figure, the device comprises a data acquisition module 310, a data screening module 320, a model training module 330 and a model determination module 340. Figure 4

[0088] The data acquisition module 310 is configured to acquire a basic network model corresponding to a target prediction scenario and a basic training data set; the basic network model comprises a hidden layer and a task layer; the task layer comprises a set number of initial prediction tasks.

[0089] The data screening module 320 is configured to perform data screening on the basic training data set based on the task type of the initial prediction tasks in the task layer, and determine a target training data set corresponding to the initial prediction tasks.

[0090] The model training module 330 is configured to perform model training on the basic network model based on a preset serial training rule and the target training data set, to obtain a candidate network model corresponding to the basic network model and a loss value change rate set.

[0091] The model determination module 340 is configured to perform convergence judgment on the loss value change rate set based on a preset convergence condition, to generate a convergence result, and determine a target network model corresponding to the candidate network model based on the convergence result.

[0092] The technical scheme of the embodiment of the application acquires a basic network model corresponding to a target prediction scenario and a basic training data set, which comprises a hidden layer and a task layer. Then, data screening is performed on the basic training data set based on the task type of the initial prediction tasks in the task layer, to determine a target training data set corresponding to the initial prediction tasks. Further, model training is performed on the basic network model based on a preset serial training rule and the target training data set, to obtain a candidate network model corresponding to the basic network model and a loss value change rate set. Finally, convergence judgment is performed on the loss value change rate set based on a preset convergence condition, to generate a convergence result, and a target network model corresponding to the candidate network model is determined based on the convergence result. Due to the serial training strategy, different prediction tasks are iteratively trained one by one, and a convergence evaluation mechanism based on the task loss change rate is introduced, which solves the problems of large consumption of computing resources, difficulty in balancing task weights and difficulty in measuring training convergence in the multi-task model training process, improves the training efficiency of the multi-task model, reduces the demand for computing resources, and optimizes the performance of multi-task prediction.

[0093] Optionally, the model training module 330 can be specifically configured to:​

[0094] obtain any one initial prediction task in the task layer as a first prediction task, and combine and process the initial prediction tasks in the task layer except the first prediction task to obtain a set of candidate prediction tasks;

[0095] perform model training on the hidden layer and the first prediction task in the basic network model based on a target training data set corresponding to the first prediction task, to obtain a first network model;

[0096] perform data judgment on the set of candidate prediction tasks based on a preset training stop condition, generate a data judgment result, and determine a candidate network model corresponding to the basic network model based on the data judgment result and the first network model.

[0097] Optionally, the model training module 330 can be specifically configured to:

[0098] if the data judgment result is a null value, determine the first network model as the candidate network model corresponding to the basic network model;

[0099] if the data judgment result is a non-null value, obtain any one initial prediction task in the set of candidate prediction tasks as a second prediction task, perform training on the hidden layer and the second prediction task in the first network model based on a target training data set corresponding to the second prediction task, to obtain a second network model, perform data judgment on the set of candidate prediction tasks based on a preset training stop condition, generate a data judgment result, and determine a candidate network model corresponding to the basic network model based on the data judgment result and the second network model.

[0100] Optionally, the multi-task model training apparatus based on serial training can further include a variation rate set determination module, which can be specifically configured to: in the process of model training, obtain an iteration number, a current iteration loss value and a previous iteration loss value corresponding to a target prediction task in the task layer; determine a loss value variation rate sequence corresponding to the target prediction task based on the iteration number, the current iteration loss value and the previous iteration loss value; and combine and process the loss value variation rate sequences corresponding to all target prediction tasks in the task layer according to the iteration numbers, to obtain a loss value variation rate set.

[0101] Optionally, the model determination module 340 can be specifically configured to:

[0102] perform convergence judgment on the loss value variation rate set based on a preset convergence threshold, to generate a convergence result;

[0103] if the convergence result is training convergence, determine the candidate network model as a target network model corresponding to the basic network model;

[0104] If the convergence result is that the training is not converged, the model training is performed on the candidate network model based on a preset serial training rule and a target training data set, an intermediate network model corresponding to the candidate network model and a loss value change rate set are obtained, the convergence judgment is performed on the loss value change rate set based on a preset convergence condition, a convergence result is generated, and the target network model corresponding to the intermediate network model is determined based on the convergence result.

[0105] Optionally, the multi-task model training device based on serial training can further include a model updating module, which can be specifically configured to: after the convergence judgment is performed on the loss value change rate set based on the preset convergence condition, the convergence result is generated, and the target network model corresponding to the candidate network model is determined based on the convergence result, the incremental prediction task corresponding to the target prediction scene is obtained, and the model updating is performed on the target network model based on the incremental prediction task, so as to obtain an updated network model corresponding to the target network model; the data filtering is performed on the basic training data set based on the task type of the incremental prediction task, so as to determine a target training data set corresponding to the incremental prediction task; and the model training is performed on the updated network model based on the preset serial training rule and the target training data set, so as to obtain an updated target network model.

[0106] Optionally, the multi-task model training device based on serial training can further include a task prediction module, which can be specifically configured to: after the convergence judgment is performed on the loss value change rate set based on the preset convergence condition, the convergence result is generated, and the target network model corresponding to the candidate network model is determined based on the convergence result, the prediction task data corresponding to the target prediction scene is obtained; wherein the prediction task data includes a prediction task unique identifier and task collection data; the prediction task data is input into the target network model, the data prediction is performed on the prediction task data based on the target network model, and a data prediction result corresponding to the prediction task data is generated.

[0107] The multi-task model training device based on serial training provided in the embodiments of the present application can execute the multi-task model training method based on serial training provided in any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.

[0108] Embodiment four

[0109] Figure 5A structural diagram of an electronic device 410 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.

[0110] As shown in Figure 5 The electronic device 410 includes at least one processor 420, and a memory, such as a read-only memory (ROM) 430, a random access memory (RAM) 440, etc., connected to the at least one processor 420, where the memory stores computer programs executable by the at least one processor. The processor 420 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 430 or loaded into the random access memory (RAM) 440 from the storage unit 490. In the RAM 440, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 420, the ROM 430, and the RAM 440 are connected to each other through a bus 450. An input / output (I / O) interface 460 is also connected to the bus 450.

[0111] Various components in the electronic device 410 are connected to the I / O interface 460, including an input unit 470, such as a keyboard, a mouse, etc., an output unit 480, such as various types of displays, a speaker, etc., a storage unit 490, such as a magnetic disk, an optical disk, etc., and a communication unit 4100, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 4100 allows the electronic device 410 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0112] The processor 420 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 420 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 420 performs various methods and processes described above, such as the serial training based multi-task model training method.

[0113] The method includes:

[0114] obtain a base network model and a base training data set corresponding to a target prediction scene; wherein the base network model comprises a hidden layer and a task layer; the task layer comprises a set number of initial prediction tasks;

[0115] perform data filtering on the base training data set based on a task type of the initial prediction task in the task layer, to determine a target training data set corresponding to the initial prediction task;

[0116] perform model training on the base network model based on a preset serial training rule and the target training data set, to obtain a candidate network model corresponding to the base network model and a loss value change rate set;

[0117] perform convergence judgment on the loss value change rate set based on a preset convergence condition, to generate a convergence result, and determine a target network model corresponding to the candidate network model based on the convergence result.

[0118] In some embodiments, the serial training based multi-task model training method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as storage unit 490. In some embodiments, part or all of the computer program can be loaded and / or installed onto electronic device 410 via ROM 430 and / or communication unit 4100. When the computer program is loaded onto RAM 440 and executed by processor 420, one or more steps of the serial training based multi-task model training method described above can be performed. Alternatively, in other embodiments, processor 420 can be configured to perform the serial training based multi-task model training method by any other suitable means, such as by means of firmware.

[0119] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0120] Computer programs for implementing the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program, when executed, enables the functions / acts specified in the flowcharts and / or block diagrams to be implemented. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package and partially on a remote machine or entirely on a remote machine or server.

[0121] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0122] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0123] The systems and techniques described herein can be implemented in a computing system that includes a back end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front end component, e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described herein, or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0124] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0125] The embodiments of the present application further disclose a computer program product, which comprises a computer program, and the computer program, when executed by a processor, implements the serial training based multi-task model training method provided by any of the embodiments of the present application. The program product and the serial training based multi-task model training method disclosed by the embodiments of the present application belong to the same inventive concept, and thus will not be repeated here.

[0126] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present application. For example, the steps recited in the present application can be performed in parallel, in series, or in a different order, without departing from the desired results of the technical solutions of the present application, and are not limited herein.

[0127] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A multi-task model training method based on serial training, characterized in that, include: Obtain the basic network model and basic training dataset corresponding to the target prediction scene; wherein, the basic network model includes hidden layers and task layers; the task layer contains a set number of initial prediction tasks; Based on the task type of the initial prediction task in the task layer, the basic training dataset is filtered to determine the target training dataset corresponding to the initial prediction task. The basic network model is trained based on the preset serial training rules and the target training dataset to obtain the candidate network models and the set of loss value change rates corresponding to the basic network model. The set of loss value change rates is judged based on preset convergence conditions to generate convergence results, and the target network model corresponding to the candidate network model is determined based on the convergence results.

2. The method according to claim 1, characterized in that, The step of training the basic network model based on preset serial training rules and the target training dataset to obtain the candidate network model corresponding to the basic network model includes: Take any one of the initial prediction tasks in the task layer as the first prediction task, and combine and process the initial prediction tasks in the task layer other than the first prediction task to obtain a set of candidate prediction tasks. Based on the target training dataset corresponding to the first prediction task, the hidden layer in the basic network model and the first prediction task are trained to obtain the first network model. The candidate prediction task set is evaluated based on a preset training cutoff condition, a data evaluation result is generated, and the candidate network model corresponding to the basic network model is determined based on the data evaluation result and the first network model.

3. The method according to claim 2, characterized in that, The step of determining the candidate network model corresponding to the basic network model based on the data judgment result and the first network model includes: If the data judgment result is empty, then the first network model is determined as the candidate network model corresponding to the basic network model; If the data judgment result is non-empty, then any initial prediction task in the candidate prediction task set is obtained as the second prediction task; the hidden layer in the first network model and the second prediction task are trained based on the target training dataset corresponding to the second prediction task to obtain the second network model; the candidate prediction task set is judged based on the preset training cutoff condition to generate a data judgment result; and the candidate network model corresponding to the basic network model is determined based on the data judgment result and the second network model.

4. The method according to claim 1, characterized in that, The process of determining the set of rates of change of loss values ​​includes: During model training, the number of iterations, the current iteration loss value, and the previous iteration loss value are obtained for the target prediction task in the task layer. Based on the number of iterations, the current iteration loss value, and the previous iteration loss value, determine the loss value change rate sequence corresponding to the target prediction task; The loss value change rate sequence corresponding to each target prediction task in the task layer is processed according to the number of iterations to obtain the loss value change rate set.

5. The method according to claim 1, characterized in that, The step of performing a convergence judgment on the set of loss value change rates based on preset convergence conditions, generating a convergence result, and determining the target network model corresponding to the candidate network model based on the convergence result includes: Based on a preset convergence threshold, the set of loss value change rates is judged to convergence, and a convergence result is generated. If the convergence result is training convergence, then the candidate network model is taken as the target network model corresponding to the base network model. If the convergence result is that the training has not converged, then the candidate network model is trained based on the preset serial training rules and the target training dataset to obtain the intermediate network model and the set of loss value change rates corresponding to the candidate network model; the set of loss value change rates is judged for convergence based on the preset convergence conditions to generate a convergence result, and the target network model corresponding to the intermediate network model is determined based on the convergence result.

6. The method according to claim 1, characterized in that, After performing convergence judgment on the set of loss value change rates based on preset convergence conditions, generating convergence results, and determining the target network model corresponding to the candidate network model based on the convergence results, the method further includes: Obtain the incremental prediction task corresponding to the target prediction scenario, and update the target network model based on the incremental prediction task to obtain the updated network model corresponding to the target network model. Based on the task type of the incremental prediction task, the basic training dataset is filtered to determine the target training dataset corresponding to the incremental prediction task. The updated network model is trained based on the preset serial training rules and the target training dataset to obtain the updated target network model.

7. The method according to claim 1, characterized in that, After performing convergence judgment on the set of loss value change rates based on preset convergence conditions, generating convergence results, and determining the target network model corresponding to the candidate network model based on the convergence results, the method further includes: Obtain the prediction task data corresponding to the target prediction scenario; wherein, the prediction task data includes a unique identifier for the prediction task and task collection data; The prediction task data is input into the target network model, and the prediction task data is predicted based on the target network model to generate the prediction result corresponding to the prediction task data.

8. A multi-task model training device based on serial training, characterized in that, include: The data acquisition module is used to acquire the basic network model and basic training dataset corresponding to the target prediction scenario; wherein, the basic network model includes a hidden layer and a task layer; the task layer contains a set number of initial prediction tasks; The data filtering module is used to filter the basic training dataset based on the task type of the initial prediction task in the task layer, and determine the target training dataset corresponding to the initial prediction task. The model training module is used to train the basic network model based on a preset serial training rule and a target training dataset, so as to obtain the candidate network models and loss value change rate set corresponding to the basic network model. The model determination module is used to perform convergence judgment on the set of loss value change rates based on preset convergence conditions, generate convergence results, and determine the target network model corresponding to the candidate network model based on the convergence results.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the multi-task model training method based on serial training as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the multi-task model training method based on serial training as described in any one of claims 1-7.