Training Method, Device and Electronic Device of Multi-Task Model
By encoding and filtering training samples based on task-specific targets, the method addresses the computational complexity issue in multi-task model training, improving speed and efficiency.
Patent Information
- Application Number
- CN202110342918.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-30
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-03-30
AI Technical Summary
In the prior art, the computational complexity of using full sample data to train multitask models is high, resulting in slow model training speed.
By obtaining the training sample set, encoding is performed to generate a shared feature matrix, and filtering the shared feature matrix based on the training task objectives, generating the target matrix, determining the prediction results, and correcting the multi-task model parameters.
It effectively removes redundant samples that are independent of the training task, reduces the computational complexity of multi-task model training, and improves the model training speed.
Smart Images

Figure CN115146756B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer application technologies, and in particular, to a method, an apparatus, and an electronic device for training a multi-task model. Background Art
[0002] A recommendation system based on multi-objective deep learning usually uses the log data specified in an application as training data to construct training samples, and uses the training samples to train a multi-task model, and then implements the multi-objective recommendation task of the recommendation system through the multi-task model.
[0003] In related technologies, when training a multi-task model, for each sub-task in the model, it is necessary to use the obtained full-scale sample data for training, and calculate the loss value corresponding to each sub-task according to the training objective of each sub-task, so as to update the sub-network corresponding to the corresponding sub-task according to the loss value corresponding to each sub-task, so as to implement the training of the multi-task model. However, since the full-scale sample data has a high computational complexity for each sub-task in the model, the overall speed of model training is low. Summary of the Invention
[0004] The present disclosure provides a method, a content recommendation method, an apparatus, an electronic device, a storage medium, and a computer program product for training a multi-task model, so as to at least solve the problem in related technologies that when using full-scale sample data to train each sub-task in a multi-task model, since the full-scale sample data has a high computational complexity for each sub-task in the model, the overall speed of model training is low. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a method for training a multi-task model, including: obtaining a training sample set, where the training sample set includes training samples and annotation results corresponding to a plurality of training tasks, the training samples are used to record interaction parameters of multimedia information in an application, the interaction parameters are multi-dimensional parameters, and the annotation results are used to annotate the interaction results of each dimension; encoding the training samples in the training sample set to obtain a shared feature matrix corresponding to the training sample set; based on the training objectives of the training tasks, respectively performing filtering processing on the shared feature matrix to generate target matrices of the training tasks; determining prediction results of the training tasks based on the target matrices of the training tasks; and correcting parameters of the multi-task model according to the prediction results of the training tasks and the annotation results corresponding to the target matrices to obtain a trained multi-task model.
[0006] Optionally, in a possible implementation manner of the first aspect of the present disclosure, the performing filtering processing on the shared feature matrix respectively based on the training objectives of the training tasks includes:
[0007] Determine the degree of association between the training samples in the training sample set and the training objective;
[0008] Based on the degree of association between the training samples and the training objective, and the positions of each training sample in the shared feature matrix, perform filtering processing on the shared feature matrix respectively.
[0009] Optionally, in another possible implementation manner of the first aspect embodiment of the present disclosure, the determining the degree of association between the training samples in the training sample set and the training objective includes:
[0010] Obtain the user behaviors recorded by each training sample, where the user behaviors are used to represent interaction operations occurring on a specified page;
[0011] Determine whether the user behavior corresponding to the training objective matches the user behavior recorded by the training sample;
[0012] If the user behavior corresponding to the training objective matches the user behavior recorded by the training sample, determine that the training sample is associated with the training objective;
[0013] If the user behavior corresponding to the training objective does not match the user behavior recorded by the training sample, determine that the training sample has no association with the training objective,
[0014] wherein the degree of association includes associated and not associated.
[0015] Optionally, in yet another possible implementation manner of the first aspect embodiment of the present disclosure, the performing filtering processing on the shared feature matrix respectively based on the degree of association between the training samples and the training objective, and the positions of each training sample in the shared feature matrix includes:
[0016] If any training sample is associated with the training objective of any training task, retain the information at the position of the any training sample in the shared feature matrix to generate the target matrix corresponding to the any training task;
[0017] If any training sample has no association with the training objective, clear the information at the position of the any training sample in the shared feature matrix to generate the target matrix corresponding to the any training task.
[0018] Optionally, in another possible implementation manner of the first aspect embodiment of the present disclosure, the performing filtering processing on the shared feature matrix respectively based on the training objectives of each training task includes:
[0019] From the output layer to the input layer, layer by layer determine the relevance of each network layer in the multi-task model to each training task;
[0020] If any network layer is related to any training task sheet, determine that the target dependent data of the any network layer is the training samples in the training sample set that are associated with the any training task;
[0021] If the input data of the any network layer includes other data except the training samples associated with the any training task, filter the shared feature matrix input to the any network layer according to the training objective of the any training task.
[0022] Optionally, in another possible implementation manner of the first aspect embodiment of the present disclosure, the determining the relevance between each network layer in the multi-task model and each training task layer by layer from the output layer to the input layer includes:
[0023] Starting from the output layer corresponding to each training task, traverse the multi-task model structure. If any network layer is a single-input and single-output network layer, determine that the any network layer is a network layer that is single-related to the training task sheet;
[0024] If any network layer is a single-input and multi-output network layer, determine that the any network layer is a network layer that is multi-related to the training task;
[0025] Wherein, the relevance includes single relevance and multi relevance. Among them, single relevance indicates that the network layer is only related to one training task, and multi relevance indicates that the network layer is related to multiple training tasks.
[0026] According to the second aspect of the embodiments of the present disclosure, there is provided a training device for a multi-task model, including: an acquisition module configured to execute acquiring a training sample set, where the training sample set contains training samples and annotation results corresponding to multiple training tasks, the training samples are used to record interaction parameters of multimedia information in an application, the interaction parameters are multi-dimensional parameters, and the annotation results are used to annotate the interaction results of each dimension; an encoding module configured to execute encoding the training samples in the training sample set to obtain a shared feature matrix corresponding to the training sample set; a filtering module configured to execute filtering the shared feature matrix respectively based on the training objectives of each training task to generate target matrices of each training task; a determining module configured to execute determining prediction results of each training task based on the target matrices of each training task; a correction module configured to execute correcting parameters of the multi-task model according to the prediction results of each training task and the annotation results corresponding to each target matrix to obtain a trained multi-task model.
[0027] Optionally, in a possible implementation manner of the second aspect embodiment of the present disclosure, the filtering module includes:
[0028] A first determination unit, configured to determine the degree of association between the training samples in the training sample set and the training objective;
[0029] A first filtering unit, configured to perform filtering processing on the shared feature matrix respectively based on the degree of association between the training samples and the training objective, and the positions of each training sample in the shared feature matrix.
[0030] Optionally, in another possible implementation manner of the second aspect embodiment of the present disclosure, the first determination unit includes:
[0031] An acquisition subunit, configured to acquire the user behaviors recorded by each of the training samples, where the user behaviors are used to represent interaction operations occurring on a specified page;
[0032] A judgment subunit, configured to judge whether the user behavior corresponding to the training objective matches the user behavior recorded by the training sample;
[0033] A first determination subunit, configured to determine that the training sample is associated with the training objective if the user behavior corresponding to the training objective matches the user behavior recorded by the training sample;
[0034] A second determination subunit, configured to determine that the training sample has no association with the training objective if the user behavior corresponding to the training objective does not match the user behavior recorded by the training sample;
[0035] Wherein, the degree of association includes associated and not associated.
[0036] Optionally, in yet another possible implementation manner of the second aspect embodiment of the present disclosure, the first filtering unit includes:
[0037] A first generation subunit, configured to retain the information at the position of any training sample in the shared feature matrix to generate a target matrix corresponding to any training task if any training sample is associated with the training objective of any training task;
[0038] A second generation subunit, configured to clear the information at the position of any training sample in the shared feature matrix to generate a target matrix corresponding to any training task if any training sample has no association with the training objective.
[0039] Optionally, in yet another possible implementation manner of the second aspect embodiment of the present disclosure, the filtering module includes:
[0040] A second determination unit, configured to perform a layer-by-layer determination of the relevance between each network layer in the multi-task model and each training task, from the output layer to the input layer;
[0041] A third determination unit, configured to perform a determination that if any network layer is singly related to any training task, the target dependent data of the any network layer is the training sample associated with the any training task in the training sample set;
[0042] A second filtering unit, configured to perform a filtering process on the shared feature matrix input to the any network layer according to the training objective of the any training task if the input data of the any network layer includes data other than the training sample associated with the any training task.
[0043] Optionally, in another possible implementation manner of the second aspect of the present disclosure, the second determination unit includes:
[0044] A third determination subunit, configured to perform a traversal of the multi-task model structure starting from the output layer corresponding to each training task, and if any network layer is a single-input and single-output network layer, determine that the any network layer is a network layer singly related to the training task;
[0045] A fourth determination subunit, configured to perform a determination that if any network layer is a single-input and multi-output network layer, determine that the any network layer is a network layer multiply related to the training task;
[0046] Wherein, the relevance includes single relevance and multiple relevance, wherein single relevance indicates that the network layer is only related to one training task, and multiple relevance indicates that the network layer is related to multiple training tasks.
[0047] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein, the processor is configured to execute the instructions to implement the multi-task model training method as described above.
[0048] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the multi-task model training method as described above.
[0049] According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, including computer programs / instructions, when the computer programs / instructions are executed by a processor, capable of executing the multi-task model training method as described above.
[0050] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects: By encoding the training samples in the training sample set, a shared feature matrix corresponding to the training sample set is obtained, and based on the training objectives of each training task, the shared feature matrix is respectively filtered to generate the target matrix of each training task. Then, based on the target matrix of each training task, the prediction results of each training task are determined. Furthermore, according to the prediction results of each training task and the annotation results corresponding to each target matrix, the parameters of the multi-task model are corrected to obtain the trained multi-task model. Thus, by filtering out the sample data irrelevant to each training task before training each training task, the redundant training samples irrelevant to the training task are effectively removed, thereby reducing the computational complexity of multi-task model training and improving the training speed of the model.
[0051] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure and do not constitute an improper limitation of the present disclosure.
[0053] Figure 1 is a flowchart of a method for training a multi-task model shown according to an exemplary embodiment.
[0054] Figure 2 is a schematic structural diagram of an initial learning model in an application program.
[0055] Figure 3 is a schematic structural diagram of a generated multi-task model.
[0056] Figure 4 is a flowchart of another method for training a multi-task model shown according to an exemplary embodiment.
[0057] Figure 5 is a flowchart of yet another method for training a multi-task model shown according to an exemplary embodiment.
[0058] Figure 6 is a block diagram of a training device for a multi-task model shown according to an exemplary embodiment.
[0059] Figure 7 is a block diagram of an electronic device shown according to an exemplary embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0060] To enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0061] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that such data may be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0062] Figure 1 is a flowchart of a method for training a multi-task model shown according to an exemplary embodiment, as Figure 1 shown, the method for training the multi-task model is used in an electronic device and includes the following steps.
[0063] In step 101, a training sample set is obtained, where the training sample set contains training samples and annotation results corresponding to multiple training tasks. The training samples are used to record the interaction parameters of multimedia information in an application. The interaction parameters are multi-dimensional parameters, and the annotation results are used to annotate the interaction results of each dimension.
[0064] It should be noted that the method for training the multi-task model in the embodiments of the present disclosure can be executed by the training device of the multi-task model in the embodiments of the present disclosure. The training device of the multi-task model in the embodiments of the present disclosure can be configured in any electronic device to execute the method for training the multi-task model in the embodiments of the present disclosure.
[0065] In the embodiments of the present disclosure, the method for training the multi-task model of the present disclosure can be applied to train the multi-task model used in a multi-objective recommendation system to achieve multi-objective recommendation. For example, the method for training the multi-task model of the present disclosure can be applied to a multi-objective multimedia recommendation application (such as a short video application) to train the multi-task model used in the multimedia recommendation application and record the interaction parameters (such as multi-dimensional parameters such as click, like, forward, comment, and browsing duration) of users with respect to each multimedia information in the multimedia application. That is, each training sample includes multimedia information and the interaction parameters corresponding to the multimedia information. Furthermore, the interaction results of each dimension corresponding to each training sample can be determined according to the interaction parameters corresponding to each training sample, and each training sample can be annotated to generate the annotation result corresponding to each training sample. Among them, the annotation result corresponding to the training sample can be the degree of interest of the user in the multimedia information in the training sample.
[0066] For example, for the short video application A, the multi-task model corresponding to the short video application A has two recommendation tasks of "performing short video recommendation in Page A" and "performing short video recommendation in Page B". Thus, it is possible to record the interaction parameters (such as clicks, likes, forwards, comments, browsing duration, etc.) of each short video recommended in Page A by the user, and record the interaction parameters of each short video recommended in Page B by the user, and use the short video information and the interaction parameters corresponding to each short video obtained from Page A and Page B as training samples. Then, the degree of interest of the user in each short video can be determined according to the interaction parameters corresponding to each short video, and further, the degree of interest of each short video can be used as the annotation result of the corresponding training sample to annotate each training sample to generate a training sample set.
[0067] As a possible implementation, it is possible to obtain a multi-task model training instruction sent by a user, and perform parsing processing on the multi-task model training instruction to obtain the multi-task model and the training sample set included in the multi-task model training instruction, and use the obtained multi-task model as an initial learning model, and further determine the multiple training tasks included in the obtained multi-task model as the multiple training tasks corresponding to the initial learning model. Among them, the user can be a developer, a maintainer, etc. of any application program, or a developer, etc. of a multi-task model in any field. The embodiments of the present disclosure do not make any limitations in this regard. The user can set the initial learning model and the multiple training tasks corresponding to the initial learning model according to actual development needs.
[0068] As another possible implementation form, during the use of an application program including a multi-task model, according to the actual update requirements of the application program, it is possible to obtain the multi-task model being used in the application program as the initial learning model, and determine the multiple training tasks in the multi-task model as the multiple training tasks corresponding to the initial learning model, and generate a training sample set according to the usage data of the application program within a certain period of time, so as to update the multi-task model in the application program by using the training method of the multi-task model in the embodiments of the present disclosure.
[0069] In step 102, the training samples in the training sample set are encoded to obtain a shared feature matrix corresponding to the training sample set.
[0070] In an embodiment of the present disclosure, an initial learning model including multiple training tasks may include an encoder. Among them, the encoder may be a network layer in the initial learning model that performs vector mapping on training samples to generate vector representations corresponding to the training samples. Thus, each training sample in the training sample set can be sequentially input into the encoder of the initial learning model to encode each training sample and generate a vector representation corresponding to each training sample. Furthermore, a shared feature matrix corresponding to the training sample set can be formed based on the vector representations corresponding to each training sample. Among them, the vector representation corresponding to each training sample can be a row element or a column element in the shared feature matrix, and the embodiments of the present application do not limit this.
[0071] In step 103, based on the training objectives of each training task, the shared feature matrix is respectively filtered to generate the target matrix of each training task.
[0072] It should be noted that since the initial learning model may include a network layer that uniformly processes all training samples in the same way, and network layers corresponding to each training task that can process different training samples differently to achieve different training objectives corresponding to different training tasks. Therefore, the initial learning model can be parsed to determine the data relied on by each network layer in the initial learning model. Furthermore, based on the data relied on by each network layer, the network layer whose relied-on data is all training samples is determined as the shallow shared layer in the initial learning model, and the network layer whose relied-on data is partial training is determined as the sub-network corresponding to each training task in the initial learning model. A filtering layer corresponding to each sub-network is inserted between the shallow shared layer and each sub-network to filter out training samples irrelevant to each training task.
[0073] For example, such as Figure 2As shown in the figure, it is a schematic structural diagram of an initial learning model in an application. Among them, the initial learning model is a Deep Neural Network (DNN for short), including three DNN network layers 310, 320, and 330. By parsing and processing the initial learning model, it is determined that the training task of the DNN network layer 310 is to perform vector mapping on training samples to generate vector representations corresponding to the training samples; it is determined that the training task of the DNN network layer 320 is to predict click behaviors on page A; it is determined that the training task of the DNN network layer 330 is to predict click behaviors on page B. For example, when the input data is 100 training samples on page A and 100 training samples on page B in the application, the DNN network layer 310 can generate vector representations corresponding to the 100 training samples on page A respectively, and vector representations corresponding to the 100 training samples on page B respectively; the DNN network layer 320 can be trained according to the output of the DNN network layer 310 (that is, the vector representations corresponding to the 100 training samples on page A respectively, and the vector representations corresponding to the 100 training samples on page B respectively), so that after the DNN network layer 320 is trained, it can predict click behaviors on page A; the DNN network layer 330 can be trained according to the output of the DNN network layer 310, so that after the DNN network layer 330 is trained, it can predict click behaviors on page B.
[0074] Therefore, since the DNN network layer 310 and the DNN network layer 320 are adjacent and their corresponding training tasks are different, it can be determined that the DNN network layer 310 belongs to the shallow shared layer, and it is determined that the DNN network layer 320 belongs to the sub-network corresponding to the training task of "predicting click behaviors on page A"; correspondingly, since the DNN network layer 310 and the DNN network layer 330 are adjacent and their corresponding training tasks are different, it is determined that the DNN network layer 330 belongs to the sub-network corresponding to the training task of "predicting click behaviors on page B". After that, a filtering layer 340 corresponding to the training task of "predicting click behaviors on page A" can be inserted between the DNN network layer 310 and the DNN network layer 320 to filter out training samples irrelevant to the training task of "predicting click behaviors on page A", that is, the 100 training samples on page B; and a filtering layer 350 corresponding to the training task of "predicting click behaviors on page B" can be inserted between the DNN network layer 310 and the DNN network layer 330 to filter out training samples irrelevant to the training task of "predicting click behaviors on page B", that is, the 100 training samples on page A; thus, a multi-task model as shown in Figure 3 the figure can be generated.
[0075] In an embodiment of the present disclosure, after determining the shared feature matrix corresponding to the training sample set, since there is a filtering layer corresponding to each training task between the sub-network corresponding to each training task and the shallow shared layer that generates the shared feature matrix, before training the sub-network corresponding to each training task with the shared feature matrix, the shared feature matrix can be respectively filtered through the filtering layer corresponding to each training task to remove the features corresponding to the training samples irrelevant to the corresponding training task in the shared feature matrix, so as to generate the target matrix corresponding to each training task.
[0076] In step 104, based on the target matrices of the respective training tasks, the prediction results of the respective training tasks are determined.
[0077] In an embodiment of the present disclosure, after determining the target matrix of each training task, the corresponding target matrix can be processed through the sub-network corresponding to each training task to generate the prediction result of each training task.
[0078] In step 105, according to the prediction results of the respective training tasks and the annotation results corresponding to the respective target matrices, the parameters of the multi-task model are corrected to obtain the trained multi-task model.
[0079] In an embodiment of the present disclosure, after determining the prediction result of each training task, for a training task, the loss value of the training task can be determined according to the difference between the prediction result and the standard result of each training sample corresponding to the target matrix of the training task, and the parameters of the sub-network corresponding to the training task and the parameters of the shallow shared layer are updated according to the loss value; correspondingly, the parameters of the sub-networks corresponding to all training tasks can be updated in the same way to generate the updated multi-task model. Then, the updated multi-task model is continuously trained using the training sample set until the loss value of each training task of the updated multi-task model is less than or equal to the loss value threshold, and then the training of the multi-task model is completed to generate the trained multi-task model.
[0080] The training method of the multi-task model provided by the embodiments of the present disclosure encodes the training samples in the training sample set to obtain a shared feature matrix corresponding to the training sample set, and based on the training objectives of each training task, filters the shared feature matrix respectively to generate the target matrix of each training task. Then, based on the target matrix of each training task, the prediction results of each training task are determined. Furthermore, according to the prediction results of each training task and the annotation results corresponding to each target matrix, the parameters of the multi-task model are corrected to obtain the trained multi-task model. Thus, by filtering out the sample data irrelevant to the training task before training each training task, the redundant training samples irrelevant to the training task are effectively removed, thereby reducing the computational complexity of the multi-task model training and improving the training speed of the model.
[0081] In a possible implementation form of the present disclosure, the shared feature matrix can also be filtered according to the relevance between the training objective of the training task and each training sample, so as to filter out the training samples irrelevant to the training task.
[0082] Figure 4 It is a flowchart of another training method of the multi-task model shown according to an exemplary embodiment. As Figure 4 shown, this training method of the multi-task model is used in an electronic device and includes the following steps.
[0083] In step 201, a training sample set is obtained. Among them, the training sample set contains the training samples and annotation results corresponding to multiple training tasks. The training samples are used to record the interaction parameters of the multimedia information in the application. The interaction parameters are multi-dimensional parameters, and the annotation results are used to annotate the interaction results of each dimension.
[0084] In step 202, the training samples in the training sample set are encoded to obtain a shared feature matrix corresponding to the training sample set.
[0085] For the specific implementation process and principle of the above steps 201-202, reference can be made to the detailed description of the above embodiments, which will not be elaborated here.
[0086] In step 203, the relevance between the training samples in the training sample set and the training objective is determined.
[0087] Among them, the relevance between the training sample and the training objective can include relevant and irrelevant.
[0088] As a possible implementation manner, the relevance between the training sample and the training objective can be determined according to the matching degree between the user behavior that the training objective needs to predict and the user behavior recorded by the training sample. That is, in a possible implementation manner of the embodiments of the present disclosure, the above step 203 can include:
[0089] Obtain the user behaviors recorded in each training sample, where the user behaviors are used to represent the interaction operations that occur on the specified page;
[0090] Determine whether the user behavior corresponding to the training objective matches the user behavior recorded in the training sample;
[0091] If the user behavior corresponding to the training objective matches the user behavior recorded in the training sample, determine that this training sample is associated with the training objective;
[0092] If the user behavior corresponding to the training objective does not match the user behavior recorded in the training sample, determine that this training sample has no association with the training objective.
[0093] Among them, the user behavior corresponding to the training objective may refer to the user behavior that can be predicted by the training task corresponding to the training objective.
[0094] Among them, the training sample may include the user behavior of the interaction operation of a specific subject and the training sample record of the specific subject. Therefore, the user behavior recorded in the training sample may refer to the interaction operation of the specific subject included in the training sample.
[0095] For example, the training objective of training task A is "predict the click behavior on page A", so it can be determined that the user behavior corresponding to the training objective of training task A can be "the user behavior that occurs on page A". Suppose a training sample B in the training sample set is the browsing data, like data, sharing data, forwarding data, and followed user data of short video B displayed on page A, then it can be determined that the user behavior recorded in training sample B is "the browsing data, like data, sharing data, forwarding data, and followed user data of short video B on page A".
[0096] In the embodiments of the present disclosure, it is possible to determine the training samples associated with the training task and the training samples not associated with the training task according to whether the user behavior corresponding to the training objective of the training task matches the user behavior recorded in the training sample, and filter out the features corresponding to the training samples not associated with the training task from the shared feature matrix to generate the target matrix corresponding to the training task.
[0097] As an example, if the training objective of a training task is to predict a specific type of user behavior, then it is possible to determine whether each training sample is associated with the training objective of the training task according to the matching degree between the type of user behavior corresponding to the training objective of the training task and the type of user behavior recorded in the training sample. For example, if the type of user behavior corresponding to the training objective is the same as the type of user behavior recorded in the training sample, or the type of user behavior recorded in the training sample includes the type of user behavior corresponding to the training objective, then it can be determined that the user behavior corresponding to the training objective matches the user behavior recorded in the training sample, and thus it can be determined that the training sample is associated with the training objective; otherwise, it can be determined that the user behavior corresponding to the training objective does not match the user behavior recorded in the training sample, and thus it can be determined that the training sample has no association with the training objective.
[0098] As an example, if the training objective of a training task is to predict user behavior that occurs on a specified page, then it is possible to determine whether each training sample is associated with the training objective of the training task according to the matching degree between the specified page and the page where the user behavior recorded in the training sample occurs. For example, if the specified page is the same as the page where the user behavior recorded in the training sample occurs, or the page where the user behavior recorded in the training sample occurs includes the specified page, then it can be determined that the user behavior corresponding to the training objective matches the user behavior recorded in the training sample, and thus it can be determined that the training sample is associated with the training objective; otherwise, it can be determined that the user behavior corresponding to the training objective does not match the user behavior recorded in the training sample, and thus it can be determined that the training sample has no association with the training objective.
[0099] In step 204, based on the degree of association between the training sample and the training objective, and the position of each training sample in the shared feature matrix, the shared feature matrix is respectively filtered to generate the target matrix for each training task.
[0100] As a possible implementation, if it is determined that a certain training sample has no association with the training objective of the training task, then the features corresponding to the training sample in the shared matrix can be filtered out to generate the target matrix for the training task. That is, in a possible implementation of the embodiments of the present disclosure, the above step 204 may include:
[0101] If any training sample is associated with the training objective of any training task, then the information at the position of any training sample in the shared feature matrix is retained to generate the target matrix corresponding to any training task;
[0102] If any training sample has no association with the training objective, then the information at the position of any training sample in the shared feature matrix is cleared to generate the target matrix corresponding to any training task.
[0103] In an embodiment of the present disclosure, for a training task, if any training sample is related to the training objective of the training task, the position of the feature corresponding to the training sample in the shared feature matrix can be determined according to the generation rule of the shared feature matrix, and the information at the position of the training sample in the shared feature matrix is retained, that is, the feature corresponding to the training sample is retained; if any training sample is not related to the training objective of the training task, the position of the feature corresponding to the training sample in the shared feature matrix can be determined according to the generation rule of the shared feature matrix, and the information at the position of the training sample in the shared feature matrix is cleared, that is, the feature corresponding to the training sample is filtered out. Thus, after traversing all the training data in the training sample set, the features corresponding to all the training samples that are not related to the training objective of the training task can be removed from the shared feature matrix, thereby generating the target matrix corresponding to the training task.
[0104] For example, in a multi-task model, there are two training tasks, training task A and training task B. The training objective of training task A is to "predict click behavior in page A", and the training objective of training task B is to "predict click behavior in page B". The full set of training samples includes 100 training samples in page A and 100 training samples in page B. The generation rule of the shared feature matrix is that "each row element of the shared feature matrix is the feature corresponding to a training sample", and the 1st to 100th rows of the shared feature matrix are the features corresponding to the training samples in page A, and the 101st to 200th rows are the features corresponding to the training samples in page B. Therefore, since the training objective of training task A is related to the training samples in page A and not related to the training samples in page B, the 1st to 100th rows in the shared feature matrix can be retained and the 101st to 200th rows in the shared feature matrix can be removed to generate the target matrix corresponding to training task A; correspondingly, since the training objective of training task B is not related to the training samples in page A and related to the training samples in page B, the 1st to 100th rows in the shared feature matrix can be removed and the 101st to 200th rows in the shared feature matrix can be retained to generate the target matrix corresponding to training task B.
[0105] The training method of the multi-task model provided by the embodiments of the present disclosure encodes the training samples in the training sample set to obtain a shared feature matrix corresponding to the training sample set, and filters the shared feature matrix respectively based on the correlation between the training sample and the training target, and the position of each training sample in the shared feature matrix, so as to generate the target matrix of each training task. Then, based on the target matrix of each training task, the prediction result of each training task is determined. Furthermore, according to the prediction result of each training task and the annotation result corresponding to each target matrix, the parameters of the multi-task model are corrected to obtain the trained multi-task model. Thus, before training each training task, by filtering out the sample data that has no correlation with the training task according to the correlation between each training sample and the training target of the training task, not only the computational complexity of the multi-task model training is reduced, the training speed of the model is improved, but also the accuracy of redundant sample filtering is further improved.
[0106] In a possible implementation form of the present disclosure, since the shallow shared layer in the multi-task model is usually close to the input layer, and the sub-network corresponding to the training task is usually close to the output layer, the multi-task model can be analyzed layer by layer according to the network structure of the multi-task model, so as to further improve the accuracy and reliability of redundant sample filtering.
[0107] Figure 5 is a flowchart of still another training method of the multi-task model shown according to an exemplary embodiment. As Figure 5 shown, this training method of the multi-task model is used in an electronic device and includes the following steps.
[0108] In step 401, a training sample set is obtained, where the training sample set contains training samples and annotation results corresponding to multiple training tasks. The training samples are used to record the interaction parameters of multimedia information in the application. The interaction parameters are multi-dimensional parameters, and the annotation results are used to annotate the interaction results of each dimension.
[0109] In step 402, the training samples in the training sample set are encoded to obtain a shared feature matrix corresponding to the training sample set.
[0110] For the specific implementation process and principle of the above steps 401-402, reference can be made to the detailed description of the above embodiments, which will not be repeated here.
[0111] In step 403, from the output layer to the input layer, the correlation between each network layer in the multi-task model and each training task is determined layer by layer.
[0112] In the embodiments of the present disclosure, the multi-task model can be parsed layer by layer from the output layer to the input layer according to the network structure of the multi-task model, so as to determine the network layers belonging to the shallow shared layer in the multi-task model and the network layers belonging to the sub-networks corresponding to each training task, that is, to determine the relevance of each network layer to each training task. Thus, through layer-by-layer parsing, not only can the differences and associations between adjacent network layers be effectively obtained, but also omissions can be avoided during the parsing process, further improving the accuracy and reliability of redundant sample filtering.
[0113] As a possible implementation, the relevance of each network layer to the training task can be determined according to the number of network layers corresponding to the input and output of each network layer respectively. That is, in a possible implementation of the embodiments of the present disclosure, step 403 above may include:
[0114] Starting from the output layer corresponding to each training task, traverse the multi-task training model structure. If any network layer is a single-input and single-output network layer, it is determined that the any network layer is a network layer that is single-related to the training task;
[0115] If any network layer is a single-input and multi-output network layer, it is determined that the any network layer is a network layer that is multi-related to the training task.
[0116] Among them, the relevance includes single-related and multi-related. It should be noted that single-related means that the network layer is only related to one training task, and multi-related means that the network layer is related to multiple training tasks.
[0117] In the embodiments of the present disclosure, since the network layers inside the sub-network corresponding to each training task are usually single-input and single-output, and the output data of the network layers shared by each training task needs to be provided for each training task to use, the network layers shared by each training task are usually single-input and multi-output. Therefore, the relevance of each network layer can be determined according to the number of input network layers and output network layers corresponding to each network layer.
[0118] As an example, for a training task, starting from the output layer corresponding to the training task, traverse the multi-task model structure. If a certain network layer is a single-input and single-output network layer, that is, the network layer can receive the output data of one network layer and can input the output data into another network layer, it can be determined that the network layer is only related to the training task, that is, it can be determined that the network layer is single-related to the training task. Correspondingly, if a certain network layer is a single-input and multi-output network layer, that is, the network layer can receive the output data of one network layer and can output the output data to multiple network layers, it can be determined that the network layer is related to multiple training tasks, that is, it can be determined that the network layer is multi-related to the training task.
[0119] In step 404, if any network layer is related to any training task sheet, determine that the target dependent data of any network layer is the training samples in the training sample set that are associated with any training task.
[0120] Among them, the target dependent data is the data that the network layer needs to depend on when performing calculations.
[0121] In the embodiments of the present disclosure, if a network layer is related to a training task sheet, it can be determined that the data on which the network layer depends when performing calculations is only related to the training samples associated with the training task, that is, it can be determined that the target dependent data of the network layer is the training samples associated with the training task.
[0122] In step 405, if the input data of any network layer includes data other than the training samples associated with any training task, filter the shared feature matrix input to any network layer according to the training objective of any training task to generate a target matrix corresponding to any training task.
[0123] In the embodiments of the present disclosure, if a network layer is related to a training task sheet, a filtering layer can be inserted before the network layer according to the training objective of the training task. Thus, when the input data of the network layer includes data other than the training samples associated with the training task, the inserted filtering layer can filter the input shared feature matrix to remove the features corresponding to the training samples that have no association with the training task in the shared feature matrix, and then generate a target matrix corresponding to the training task.
[0124] It should be noted that, according to the training objective of the training task, determining the training samples associated with the training task and the method of filtering the shared feature matrix can refer to the detailed description of the above embodiments, and will not be elaborated here.
[0125] In step 406, based on the target matrices of each training task, determine the prediction results of each training task.
[0126] In step 407, according to the prediction results of each training task and the annotation results corresponding to each target matrix, correct the parameters of the multi-task model to obtain the trained multi-task model.
[0127] The specific implementation process and principle of the above steps 406-407 can refer to the detailed description of the above embodiments, and will not be elaborated here.
[0128] The training method of the multi-task model provided by the embodiments of the present disclosure encodes the training samples in the training sample set to obtain a shared feature matrix corresponding to the training sample set, and determines the relevance between each network layer in the multi-task model and each training task layer by layer from the output layer to the input layer. According to the relevance between each network layer and each training task, a network layer that is uniquely relevant to any training task is determined. When the input data of this network layer includes the remaining data except the training samples associated with any training task, the shared feature matrix input to this network layer is filtered according to the training objective of any training task to generate a target matrix corresponding to any training task. Then, based on the target matrices of each training task, the prediction results of each training task are determined. Furthermore, according to the prediction results of each training task and the annotation results corresponding to each target matrix, the parameters of the multi-task model are corrected to obtain the trained multi-task model. Thus, the multi-task model can be analyzed and processed layer by layer according to the network structure of the multi-task model to determine the network layer that is unidirectionally related to the training task, so as to filter out the sample data that is irrelevant to the training task, thereby not only reducing the computational complexity of the multi-task model training and improving the training speed of the model, but also further improving the accuracy and reliability of redundant sample filtering.
[0129] Figure 6 is a block diagram of a training device for a multi-task model shown according to an exemplary embodiment. Refer to Figure 6 As shown, the device 50 includes an acquisition module 51, an encoding module 52, a filtering module 53, a determination module 54, and a correction module 55.
[0130] The acquisition module 51 is configured to execute acquiring a training sample set, where the training sample set includes training samples and annotation results corresponding to multiple training tasks. The training samples are used to record the interaction parameters of multimedia information in the application. The interaction parameters are multi-dimensional parameters, and the annotation results are used to annotate the interaction results of each dimension;
[0131] The encoding module 52 is configured to execute encoding the training samples in the training sample set to obtain a shared feature matrix corresponding to the training sample set;
[0132] The filtering module 53 is configured to execute filtering the shared feature matrix respectively based on the training objectives of each training task to generate target matrices of each training task;
[0133] The determination module 54 is configured to execute determining the prediction results of each training task based on the target matrices of each training task;
[0134] The correction module 55 is configured to execute correcting the parameters of the multi-task model according to the prediction results of each training task and the annotation results corresponding to each target matrix to obtain the trained multi-task model.
[0135] In actual use, the training device for the multi-task model provided by the embodiments of the present disclosure can be configured in any electronic device to execute the foregoing method for training the multi-task model.
[0136] The training device for the multi-task model provided by the embodiments of the present disclosure encodes the training samples in the training sample set to obtain a shared feature matrix corresponding to the training sample set, and based on the training objectives of each training task, respectively filters the shared feature matrix to generate target matrices for each training task. Then, based on the target matrices of each training task, the prediction results of each training task are determined. Furthermore, according to the prediction results of each training task and the annotation results corresponding to each target matrix, the parameters of the multi-task model are corrected to obtain the trained multi-task model. Thus, by filtering out the sample data irrelevant to each training task before training each training task, the redundant training samples irrelevant to the training task are effectively removed, thereby reducing the computational complexity of training the multi-task model and improving the training speed of the model.
[0137] In a possible implementation form of the present disclosure, the foregoing filtering module 53 includes:
[0138] A first determination unit configured to determine the relevance between the training samples in the training sample set and the training objective;
[0139] A first filtering unit configured to respectively filter the shared feature matrix based on the relevance between the training samples and the training objective and the positions of each training sample in the shared feature matrix.
[0140] Further, in another possible implementation manner of the present disclosure, the foregoing first determination unit includes:
[0141] An acquisition subunit configured to acquire the user behaviors recorded by each training sample, where the user behaviors are used to represent the interaction operations occurring on the specified page;
[0142] A judgment subunit configured to judge whether the user behavior corresponding to the training objective matches the user behavior recorded by the training sample;
[0143] A first determination subunit configured to determine that the training sample is relevant to the training objective if the user behavior corresponding to the training objective matches the user behavior recorded by the training sample;
[0144] A second determination subunit configured to determine that the training sample is irrelevant to the training objective if the user behavior corresponding to the training objective does not match the user behavior recorded by the training sample;
[0145] Wherein, the relevance includes relevant and irrelevant.
[0146] Further, in another possible implementation manner of the present disclosure, the above-mentioned first filtering unit includes:
[0147] The first generating subunit is configured to execute that if any training sample is related to the training objective of any training task, the information at the position of any training sample in the shared feature matrix is retained to generate a target matrix corresponding to any training task;
[0148] The second generating subunit is configured to execute that if any training sample is not related to the training objective, the information at the position of any training sample in the shared feature matrix is cleared to generate a target matrix corresponding to any training task.
[0149] Further, in another possible implementation manner of the present disclosure, the above-mentioned filtering module 53 includes:
[0150] The second determining unit is configured to execute determining the relevance between each network layer in the multi-task model and each training task layer by layer from the output layer to the input layer;
[0151] The third determining unit is configured to execute that if any network layer is single-related to any training task, determine the target dependent data of any network layer as the training sample associated with any training task in the training sample set;
[0152] The second filtering unit is configured to execute that if the input data of any network layer includes data other than the training sample associated with any training task, filter the shared feature matrix input to any network layer according to the training objective of any training task.
[0153] Further, in another possible implementation manner of the present disclosure, the above-mentioned second determining unit includes:
[0154] The third determining subunit is configured to execute traversing the multi-task model structure starting from the output layer corresponding to each training task. If any network layer is a single-input and single-output network layer, determine that any network layer is a network layer that is single-related to the training task;
[0155] The fourth determining subunit is configured to execute that if any network layer is a single-input and multi-output network layer, determine that any network layer is a network layer that is multi-related to the training task;
[0156] Among them, the relevance includes single-correlation and multi-correlation. Among them, single-correlation means that the network layer is only related to one training task, and multi-correlation means that the network layer is related to multiple training tasks.
[0157] Regarding the device in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.
[0158] The training device for a multi-task model provided by an embodiment of the present disclosure encodes the training samples in a training sample set to obtain a shared feature matrix corresponding to the training sample set, and based on the correlation between the training sample and the training target, and the position of each training sample in the shared feature matrix, respectively filters the shared feature matrix to generate target matrices for each training task. Then, based on the target matrices of each training task, determines the prediction results of each training task, and further corrects the parameters of the multi-task model according to the prediction results of each training task and the annotation results corresponding to each target matrix, to obtain the trained multi-task model. Thus, before training each training task, by filtering out sample data that is not relevant to the training task according to the correlation between each training sample and the training target of the training task, not only the computational complexity of training the multi-task model is reduced, the training speed of the model is improved, but also the accuracy of redundant sample filtering is further improved.
[0159] Figure 7 It is a block diagram of an electronic device 200 for training a multi-task model shown according to an exemplary embodiment.
[0160] As Figure 7 shown, the above-mentioned electronic device 200 includes:
[0161] A memory 210 and a processor 220, a bus 230 connecting different components (including the memory 210 and the processor 220), and the memory 210 stores a computer program, and when the processor 220 executes the program, it implements the training method of the multi-task model according to the embodiments of the present disclosure.
[0162] The bus 230 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure in a variety of bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0163] The electronic device 200 typically includes a variety of electronic device-readable media. These media can be any available media that can be accessed by the electronic device 200, including volatile and non-volatile media, removable and non-removable media.
[0164] The memory 210 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and / or cache memory 250. The electronic device 200 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 260 can be used for reading and writing on non-removable, non-volatile magnetic media ( Figure 7 not shown, commonly referred to as a "hard disk drive"). Although Figure 7 not shown in the figure, a disk drive for reading and writing on removable non-volatile disks (such as "floppy disks"), and an optical disk drive for reading and writing on removable non-volatile optical disks (such as CD-ROM, DVD-ROM or other optical media) can be provided. In these cases, each drive can be connected to the bus 230 through one or more data media interfaces. The memory 210 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the various embodiments of the present disclosure.
[0165] A program / utility 280 having a set (at least one) of program modules 270 may be stored, for example, in the memory 210. Such program modules 270 include - but are not limited to - an operating system, one or more application programs, other program modules, and program data. Implementations of a network environment may be included in each or some combination of these examples. The program modules 270 generally perform the functions and / or methods in the embodiments described in the present disclosure.
[0166] The electronic device 200 may also communicate with one or more external devices 290 (such as a keyboard, a pointing device, a display 291, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device 200, and / or communicate with any device that enables the electronic device 200 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication may be carried out through an input / output (I / O) interface 292. Moreover, the electronic device 200 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 293. As shown in the figure, the network adapter 293 communicates with other modules of the electronic device 200 through the bus 230. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0167] The processor 220 performs various functional applications and data processing by running programs stored in the memory 210.
[0168] It should be noted that for the implementation process and technical principle of the electronic device in this embodiment, refer to the foregoing explanation of the training method of the multi-task model of the present disclosure, and details are not described herein again.
[0169] The electronic device provided by the embodiments of the present disclosure can execute the training method of the multi-task model as described above. By encoding the training samples in the training sample set, a shared feature matrix corresponding to the training sample set is obtained, and based on the training objectives of each training task, the shared feature matrix is respectively filtered to generate the target matrix of each training task. Then, based on the target matrix of each training task, the prediction result of each training task is determined. Furthermore, according to the prediction result of each training task and the annotation result corresponding to each target matrix, the parameters of the multi-task model are corrected to obtain the trained multi-task model. Thus, by filtering out the sample data irrelevant to the training task before training each training task, the redundant training samples irrelevant to the training task are effectively removed, thereby reducing the computational complexity of the multi-task model training and improving the training speed of the model.
[0170] To implement the above embodiment, the present disclosure also proposes a storage medium.
[0171] Wherein, when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the training method of the multi-task model as described above.
[0172] To implement the above embodiment, the present disclosure also provides a computer program product. When the computer program is executed by the processor of the electronic device, the electronic device can execute the training method of the multi-task model as described above.
[0173] Those skilled in the art will readily conceive of other implementations of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and embodiments are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0174] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A training method for a multi-task model, characterized in that, Including: Obtain a training sample set, where the training sample set contains training samples and annotation results corresponding to multiple training tasks. The training samples are used to record interaction parameters of multimedia information in an application, the interaction parameters are multi-dimensional parameters, and the annotation results are used to annotate the interaction results of each dimension; Encode the training samples in the training sample set through an encoder to obtain a shared feature matrix corresponding to the training sample set; Starting from the output layer corresponding to each training task, traverse the multi-task model structure. If any network layer is a single-input and single-output network layer, determine that the any network layer is a network layer related only to the training task; If any network layer is a single-input and multi-output network layer, determine that the any network layer is a network layer related to multiple training tasks; The relevance includes single relevance and multi-relevance. Single relevance indicates that the network layer is related to only one training task, and multi-relevance indicates that the network layer is related to multiple training tasks; If any network layer is single-related to any training task, determine that the target dependent data of the any network layer is the training sample associated with the any training task in the training sample set; If the input data of the any network layer includes data other than the training samples associated with the any training task, filter the shared feature matrix input to the any network layer according to the training objective of the any training task, and generate target matrices for each training task; Based on the target matrices of each training task, determine the prediction results of each training task; According to the prediction results of each training task and the annotation results corresponding to each target matrix, correct the parameters of the multi-task model to obtain a trained multi-task model.
2. The method according to claim 1, wherein The filtering process of the shared feature matrix respectively based on the training objectives of each training task includes: Determine the degree of association between the training samples in the training sample set and the training objective; Based on the degree of association between the training sample and the training objective, and the position of each training sample in the shared feature matrix, filter the shared feature matrix respectively.
3. The method according to claim 2, wherein The determination of the degree of association between the training samples in the training sample set and the training objective includes: Obtain the user behavior recorded by each training sample, where the user behavior is used to represent the interaction operation that occurs on a specified page; Judge whether the user behavior corresponding to the training objective matches the user behavior recorded by the training sample; If the user behavior corresponding to the training objective matches the user behavior recorded by the training sample, determine that the training sample is associated with the training objective; If the user behavior corresponding to the training objective does not match the user behavior recorded by the training sample, determine that the training sample is not associated with the training objective; Wherein, the degree of association includes associated and not associated.
4. The method according to claim 2, wherein The filtering process of the shared feature matrix respectively based on the degree of association between the training sample and the training objective, and the position of each training sample in the shared feature matrix includes: If any training sample is related to the training objective of any training task, the information at the position of the any training sample in the shared feature matrix is retained to generate the target matrix corresponding to the any training task; If any training sample is not related to the training objective, the information at the position of the any training sample in the shared feature matrix is cleared to generate the target matrix corresponding to the any training task.
5. A training device for a multi-task model, characterized in that Including: An acquisition module, configured to execute acquiring a training sample set, where the training sample set contains training samples and annotation results corresponding to multiple training tasks, the training samples are used to record interaction parameters of multimedia information in an application, the interaction parameters are multi-dimensional parameters, and the annotation results are used to annotate the interaction results of each dimension; An encoding module, configured to execute encoding the training samples in the training sample set through an encoder to obtain the shared feature matrix corresponding to the training sample set; A filtering module, configured to execute filtering the shared feature matrix respectively based on the training objectives of each training task to generate the target matrix of each training task; A determination module, configured to execute determining the prediction results of each training task based on the target matrix of each training task; A correction module, configured to execute correcting the parameters of the multi-task model according to the prediction results of each training task and the annotation results corresponding to each target matrix to obtain the trained multi-task model; The filtering module includes: A second determination unit, configured to execute determining the relevance between each network layer in the multi-task model and each training task layer by layer from the output layer to the input layer; A third determination unit, configured to execute if any network layer is single-related to any training task, determining the target dependent data of the any network layer as the training sample associated with the any training task in the training sample set; A second filtering unit, configured to execute if the input data of the any network layer includes other data except the training sample associated with the any training task, filtering the shared feature matrix input to the any network layer according to the training objective of the any training task; The second determination unit includes: A third determination subunit, configured to execute traversing the multi-task model structure starting from the output layer corresponding to each training task, and if any network layer is a single-input and single-output network layer, determining that the any network layer is a network layer that is single-related to the training task; A fourth determination subunit, configured to execute if any network layer is a single-input and multi-output network layer, determining that the any network layer is a network layer that is multi-related to the training task; Wherein, the relevance includes single relevance and multi relevance, wherein, single relevance indicates that the network layer is only related to one training task, and multi relevance indicates that the network layer is related to multiple training tasks.
6. The device according to claim 5, characterized in that The filtering module includes: A first determination unit, configured to execute determining the association degree between the training samples in the training sample set and the training objective; The first filtering unit is configured to perform filtering processing on the shared feature matrix respectively based on the degree of association between the training sample and the training target, and the position of each training sample in the shared feature matrix.
7. The device according to claim 6, characterized in that, The first determination unit includes: An acquisition subunit configured to acquire the user behavior recorded by each of the training samples, where the user behavior is used to represent an interaction operation occurring on a specified page; A judgment subunit configured to judge whether the user behavior corresponding to the training target matches the user behavior recorded by the training sample; A first determination subunit configured to determine that the training sample is associated with the training target if the user behavior corresponding to the training target matches the user behavior recorded by the training sample; A second determination subunit configured to determine that the training sample has no association with the training target if the user behavior corresponding to the training target does not match the user behavior recorded by the training sample; Wherein, the degree of association includes associated and not associated.
8. The device according to claim 6, characterized in that, The first filtering unit includes: A first generation subunit configured to retain the information at the position of any training sample in the shared feature matrix to generate a target matrix corresponding to any training task if any training sample is associated with the training target of any training task; A second generation subunit configured to clear the information at the position of any training sample in the shared feature matrix to generate a target matrix corresponding to any training task if any training sample has no association with the training target.
9. An electronic device, characterized in that, Includes: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the instructions to implement the training method of the multi-task model according to any one of claims 1-4.
10. A computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the training method of the multi-task model according to any one of claims 1-4.
11. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions, when executed by a processor, implement the training method of the multi-task model according to any one of claims 1-4.
Citation Information
Patent Citations
Semi-supervised learning software defect prediction method based on spectral clustering
CN112148605A
Multi-task learning method, device and equipment and storage medium
CN112417156A