Sample data screening method, device, medium, equipment and program product
By evaluating and sorting the sample data of the multi-task learning model, sample data with good training effects for multiple sub-models is selected, which solves the problem of large convergence between tasks with multi-task learning model, and achieves better universality and training efficiency.
Patent Information
- Application Number
- CN202411968081.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-08
AI Technical Summary
In the prior art, the convergence difference between each task is large, and the model is difficult to achieve optimality, mainly because the importance of each sample data in the data set itself and the gain of the sample data to different tasks.
By entering each sample data in the sample data set into multiple sub-models, multiple gradient vectors corresponding to each sample data are calculated, and evaluation parameters are determined based on the modulus length of the gradient vector, and then the sample data set is sorted to filter out sample data that has good training effects for multiple sub-models.
Effective sample data screening of multi-task models is realized, the universality of multi-task learning is improved, the convergence consistency of the model among different tasks, and the training time is reduced.
Smart Images

Figure CN119782819A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular, to a sample data screening method, device, medium, equipment and program product. Background Art
[0002] In the related technology, the judgment model outputs the corresponding feature matrix according to the task data of the main task and the task to be selected, performs orthogonal calculation on the feature matrices of the two types of tasks to obtain the correlation judgment value, selects the related tasks based on the correlation judgment value, and uses the task data of the related tasks as the extended data set of the main task. It can be seen that the data in the data set obtained by the related technology are highly correlated, but the data set is only applicable to a specific scenario and is not universal. It also ignores the importance of each sample data in the data set and the gain of the sample data for different tasks. The multi-task model trained based on the data set has a large difference in convergence between each task, and it is difficult for the model to reach the optimal. Summary of the invention
[0003] The purpose of the present invention is to provide a sample data screening method, device, medium, equipment and program product, which starts from training data to obtain a training set for model training. The multi-task model obtained based on the training set is not limited by specific task scenarios and has good versatility.
[0004] In order to achieve the above objectives, in a first aspect, the present disclosure provides a sample data screening method, comprising: Input each sample data in the sample data set into the first model, process each sample data through multiple sub-models in the first model, and output multiple gradient vectors corresponding to each sample data, where each sub-model outputs one gradient vector; Determine evaluation parameters of each piece of sample data according to the moduli of the plurality of gradient vectors corresponding to each piece of sample data in a specified direction, wherein the evaluation parameters are used to evaluate the training index of the sample data in each of the sub-models; The sample data of the sample data set are sorted according to the evaluation parameter of each piece of the sample data, and a first training set for model training is obtained according to the sorting result.
[0005] In a second aspect, the present disclosure provides a sample data screening device, comprising: A determination module is configured to input each sample data in the sample data set into a first model, process each sample data through a plurality of sub-models in the first model, and output a plurality of gradient vectors corresponding to each sample data, wherein each sub-model outputs one gradient vector; A first execution module is configured to determine an evaluation parameter of each piece of sample data according to the modulus of the plurality of gradient vectors corresponding to each piece of sample data in a specified direction, wherein the evaluation parameter is used to evaluate the training index of the sample data in each of the sub-models; The second execution module is configured to sort the sample data of the sample data set according to the evaluation parameter of each piece of the sample data, and obtain a first training set for model training according to the sorting result.
[0006] In a third aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which implements the method described in the first aspect when the computer program is executed by a processor.
[0007] In a fourth aspect, the present disclosure provides an electronic device, including: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the method described in the first aspect.
[0008] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.
[0009] Through the above technical solution, first, in the process of model training, the gradient vector is used to update the model parameters. For a model including multiple sub-models, the training effect of the same sample data on different sub-models may be quite different, that is, the training of different sub-models using the same sample data may not enable all the multiple sub-models to obtain good training effects. The technical solution disclosed in the present invention determines the evaluation parameters that can be used to evaluate the training indicators of the sample data in each sub-model according to the modulus lengths of the multiple gradient vectors corresponding to the sample data in the specified direction. In this way, for multiple sample data, the sample data in the sample data set are sorted according to the evaluation parameters corresponding to each sample data, and the sample data with good training effects on multiple sub-models can be screened from the sample data set according to the sorting results to obtain a training set. In addition, the technical solution disclosed in the present invention is not limited by specific scenarios and has universality. For models with different types of sub-models, the technical solution can be used for sample screening.
[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings: Figure 1 It is a schematic diagram of an application environment of a sample data screening method according to an exemplary embodiment of the present disclosure.
[0012] Figure 2 The figure is a flow chart of a sample data screening method according to an exemplary embodiment of the present disclosure.
[0013] Figure 3 is a schematic diagram of a first model according to an exemplary embodiment of the present disclosure.
[0014] Figure 4 FIG. 4 is a schematic diagram of multiple gradient vectors corresponding to sample data according to an exemplary embodiment of the present disclosure.
[0015] Figure 5 is another flow chart of a sample data screening method according to an exemplary embodiment of the present disclosure.
[0016] Figure 6 is another flow chart of a sample data screening method according to an exemplary embodiment of the present disclosure.
[0017] Figure 7 The figure is a schematic diagram of a screening process of a sample data screening method according to an exemplary embodiment of the present disclosure.
[0018] Figure 8 It is a schematic diagram of a multi-task model training method according to an exemplary embodiment of the present disclosure.
[0019] Fig. 9 The present invention is a block diagram of a sample data screening device according to an exemplary embodiment of the present invention.
[0020] Fig.10 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0022] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0023] At present, most machine learning models are learned independently, that is, single-task learning. One task corresponds to one model, and then iterative optimization is performed. For slightly more complex tasks, each part of the task is modeled by breaking down the task. However, when modeling each subtask after the decomposition, it is easy to ignore the relationship between the subtasks, such as the association, conflict, and constraint, resulting in the overall effect of multiple tasks not being better.
[0024] For example, the intelligent quality inspection system includes many types and quantities of tasks, such as sensitive word recognition, emotion recognition, multiple intention recognition (such as whether the person is recognized, false judicial recognition, false promise recognition, etc.). In such a complex system, if each task is deployed through an independent model, it will take up a huge amount of memory and increase the reasoning time of the intelligent quality inspection system, resulting in extremely high complexity of intelligent quality inspection and poor user experience.
[0025] However, some tasks are related to each other, such as sensitive word recognition and false promise recognition. This leads to multi-task learning, which is a concept opposite to single-task learning. In multi-task learning, multiple related tasks are learned together, and multiple related tasks share a model. For example, in a recommendation system, the ranking model simultaneously estimates the click-through rate and browsing time of candidate objects, and the click-through rate and browsing time of candidate objects share the same model for estimation. Compared with single-task learning, multi-task learning has the following beneficial effects: 1. Multiple tasks share one model, which reduces the amount of memory occupied during multi-task learning; Second, it can process multiple related tasks in parallel, and the related parts of multiple related tasks are no longer calculated repeatedly, thereby reducing redundant calculations and improving the speed and efficiency of the model during reasoning; 3. Multiple related tasks can share information and complement each other, thereby improving each other’s performance. That is, when multiple tasks are learned simultaneously, if one task contains information that is useful for another task, it can improve the model’s performance on the latter.
[0026] The inventors found that the optimization of multi-task learning in the related technologies all focused on the iteration and innovation of the network structure, or the improvement of the loss function (for example, adjusting the weight of the corresponding task loss function according to the performance of the model in each task; increasing or correcting the training samples of the related tasks; improving the network structure according to the relevance of the tasks); or optimizing the data set based on the main task (for example, orthogonally calculating the feature matrix corresponding to the task data of the main task and any candidate task to obtain the relevance judgment value, screening the candidate task as the related task of the main task based on the relevance judgment value, and using the task data of the related task as the extended data set of the main task). However, the importance of each sample data in the data set and the gain of the sample data for different tasks are ignored. For example, the model is trained by some low-gain data or even negative-gain data, resulting in the failure to achieve the optimal model performance, making the network model only applicable to data in a specific scenario and not universal. In addition, the entire learning process is cumbersome to iterate and the training is time-consuming. When the convergence speeds between tasks differ greatly, it will make it difficult for the network model to achieve the optimal.
[0027] In view of this, the present disclosure provides a sample data screening method, apparatus, medium, equipment and program product, which starts from the training data of the multi-task model, and screens the training data set for multi-task training from the sample data set according to the screening parameters, without improving the network structure and loss function of the multi-task model, thereby ensuring that the multi-task model is not restricted by the task scenario, thereby improving the versatility of multi-task learning.
[0028] In order to better understand the sample data screening method, apparatus, medium, equipment and program product provided in the disclosed embodiments, the application scenarios applicable to the disclosed embodiments are described below.
[0029] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram showing an application environment of a sample data screening method provided by an exemplary embodiment. As an embodiment, the sample data screening method provided by the present disclosure can be applied in an electronic device, wherein the electronic device can be Figure 1 The server 10 shown in the figure can be connected to the terminal device 20 through a network, wherein the network is a medium for providing a communication link between the server 10 and the terminal device 20. The network can include various connection types, such as a wired communication link, a wireless communication link, etc., which are not limited in the embodiments of the present disclosure. Optionally, the electronic device can also be a smart phone, a laptop computer, etc.
[0030] It should be understood that Figure 1The server 10, network and terminal device 20 are only illustrative, and any data server 10, network and terminal device 20 may be provided according to actual needs. For example, the server 10 may be a physical server or a server cluster composed of multiple servers 10. The terminal device 20 may be a mobile phone, a tablet, a desktop computer, a laptop computer, a smart wearable device and other devices.
[0031] In some embodiments, the terminal device 20 can collect sample data of multiple tasks to obtain a sample data set for multi-task training. Furthermore, the terminal device 20 sends the sample data set to the server 10 via the network. After the server 10 receives the sample data set, the sample data set can be processed by the sample data screening method provided in the embodiment of the present disclosure.
[0032] The embodiments of the present disclosure are further explained below with reference to the accompanying drawings.
[0033] Figure 2 is a flow chart of a sample data screening method according to an exemplary embodiment of the present disclosure, and the sample screening method can be applied to electronic devices. Figure 2 , the sample data screening method may include the following steps: In step S11, each sample data in the sample data set is input into the first model, and each sample data is processed by multiple sub-models in the first model to output multiple gradient vectors corresponding to each sample data, with one sub-model outputting one gradient vector.
[0034] It should be understood that the multiple sample data in the sample data set may be sample data of multiple tasks that are interrelated. The multiple tasks may be multiple tasks that are interrelated in any of the scenarios such as natural language processing scenarios, computer vision scenarios, speech recognition scenarios, recommendation system scenarios, autonomous driving scenarios, and robot learning scenarios. For example, sentiment analysis in natural language processing scenarios simultaneously identifies the sentiment tendency and theme of the text; machine translation in natural language processing scenarios learns the grammar and semantics of the language while translating from one language to another; image classification in computer vision scenarios simultaneously identifies multiple objects in the image; object detection and segmentation in computer vision scenarios simultaneously performs semantic segmentation of the object when detecting the object in the image.
[0035] It is worth noting that one sub-model corresponds to one task. When the first model can process N tasks simultaneously, the first model includes N sub-models. One sub-model processes one sample data and outputs one gradient vector. N sub-models process one sample data and output N gradient vectors.
[0036] It should be understood that the gradient vector is used to guide the update direction of the model parameters. During the training process, the gradient vector corresponding to the sample data is calculated by the loss function value of the sub-model, and the maximum increase direction of the loss function under the current sample data can be obtained.
[0037] In step S12, evaluation parameters of each piece of sample data are determined according to the moduli of multiple gradient vectors corresponding to each piece of sample data in a specified direction, and the evaluation parameters are used to evaluate the training index of the sample data in each of the sub-models.
[0038] It is worth noting that since the gradient vector is a vector, including direction and magnitude, the modulus cannot be calculated without fixing the mapping direction of the gradient vector. The multiple moduli of the multiple gradient vectors corresponding to each sample data in the specified direction, the size of each modulus indicates the improvement of the accuracy of a sub-model in the specified direction by the sample data.
[0039] For example, in the case of N tasks, a piece of sample data is input into the first model, and the N sub-models in the first model process the sample data and output N gradient vectors corresponding to the sample data. Then, based on the N gradient vectors corresponding to the sample data, the evaluation parameters corresponding to the sample data are determined.
[0040] In step S13, the sample data of the sample data set are sorted according to the evaluation parameter of each piece of the sample data, and a first training set for model training is obtained according to the sorting result.
[0041] It is worth noting that the evaluation parameter can be a gain value, a convergence value, or a parameter that takes both gain and convergence into account. The training set obtained by screening according to the gain value can take into account the gain size of the gradient vector of the sample data on each sub-model in the specified direction; the training set obtained by screening according to the convergence value can take into account the convergence speed of each sub-model on the sample data. Therefore, the multi-task model can be trained by the training set obtained by screening according to the evaluation parameters, thereby optimizing multi-task learning.
[0042] In the embodiment of the present disclosure, each sample data in the sample data set is input into the first model, and the first model outputs multiple gradient vectors corresponding to each sample data. According to the modulus length of the multiple gradient vectors corresponding to the sample data in the specified direction, the evaluation parameter corresponding to the sample data that can be used to evaluate the training index of the sample data in each sub-model is determined. In this way, for multiple sample data, the sample data in the sample data set are sorted according to the evaluation parameters corresponding to each sample data, and the sample data with good training effects on multiple sub-models can be screened from the sample data set according to the sorting results to obtain a training set. In addition, the technical solution disclosed in the present disclosure is not limited by specific scenarios and has universality. For models with different types of sub-models, the technical solution can be used to screen samples. In addition, sample data with large interference or invalid for model training are eliminated during the screening process, which greatly reduces the data volume of the training set, and can reduce the training time of the multi-task model while improving the performance of the multi-task model.
[0043] In order to facilitate those skilled in the art to better understand the sample data screening method provided by the present disclosure, the sample data screening method is described in detail below.
[0044] In a feasible implementation manner, before each sample data in the sample data set is input into the first model, the following steps may be included: Freeze the model parameters of the first model.
[0045] Specifically, after freezing the model parameters of the first model, each sample data in the sample data set is input into the first model, and multiple sub-models in the first model process each sample data according to the loss function of the sub-model, and output multiple gradient vectors corresponding to each sample data.
[0046] It is worth noting that the first model can be obtained by training with an initial training data set. The sample data in the initial training data set is different from that in the sample data set. The first model is initially trained with the initial training data set. After reaching a preset number of training times, the first model after the initial training is obtained. The initial training has no requirements on whether the first model converges.
[0047] It should be understood that if Figure 3 As shown, the first model can be a multi-task model, and the first model includes a parameter sharing layer, a parameter exclusive layer and an output layer, wherein the parameter sharing layer is the model parameters shared by N tasks in the multi-task model, the parameter exclusive layer is the model parameters unique to the N sub-models in the multi-task model, the parameter exclusive layer is composed of multiple sub-models, each sub-model corresponds to a task, and the first model can simultaneously output the results corresponding to N tasks according to an input data.
[0048] Accordingly, the model parameters of the first model are frozen, specifically, the parameters of the parameter sharing layer and the parameter exclusive layer in the first model are frozen, so that the multi-task model can identify the gradient vector V of each sample data on each task. i,2 、V i,1 ,…,V i,N In the process of , there is no need to update the parameters of the parameter sharing layer and the parameter exclusive layer, thereby speeding up the processing speed of the multi-task model. And because the parameters of the parameter sharing layer and the parameter exclusive layer in the multi-task model are not updated, it is ensured that when each sub-model processes the sample data, the gradient calculation is performed on the same basis, thereby avoiding the gradient influence between the sample data and improving the accuracy and reliability of the subsequent evaluation parameters.
[0049] For example, obtain a training data set D, randomly select m% sample data from the training data set D as the initial training data set, 5<m<15, and use the remaining data in the training data set D except the initial training data set as the sample data set d; or randomly select m% sample data from the training data set D as the initial training set, and the m% sample data can make the recognition accuracy of the first model not less than 50%.
[0050] It is worth noting that the evaluation parameter of each sample data in the embodiments of the present disclosure may be a gain value, a convergence value, or a parameter that takes both the gain value and the convergence value into consideration.
[0051] In a feasible implementation, determining the evaluation parameter of each piece of sample data according to the modulus lengths of multiple gradient vectors corresponding to each piece of sample data in a specified direction may include: Determine gain values and / or convergence values of the sample data on multiple sub-models according to the modulus lengths of multiple gradient vectors corresponding to each piece of sample data in a specified direction; An evaluation parameter of the piece of sample data is determined according to the gain value and / or the convergence value.
[0052] It is worth noting that the gain value can be used as the evaluation parameter of the sample data, and the samples of the sample data set are sorted according to the evaluation parameter. According to the training set obtained by the sorting result, at this time, the model training is performed according to the training set, and the gain of each sub-model in the multi-task model after training can be maximized. The convergence value can also be used as the evaluation parameter of the sample data, and the samples of the sample data set are sorted according to the evaluation parameter. According to the training set obtained by the sorting result, at this time, the model training is performed according to the training set, and the convergence speed of each sub-model in the multi-task model after training can be optimized. The evaluation parameter of the sample data can also be calculated according to the gain value and the convergence value, and the samples of the sample data set are sorted according to the evaluation parameter. According to the training set obtained by the sorting result, at this time, the model training is performed according to the training set, and the gain of each sub-model in the multi-task model after training can be maximized and the convergence speed can be optimized.
[0053] In a feasible implementation, the modulus of the multiple gradient vectors corresponding to each sample data in a specified direction can be determined by the following method: For each piece of sample data, an average vector of multiple gradient vectors corresponding to the sample data is determined, and the multiple gradient vectors are mapped to the vector direction where the average vector is located, to obtain the modulus of the multiple gradient vectors in the vector direction where the average vector is located, wherein the modulus corresponding to the gradient vector whose angle with the average vector is greater than 90 degrees is a negative value, and the modulus corresponding to the gradient vector whose angle with the average vector is less than or equal to 90 degrees is a value greater than or equal to 0.
[0054] For example, Figure 4 As shown, V i,1 、V i,2 ,…,V i,N Respectively represent the N gradient vectors output by N sub-models after processing the i-th sample data, V i Represents the average vector of N gradient vectors output by N sub-models after processing the i-th sample data, v i,1 、v i,2 ,…,v i,N Characterize V i,1 、V i,2 ,…,V i,N Mapped to the mean vector V i The target vector in the direction, θ i,1 ,θ i,2 ,…,θ i,N Characterize V i,1 、V i,2 ,…,V i,N With V i The angle between ||v i,1 ||、||v i,2 ||, …, ||v i,N|| respectively represents v i,1 、v i,2 ,…,v i,N The larger the modulus, the faster the gradient of the i-th sample data in the sub-model corresponding to the modulus, and the greater the gain of the i-th sample on the sub-model, such as ||v i,N ||<||v i,1 ||<||v i,2 ||, indicating that the performance of the i-th sample data on the second task corresponding to the second sub-model is better than the first task corresponding to the first sub-model, and the performance on the first task corresponding to the first sub-model is better than the N-th task corresponding to the N-th sub-model; because θ i,N is greater than 90°, so ||v i,N || is a negative value, indicating that the i-th sample data has a negative gain effect on the N-th task corresponding to the N-th sub-model.
[0055] In a feasible implementation, the evaluation parameter of each piece of sample data is determined according to the modulus lengths of multiple gradient vectors corresponding to each piece of sample data in a specified direction, including: According to the modulus lengths of the multiple gradient vectors in the vector direction where the average vector is located, the gain values of the sample data on the multiple sub-models are obtained; and / or, According to the maximum modulus and the minimum modulus of multiple gradient vectors in the vector direction where the average vector is located, the convergence value of the sample data on multiple sub-models is obtained; An evaluation parameter of the piece of sample data is determined according to the gain value and / or the convergence value.
[0056] It is worth mentioning that the average vector is the abbreviation of the average gradient vector. The average gradient vector is usually related to tasks such as finding the optimal solution, feature extraction, and trend analysis in different fields. By using gradient information, parameter updates, feature recognition, and decision making can be performed more effectively. For example, in the fields of machine learning and deep learning, the average gradient vector refers to the gradient calculated using the entire data set, which can be used to guide the update of model parameters; in the field of image processing, the size of the average gradient can reflect the clarity of the image or the ability to express detail contrast; in the field of computer vision, the gradient vector can be used for feature extraction; in the field of optimization algorithms, the gradient vector provides the direction in which the function grows fastest, so in optimization problems such as linear programming and nonlinear programming, the gradient descent method and other gradient-based optimization algorithms are used to find the optimal solution.
[0057] Therefore, in the embodiments of the present disclosure, the gradient vector of each sample data on each sub-model can be mapped to the vector direction of the average gradient vector of the sample data on each sub-model to obtain the modulus of each sample data on each sub-model.
[0058] It is worth noting that the sum of the moduli of multiple gradient vectors in the direction of the average vector is calculated to obtain the gain value of the sample data on multiple sub-models.
[0059] For example, Figure 4 As shown, V i,1 、V i,2 ,…,V i,N Respectively represent the N gradient vectors output by N sub-models after processing the i-th sample data, V i Represents the average vector of N gradient vectors output by N sub-models after processing the i-th sample data, v i,1 、v i,2 ,…,v i,N Characterize V i,1 、V i,2 ,…,V i,N Mapped to the mean vector V i The target vector in the direction, θ i,1 ,θ i,2 ,…,θ i,N Characterize V i,1 、V i,2 ,…,V i,N With V i The angle between ||v i,1 ||、||v i,2 ||, …, ||v i,N || respectively represents v i,1 、v i,2 ,…,v i,N The gain value of the i-th sample data on the N sub-models It can be obtained by the following calculation formula:
[0060]
[0061] , j=1,2,…N.
[0062] It is worth noting that the convergence value of the sample data on multiple sub-models is obtained by subtracting the minimum modulus from the maximum modulus of multiple gradient vectors in the vector direction where the average vector is located.
[0063] For example, Figure 4 As shown, V i,1 、V i,2 ,…,V i,N Respectively represent the N gradient vectors output by N sub-models after processing the i-th sample data, V iRepresents the average vector of N gradient vectors output by N sub-models after processing the i-th sample data, v i,1 、v i,2 ,…,v i,N Characterize V i,1 、V i,2 ,…,V i,N Mapped to the mean vector V i The target vector in the direction, θ i,1 ,θ i,2 ,…,θ i,N Characterize V i,1 、V i,2 ,…,V i,N With V i The angle between ||v i,1 ||、||v i,2 ||, …, ||v i,N || respectively represents v i,1 、v i,2 ,…,v i,N The maximum modulus of the N gradient vectors in the direction of the average vector is , the minimum module length is , the convergence value of the i-th sample data on the N sub-models is .
[0064] It is worth noting that the evaluation parameter of the sample data is calculated based on the gain value and convergence value of the sample data, which can be calculated in the following two ways.
[0065] For method one: For example, Figure 4 As shown, the gain value of the i-th sample data on the N sub-models is , the convergence value of the i-th sample data on the N sub-models is , then the evaluation parameter S of the i-th sample data on the N-th sub-model takes into account both the gain and the convergence speed i , can be obtained by the following calculation formula: .
[0066] It is worth noting that in the first method of determining the evaluation parameter based on the gain value and convergence value of the sample data, the gain value ▽ i To measure the gain of the i-th sample data on the N sub-models, the gain value ▽ iThe larger the value, the greater the contribution of the i-th sample data to the N gradient vectors in the specified vector direction, that is, the greater the gain. However, the greater the gain in the specified vector direction, it does not mean that the sample gain of the i-th sample data increases accordingly. It is also necessary to consider the convergence speed of the i-th sample data on the N tasks. Therefore, the difference between the maximum modulus and the minimum modulus is used to calculate the value of , that is, the convergence value, is used to measure the convergence speed of the i-th sample data on N tasks. The smaller the convergence value, the smaller the difference in the contribution value of the i-th sample data on N tasks, which means that the convergence speed of the i-th sample data on N tasks is more consistent. Therefore, the gain value ▽ i The larger the value of The smaller the value, the greater the evaluation parameter S of the i-th sample data. i The larger it is, the more important the i-th sample data is in model training.
[0067] In summary, method one limits the gain size of multiple gradient vectors corresponding to the sample data in a specified direction by the gain value corresponding to the sample data, and limits the convergence speed of the sample data on each task by the convergence value corresponding to the sample data, thereby taking into account the gain size of multiple gradient vectors corresponding to the sample data in the specified direction and the convergence speed of the sample data on each task.
[0068] For method 2: For example, Figure 4 As shown, V i,1 、V i,2 ,…,V i,N Respectively represent the N gradient vectors corresponding to the i-th sample data, and for the N gradient vectors V i,1 、V i,2 ,…,V i,N Sum and get the synthetic gradient vector g total , the synthetic gradient vector g total Substitute the following calculation formula to obtain the synthetic gradient vector g total The Euclidean norm of : , j=1,2,…N.
[0069] It is worth noting that in the second method of determining the evaluation parameters according to the gain value and convergence value of the sample data, the contribution value of the N gradient vectors corresponding to the i-th sample in the specified vector direction and the convergence speed of the i-th sample data on the N tasks are measured by the Euclidean norm of the sum of multiple gradient vectors corresponding to the sample data. Therefore, The larger it is, the more important the i-th sample data is in model training.
[0070] In summary, in method 2, the Euclidean norm of the sum of multiple gradient vectors corresponding to the sample data is used to limit the gains of multiple gradient vectors corresponding to the sample data in the specified direction and the convergence speed of the sample data on each task at the same time, thereby taking into account the gain size of multiple gradient vectors corresponding to the sample data in the specified direction and the convergence speed of the sample data on each task.
[0071] In a feasible implementation, the sample data of the sample data set are sorted according to the evaluation parameter of each sample data, and a first training set for model training is obtained according to the sorting result, which may include: Sorting each piece of sample data according to the descending order of the evaluation parameter of each piece of sample data to obtain a first sorting result; According to the first sorting result, the first N sample data are screened from the sample data set to obtain a first training set for model training, where N is an integer value of the sample data.
[0072] Among them, N can be preset according to the processing requirements of the multi-task model, and this disclosure does not limit this.
[0073] It is worth noting that by eliminating negative samples in the sample data set, it can be ensured that each sample data in the first training set subsequently screened according to the evaluation parameters has a positive gain for all tasks, and no negative gain will occur, so that the obtained training data has a larger positive gain for multi-task learning, and each task has a consistent convergence speed on each sample data in the sample data set.
[0074] It should be understood that each positive sample can be sorted according to the ascending order of the evaluation parameter to obtain a first sorting result, and the N positive samples can be screened from the sample data set according to the first sorting result to obtain a first training set. This ensures that the screened N sample data have a large positive gain on multi-task learning, and also enables multiple tasks to have a consistent convergence speed on the N sample data.
[0075] For example, according to the size of the evaluation parameter of each sample data, multiple sample data are sorted from large to small to obtain a first sorting result, and the first N sample data in the first sorting result are used as the first training set; or, according to the size of the evaluation parameter of each sample data, multiple sample data are sorted from small to large to obtain a first sorting result, and the last N sample data in the first sorting result are used as the first training set.
[0076] In the disclosed embodiment, a first training set is obtained by screening from multiple positive sample data based on the size of the evaluation parameter. Each sample data in the first training set simultaneously takes into account the gain size of multiple gradient vectors corresponding to the sample data in a specified direction, as well as the convergence speed of each task on the sample data, so that the multi-task model obtained according to the first training set can converge synchronously when executing multiple tasks.
[0077] like Figure 5 As shown, the sample data screening method provided by the present disclosure may include the following steps: In step S1111 , the model parameters of the first model are frozen.
[0078] In step S1112, each sample data in the sample data set is input into the first model, and multiple sub-models in the first model process each sample data according to the loss function of the sub-model, and output multiple gradient vectors corresponding to each sample data.
[0079] In step S1211, gain values and / or convergence values of the sample data on multiple sub-models are determined according to the moduli of multiple gradient vectors corresponding to each piece of sample data in a specified direction.
[0080] In step S1212, the evaluation parameter of the piece of sample data is determined according to the gain value and / or the convergence value.
[0081] In step S1311, the pieces of sample data are sorted according to the descending order of the evaluation parameter of each piece of sample data to obtain a first sorting result.
[0082] In step S1312, according to the first sorting result, the first N sample data are screened from the sample data set to obtain a first training set for model training.
[0083] To summarize, the first method of the sample data screening method provided in the embodiment of the present disclosure can select, from the sample data set, based on the evaluation parameters of each sample data, sample data that takes into account the gain size of multiple gradient vectors corresponding to the sample data in a specified direction, as well as the convergence speed of each task on the sample data, so that the multi-task model obtained according to the first training set can converge synchronously when executing multiple tasks.
[0084] It should be understood that, although the sample data in the first training set takes into account the convergence speed and the size of the gain value on the task, due to the different difficulty levels of each task, when the multi-task model performs multiple tasks, each task cannot reach the optimal state at the same time when using the sample data in the first training set for model training. Therefore, on the basis of the first method of the above-mentioned sample data screening method, it is necessary to screen new sample data again according to the difficulty level of each task to obtain a second training set, and combine the first training set and the second training set as the training set for multi-task model training.
[0085] In a possible implementation, if Figure 6 As shown, the above sample data screening method may also include: In step S61, the processing accuracy of multiple sub-models in the first model is determined, and the processing accuracy is used to characterize the training difficulty of the corresponding sub-models.
[0086] It is worth noting that after training with the same sample data, the worse the accuracy of the sub-model, the higher the difficulty of training the sub-model, and the difficulty of training the sub-model is proportional to the difficulty of the task corresponding to the sub-model. That is, the higher the difficulty of training the sub-model, the more difficult the task corresponding to the sub-model is to perform, and the lower the processing accuracy of the sub-model.
[0087] In step S62, the plurality of sub-models are sorted according to the ascending order of the processing accuracy to obtain a second sorting result.
[0088] Specifically, according to the processing accuracy, the multiple sub-models are sorted from small to large to obtain a second sorting result.
[0089] In step S63, the multiple sub-models are sorted according to the descending order of the module lengths of the multiple gradient vectors corresponding to each piece of the sample data in the specified direction to obtain a third sorting result.
[0090] Specifically, according to the magnitudes of the multiple modulus lengths of the multiple gradient vectors corresponding to each piece of sample data in the specified direction, the multiple sub-models are sorted from large to small to obtain a third sorting result.
[0091] It is worth noting that the better a sub-model performs on a certain sample data, the easier it is to learn the task corresponding to the sub-model and the lower the difficulty of the task. The magnitude of the modulus of multiple gradient vectors corresponding to a sample data in a specified direction is consistent with the training difficulty of the sub-model that outputs the gradient vector. For example, the Nth sub-model in the first model processes a sample data and outputs a gradient vector. The magnitude of the modulus of the gradient vector in the specified direction is consistent with the training difficulty of the Nth sub-model.
[0092] In step S64, the ranking similarity between the second ranking result and the third ranking result corresponding to each piece of sample data is determined.
[0093] In step S65, sample data whose second sorting result is consistent with the third sorting result is screened out from the second data set to obtain a second training set, wherein the sample data set includes the first training set and the second data set, and the evaluation parameter corresponding to each sample data in the second training set is a positive value.
[0094] It should be understood that, as mentioned above, each sub-model processes the same sample data, and the magnitude of the modulus of the output gradient vector in the specified direction is consistent with the task difficulty of the corresponding task of each sub-model, that is, the modulus is proportional to the task difficulty. Therefore, the second sorting result and the third sorting result can both be in ascending or descending order, so that the two sorting results are arranged in order from small to large or from large to small, that is, the sorting method of the two sorting results is the same, thereby ensuring that the sample data in the second training set obtained according to the second sorting result and the third sorting result can accelerate convergence on more difficult tasks and slow down convergence on less difficult tasks.
[0095] For example, the sample data set includes a first training set and a second data set. Assuming that each N sub-model corresponds to N tasks one by one, the order obtained by sorting the N tasks from difficult to easy according to their difficulty is: task 1 < task 2 < task 3 < ... < task N. Accordingly, according to the processing accuracy of the N sub-models, the N sub-models are sorted from small to large to obtain a second sorting result: the first sub-model < the second sub-model < the third sub-model < ... < the Nth sub-model; if the modulus length of the N gradient vectors corresponding to the i-th sample data in the second data set in the specified direction || V i,N ||>…>||V i,3 ||>||V i,2 ||>||V i,1 ||, sorting from large to small, and the third sorting result obtained is: the 1st submodel < the 2nd submodel < the 3rd submodel < ... < the Nth submodel; the second sorting result is consistent with the third sorting result corresponding to the ith data sample, and the ith sample data is retained; if the N submodels are sorted from small to large according to the size of the modulus of the N gradient vectors corresponding to the jth sample data in the second data set in the specified direction, the third sorting result obtained is: the 2nd submodel < the 1st submodel < the 3rd submodel < ... < the Nth submodel; in the second sorting result and the third sorting result, the positions of the 1st submodel and the 2nd submodel are different, that is, the second sorting result and the third sorting result are inconsistent, and the jth sample data is eliminated; continue to screen in the second data set in the above manner to obtain a second training set.
[0096] In the embodiment of the present disclosure, a second training set for model training is obtained by screening from the second data set according to the processing accuracy of each sub-model and the multiple modulus lengths of multiple gradient vectors corresponding to each sample data in a specified direction. Each sample data in the second training set takes into account the difficulty of the tasks corresponding to each sub-model, thereby ensuring that each screened sample data can accelerate convergence on more difficult tasks and slow down convergence on less difficult tasks, so that when the multi-task model obtained according to the second training set executes multiple tasks, each task can reach the optimal state at the same time.
[0097] In summary, the second method of the sample data screening method provided by the embodiment of the present disclosure can screen sample data with different task difficulties from the sample data set as the second training set according to the task difficulty. Each sample data in the second training set can accelerate the convergence on the more difficult task and slow down the convergence on the less difficult task, so that multiple tasks can reach the optimal state at the same time in the multi-task model.
[0098] For example, an evaluation parameter of each sample data, a processing accuracy of multiple sub-models, and a modulus of multiple gradient vectors corresponding to each sample data in a specified direction are determined, and multiple sample data are sorted according to the evaluation parameter of each sample data to obtain a sorting result, and a first training set d1 is obtained by screening from the sample data set d according to the first sorting result, and the remaining sample data in the sample data set d except the first training set d1 is used as the second data set d2, and the multiple sub-models are sorted from small to large according to the processing accuracy of each sub-model to obtain a second sorting result, and the multiple sub-models are sorted from large to small according to the modulus of multiple gradient vectors corresponding to each sample data in a specified direction to obtain a third sorting result, and sample data having the same second sorting result and third sorting result are screened out from the second data set d2 to obtain a second training set d3, and d1 and d3 are merged into a training data set Ø.
[0099] In the disclosed embodiment, multiple sample data with large sample gain are screened out from the sample data set according to the evaluation parameters to obtain a first training set, and then multiple sample data are screened out from other sample data in the sample data set except the first training set according to the difficulty of the task to obtain a second training set, and the sample data in the first training set and the second training set screened twice are used as training data sets for multi-task model training. The training data set can take into account the gain of the sample data and the convergence speed of multiple tasks, so that multiple tasks can converge synchronously in the multi-task model, and the training data set also takes into account the difficulty of each task, so that multiple tasks can reach the optimal value at the same time in the multi-task model. And screening according to the evaluation parameters and the difficulty of the task at the same time increases the diversity of the sample data in the training data set, thereby improving the generalization of the model. And multiple tasks are interrelated, and can share information in the multi-task model and complement each other, thereby improving each other's performance.
[0100] like Figure 7 As shown, the above sample data screening method is illustrated below with a complete implementation method: A. Obtain multiple sample data for multi-task training to form a sample data set d.
[0101] B. Determine the evaluation parameters of each sample data, and determine the sample data with positive evaluation parameters as positive samples, remove the negative samples in the sample data set d, and obtain multiple positive samples as the data set d`.
[0102] C. Sort the positive samples from large to small according to the size of the evaluation parameter to obtain a first sorting result, and filter and sort the top N positive samples from the data set d` according to the first sorting result to obtain a first training set d1, and determine the positive samples in the data set d` except the first training set d1 as the second data set d2.
[0103] D. Sort the multiple sub-models from small to large according to the processing accuracy of the sub-models to obtain a second sorting result. Sort the multiple sub-models from large to small according to the sizes of the multiple module lengths of the multiple gradient vectors in the specified direction corresponding to each sample data to obtain a third sorting result. Filter out M sample data with consistent second and third sorting results from the second data set to obtain a second training set d3.
[0104] E. Combine d1 and d3 to obtain the training data set Ø, which includes N+M positive sample data.
[0105] In summary, through the first sorting result, some sample data that take into account the gain value and convergence value of the sample data, that is, N positive samples, are selected from the sample data set. The N positive sample data not only ensures a large positive gain for multi-task learning, but also enables multiple tasks to have a consistent convergence speed on the sample data; by randomly selecting data to train a multi-task processing model with a certain recognition ability, and freezing the parameters of its shared parameter layer and exclusive parameter layer, it is ensured that the gradient vector used for the evaluation parameter calculation of each sample data is calculated on the same basis, thereby avoiding the gradient influence between each sample data; according to the second sorting result and the third sorting result, M sample data that meet the second sorting result and the third sorting result are selected from the remaining sample data in the sample data set. The M sample data can accelerate convergence on more difficult tasks and slow down convergence on less difficult tasks, ensuring that each task can reach the optimal at the same time, and increasing the diversity of data, thereby improving the generalization of the multi-task model.
[0106] In summary, the sample data screening method provided by the embodiment of the present disclosure can select sample data with diversity, good comprehensive gain performance on multiple tasks, and taking into account the difficulty of different tasks from the sample data set, and greatly reduces the amount of data in the training data set used for multi-task model training, while improving the performance of the multi-task model and reducing the training time. Starting from the sample data, there is no need to change the loss function or network structure of the multi-task model, ensuring that the multi-task model is not limited by the task scenario and has good versatility.
[0107] In a feasible implementation, the training data set may be obtained by the above-mentioned sample data screening method; The model is trained according to the training data set to obtain a multi-task model.
[0108] It is worth noting that the multi-task model can be a new model trained from scratch based on the training data set, or it can be a model obtained by continuing to train the first model after unfreezing the training data set, so as to avoid other data samples except the training data set affecting the multi-task processing model. It is preferred to use a new model trained from scratch based on the training data set as the multi-task model, thereby improving the reliability of the multi-task model and the accuracy of the recognition results.
[0109] For example, Figure 8 As shown, in the case where the multi-task includes identifying the breed of a dog and identifying the breed of a cat, the model is trained according to the training data set, and the parameter sharing layer of the obtained multi-task model is a shared hidden layer, and the parameter exclusive layer includes the hidden layer of the dog and the hidden layer of the cat; multiple images of cats and multiple images of dogs are input into the multi-task model, and the multi-task model outputs the breed of the dog and the breed of the cat.
[0110] In the disclosed embodiment, the training data set obtained by the above-mentioned sample data screening method can take into account the gain of sample data, the convergence speed of multiple tasks and the difficulty of each task, so that multiple tasks can converge synchronously in the multi-task model trained according to the training data set, and can reach the optimum at the same time. The performance of the multi-task model is improved from five aspects: the size of sample gain, the consistency of convergence speed, the difficulty of each task, data diversity and the reduction of training data volume. And there is no need to improve the network structure and loss function of the multi-task model, so as to avoid the multi-task model being restricted by a specific task scenario, thereby improving the versatility and reliability of multi-task learning.
[0111] Based on the same inventive concept, see Fig. 9 The present disclosure also provides a sample data screening device, which includes a determination module 901, a first execution module 902 and a second execution module 903.
[0112] Among them, the determination module 901 is configured to input each sample data in the sample data set into the first model, process each sample data through multiple sub-models in the first model, and output multiple gradient vectors corresponding to each sample data, with one sub-model outputting one gradient vector.
[0113] The first execution module 902 is configured to determine the evaluation parameters of each piece of sample data according to the module lengths of multiple gradient vectors corresponding to each piece of sample data in a specified direction, and the evaluation parameters are used to evaluate the training indicators of the sample data in each sub-model.
[0114] The second execution module 903 is configured to sort the sample data of the sample data set according to the evaluation parameter of each sample data, and obtain a first training set for model training according to the sorting result.
[0115] In the embodiment of the present disclosure, each sample data in the sample data set is input into the first model, and the first model outputs multiple gradient vectors corresponding to each sample data. According to the modulus length of the multiple gradient vectors corresponding to the sample data in the specified direction, the evaluation parameter corresponding to the sample data that can be used to evaluate the training index of the sample data in each sub-model is determined. In this way, for multiple sample data, the sample data in the sample data set are sorted according to the evaluation parameters corresponding to each sample data, and the sample data with good training effects on multiple sub-models can be screened from the sample data set according to the sorting results to obtain a training set. In addition, the technical solution disclosed in the present disclosure is not limited by specific scenarios and has universality. For models with different types of sub-models, the technical solution can be used to screen samples. In addition, sample data with large interference or invalid for model training are eliminated during the screening process, which greatly reduces the data volume of the training set, and can reduce the training time of the multi-task model while improving the performance of the multi-task model.
[0116] Optionally, the first execution module 902 is configured to determine the gain value and / or convergence value of the sample data on the multiple sub-models according to the modulus lengths of the multiple gradient vectors corresponding to each sample data in the specified direction; An evaluation parameter of the piece of sample data is determined according to the gain value and / or the convergence value.
[0117] Optionally, the first execution module 902 is configured to determine, for each piece of sample data, an average vector of multiple gradient vectors corresponding to the sample data, and map the multiple gradient vectors to the vector direction where the average vector is located, to obtain the modulus of the multiple gradient vectors in the vector direction where the average vector is located, wherein the modulus corresponding to the gradient vector whose angle with the average vector is greater than 90 degrees is a negative value, and the modulus corresponding to the gradient vector whose angle with the average vector is less than or equal to 90 degrees is a value greater than or equal to 0.
[0118] Optionally, the first execution module 902 is configured to obtain gain values of the sample data on the multiple sub-models according to the modulus lengths of the multiple gradient vectors in the vector direction where the average vector is located; and / or, According to the maximum modulus and the minimum modulus of multiple gradient vectors in the vector direction where the average vector is located, the convergence value of the sample data on multiple sub-models is obtained; An evaluation parameter of the piece of sample data is determined according to the gain value and / or the convergence value.
[0119] Optionally, the second execution module 903 is configured to sort each piece of the sample data according to the descending order of the evaluation parameter of each piece of the sample data to obtain a first sorting result; According to the first sorting result, first N pieces of sample data are screened from the sample data set to obtain a first training set for model training, wherein the N pieces of sample data are positive values.
[0120] Optionally, the determination module 901 is configured to freeze model parameters of the first model.
[0121] Optionally, the second execution module 903 is configured to determine the processing accuracy of multiple sub-models in the first model, and the processing accuracy is used to characterize the training difficulty of the corresponding sub-model; Sorting the multiple sub-models according to the ascending order of the processing accuracy to obtain a second sorting result; Sorting the multiple sub-models according to the descending order of the modulus lengths of the multiple gradient vectors corresponding to each piece of the sample data in the specified direction to obtain a third sorting result; Sample data whose second sorting result and the third sorting result are consistent are screened out from the second data set to obtain a second training set, wherein the sample data set includes the first training set and the second data set, and the evaluation parameter corresponding to each sample data in the second training set is a positive value.
[0122] Regarding the sample data screening device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0123] Based on the same inventive concept, the present disclosure also provides an electronic device, including: a memory having a computer program stored thereon; The processor is used to execute the computer program in the memory to implement the above-mentioned sample data screening method.
[0124] In the embodiment of the present disclosure, each sample data in the sample data set is input into the first model, and the first model outputs multiple gradient vectors corresponding to each sample data. According to the modulus length of the multiple gradient vectors corresponding to the sample data in the specified direction, the evaluation parameter corresponding to the sample data that can be used to evaluate the training index of the sample data in each sub-model is determined. In this way, for multiple sample data, the sample data in the sample data set are sorted according to the evaluation parameters corresponding to each sample data, and the sample data with good training effects on multiple sub-models can be screened from the sample data set according to the sorting results to obtain a training set. In addition, the technical solution disclosed in the present disclosure is not limited by specific scenarios and has universality. For models with different types of sub-models, the technical solution can be used to screen samples. In addition, sample data with large interference or invalid for model training are eliminated during the screening process, which greatly reduces the data volume of the training set, and can reduce the training time of the multi-task model while improving the performance of the multi-task model.
[0125] Fig.10 FIG. 1 is a block diagram of an electronic device 1000 according to an exemplary embodiment. Fig.10 As shown, the electronic device 1000 may include: a processor 1001 , a memory 1002 . The electronic device 1000 may also include one or more of a multimedia component 1003 , an input / output (I / O) interface 1004 , and a communication component 1005 .
[0126] The processor 1001 is used to control the overall operation of the electronic device 1000 to complete all or part of the steps in the above-mentioned sample data screening method. The memory 1002 is used to store various types of data to support the operation of the electronic device 1000, and these data may include, for example, instructions for any application or method operating on the electronic device 1000, and application-related data, such as contact data, sent and received messages, pictures, audio, video sample data, multiple gradient vectors corresponding to each sample data, and evaluation parameters of each sample data, etc. The memory 1002 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 1003 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 1002 or sent via the communication component 1005. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 1004 provides an interface between the processor 1001 and other interface modules, and the above-mentioned other interface modules can be keyboards, mice, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 1005 is used for wired or wireless communication between the electronic device 1000 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 1005 can include: Wi-Fi module, Bluetooth module, NFC module.
[0127] In an exemplary embodiment, the electronic device 1000 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned sample data screening method.
[0128] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the above-mentioned sample data screening method is implemented. For example, the computer-readable storage medium can be the above-mentioned memory 1002 including program instructions, and the above-mentioned program instructions can be executed by the processor 1001 of the electronic device 1000 to complete the above-mentioned sample data screening method.
[0129] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0130] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0131] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A sample data screening method, characterized in that: include: Input each sample data in the sample data set into the first model, process each sample data through multiple sub-models in the first model, and output multiple gradient vectors corresponding to each sample data, where each sub-model outputs one gradient vector; Determine evaluation parameters of each piece of sample data according to the moduli of the plurality of gradient vectors corresponding to each piece of sample data in a specified direction, wherein the evaluation parameters are used to evaluate the training index of the sample data in each of the sub-models; The sample data of the sample data set are sorted according to the evaluation parameter of each piece of the sample data, and a first training set for model training is obtained according to the sorting result.
2. The sample data screening method according to claim 1, characterized in that: The step of determining the evaluation parameter of each piece of sample data according to the modulus lengths of the plurality of gradient vectors corresponding to each piece of sample data in a specified direction comprises: Determining gain values and / or convergence values of the sample data on the multiple sub-models according to the modulus lengths of the multiple gradient vectors corresponding to each piece of the sample data in a specified direction; An evaluation parameter of the piece of sample data is determined according to the gain value and / or the convergence value.
3. The sample data screening method according to claim 2, characterized in that: The modulus of the plurality of gradient vectors corresponding to each piece of sample data in a specified direction is determined in the following manner: For each piece of sample data, an average vector of the multiple gradient vectors corresponding to the sample data is determined, and the multiple gradient vectors are mapped to a vector direction where the average vector is located, to obtain a modulus of the multiple gradient vectors in the vector direction where the average vector is located, wherein a modulus corresponding to a gradient vector whose angle with the average vector is greater than 90 degrees is a negative value, and a modulus corresponding to a gradient vector whose angle with the average vector is less than or equal to 90 degrees is a value greater than or equal to 0.
4. The sample data screening method according to claim 3, characterized in that: The step of determining the evaluation parameter of each piece of sample data according to the modulus lengths of the plurality of gradient vectors corresponding to each piece of sample data in a specified direction comprises: Obtaining gain values of the sample data on the plurality of sub-models according to the moduli of the plurality of gradient vectors in the vector direction where the average vector is located; and / or, Obtaining convergence values of the sample data on the plurality of sub-models according to the maximum modulus and the minimum modulus of the plurality of gradient vectors in the vector direction where the average vector is located; An evaluation parameter of the piece of sample data is determined according to the gain value and / or the convergence value.
5. The sample data screening method according to any one of claims 1 to 4, characterized in that: The step of sorting the sample data of the sample data set according to the evaluation parameter of each piece of the sample data, and obtaining a first training set for model training according to the sorting result, comprises: Sorting each piece of the sample data according to the descending order of the evaluation parameter of each piece of the sample data to obtain a first sorting result; According to the first sorting result, first N pieces of sample data are screened from the sample data set to obtain a first training set for model training, wherein the N pieces of sample data are positive values.
6. The sample data screening method according to any one of claims 1 to 4, characterized in that: Before each sample data in the sample data set is input into the first model, the method includes: The model parameters of the first model are frozen.
7. The sample data screening method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determine the processing accuracy of multiple sub-models in the first model, where the processing accuracy is used to characterize the training difficulty of the corresponding sub-models; Sorting the multiple sub-models according to the ascending order of the processing accuracy to obtain a second sorting result; Sorting the multiple sub-models according to the descending order of the modulus lengths of the multiple gradient vectors corresponding to each piece of the sample data in the specified direction to obtain a third sorting result; Sample data whose second sorting result and the third sorting result are consistent are screened out from the second data set to obtain a second training set, wherein the sample data set includes the first training set and the second data set, and the evaluation parameter corresponding to each sample data in the second training set is a positive value.
8. A sample data screening device, characterized in that: include: A determination module is configured to input each sample data in the sample data set into a first model, process each sample data through a plurality of sub-models in the first model, and output a plurality of gradient vectors corresponding to each sample data, wherein each sub-model outputs one gradient vector; A first execution module is configured to determine an evaluation parameter of each piece of sample data according to the modulus of the plurality of gradient vectors corresponding to each piece of sample data in a specified direction, wherein the evaluation parameter is used to evaluate the training index of the sample data in each of the sub-models; The second execution module is configured to sort the sample data of the sample data set according to the evaluation parameter of each piece of the sample data, and obtain a first training set for model training according to the sorting result.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Edge model updating method and system
CN121458630A
Method suitable for character behavior analysis based on multi-modal training model
CN121708648A