Data processing method, device, storage medium and computer equipment
By performing compensation processing and multi-order derivation of the loss function of the logistic regression model, efficient iterative updating of the parameters of the logistic regression model is achieved, which solves the problem of low training efficiency under large data volumes and improves the model training speed.
Patent Information
- Application Number
- CN202110069802.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-19
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-01-19
AI Technical Summary
In the field of machine learning, when the logistic regression model has a large amount of training sample data, the model parameter calculation efficiency is low, resulting in low training efficiency.
By compensating the model parameters in the loss function of the logistic regression model, performing multi-order derivation and iterative updates until the model parameters converge, the iterative update efficiency of the model parameters is improved.
It improves data processing efficiency and model training speed, and solves the problem of low training efficiency of logistic regression models under large amounts of data.
Smart Images

Figure CN112990958B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and in particular to a data processing method, device, storage medium and computer equipment. Background Art
[0002] Machine learning is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. It is the core of artificial intelligence and the fundamental way to make computers intelligent.
[0003] In the field of machine learning, logistic regression models play a very important role. Logistic regression models are widely used in data mining, automatic disease diagnosis, economic forecasting and other fields.
[0004] In the prior art, when the amount of training sample data is large, the efficiency of calculating the model parameters of the logistic regression model is low. Summary of the invention
[0005] The embodiments of the present invention provide a data processing method, apparatus, storage medium and computer equipment. The method can perform multi-stage iterative training on a model, thereby improving the efficiency of data processing and further improving the training efficiency of the model.
[0006] The first aspect of the present application provides a data processing method, comprising:
[0007] Obtain training sample data;
[0008] Inputting the training sample data into a preset model, and performing compensation processing on a first model parameter in a loss function of the preset model to obtain a target loss function after compensation processing;
[0009] Performing multi-order derivation processing on the objective loss function, and updating the first model parameters according to the results of the multi-order derivation to obtain second model parameters;
[0010] The first model parameters are updated based on the second model parameters, and the compensation processing of the first model parameters in the loss function of the preset model is returned to obtain the target loss function after compensation and perform iterative training until the first model parameters converge.
[0011] Accordingly, a second aspect of an embodiment of the present invention provides a data processing device, including:
[0012] An acquisition unit, used for acquiring training sample data;
[0013] A compensation unit, used for inputting the training sample data into a preset model, and performing compensation processing on a first model parameter in a loss function of the preset model to obtain a target loss function after compensation processing;
[0014] An updating unit, configured to perform multi-order derivation processing on the objective loss function, and update the first model parameters according to the results of the multi-order derivation to obtain second model parameters;
[0015] A training unit is used to update the first model parameters based on the second model parameters, and return to perform compensation processing on the first model parameters in the loss function of the preset model, obtain the target loss function after compensation processing and perform iterative training until the first model parameters converge.
[0016] In some embodiments, the compensation unit comprises:
[0017] A first determining subunit, used to determine the loss function of the preset model according to the training sample data;
[0018] An acquisition subunit, used to acquire a weight constraint of a first model parameter of the preset model;
[0019] A compensation subunit is used to compensate the first model parameter in the loss function according to the weight constraint.
[0020] In some embodiments, the acquisition subunit includes:
[0021] An acquisition module, used for acquiring an expected contribution of a first model parameter in the preset model to the preset model;
[0022] The first determination module is used to determine the weight constraint of the first model parameter of the preset model according to the expected contribution.
[0023] In some embodiments, the first determining subunit includes:
[0024] A preprocessing module, used for preprocessing the training sample data to obtain target training sample data;
[0025] The second determination module is used to determine the loss function of the preset model according to the target training sample data.
[0026] In some embodiments, the updating unit comprises:
[0027] A first calculation subunit, used to calculate the first-order derivative matrix and the second-order derivative matrix of the target loss function;
[0028] A second determining subunit, configured to determine a model parameter updating rule of the preset model according to the first-order derivative matrix, the second-order derivative matrix and the first model parameter;
[0029] The operator unit is used to perform operations based on the model parameter update rule to obtain the second model parameters after the operation.
[0030] In some embodiments, the training unit comprises:
[0031] A first training subunit is used to update the first model parameter in the loss function according to the value of the second model parameter, and return to perform compensation processing on the first model parameter in the loss function of the preset model to obtain a target loss function after compensation processing and perform iterative training;
[0032] A statistics subunit, used to count the number of iterative training after each iterative training;
[0033] The third determining subunit is used to determine that the current first model parameters are model parameters of the preset model when the number of iterative training times reaches a preset number.
[0034] In some embodiments, the training unit comprises:
[0035] A second training subunit updates the first model parameter in the loss function according to the value of the second model parameter, and returns to perform compensation processing on the first model parameter in the loss function of the preset model to obtain a target loss function after compensation processing and perform iterative training;
[0036] A second calculation subunit is used to calculate the absolute value of the difference between the current first model parameter and the first model parameter before the current update after each update of the first model parameter;
[0037] The fourth determining subunit determines that the current first model parameter is a model parameter of the preset model when the absolute value of the difference is less than a preset value.
[0038] A third aspect of the embodiments of the present application provides a method for predicting permissions, the method comprising:
[0039] Receiving user request information, wherein the user request information includes user data authorized by the user;
[0040] Inputting the user data into a trained preset model, wherein the model parameters of the preset model are obtained by training using the data processing method provided by the first aspect;
[0041] The output result of the trained preset model is determined as the user's authority.
[0042] The fourth aspect of the embodiment of the present application also provides a storage medium, which stores multiple instructions, and the instructions are suitable for loading by a processor to execute the steps in the data processing method provided in the first aspect of the present application.
[0043] A fifth aspect of an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the data processing method provided in the first aspect of the present application when executing the computer program.
[0044] In a sixth aspect, the present application provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a storage medium. A processor of a computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the data processing method provided in the first aspect.
[0045] The data processing method provided in the embodiment of the present application is obtained by obtaining training sample data; inputting the training sample data into a preset model, and compensating the first model parameter in the loss function of the preset model to obtain the target loss function after compensation; performing multi-order derivative processing on the target loss function, and updating the first model parameter according to the result of the multi-order derivative to obtain the second model parameter; updating the first model parameter based on the second model parameter, and returning to perform compensation processing on the first model parameter in the loss function of the preset model, obtaining the target loss function after compensation and performing iterative training until the first model parameter converges. In this way, by compensating the model parameters in the model loss function, the model parameters can be updated in multiple orders of iterations, thereby improving the efficiency of iterative updating of the model parameters. That is, the data processing efficiency is improved, thereby improving the speed of model training. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0047] Figure 1 It is a schematic diagram of the data processing scenario provided by this application;
[0048] Figure 2 It is a flowchart of the data processing method provided by this application;
[0049] Figure 3is another flow chart of the data processing method provided by the present application;
[0050] Figure 4 It is a structural schematic diagram of a data processing device provided by the present application;
[0051] Figure 5 is another structural schematic diagram of the data processing device provided by the present application;
[0052] Figure 6 is another structural schematic diagram of the data processing device provided by the present application;
[0053] Figure 7 It is a structural schematic diagram of the computer device provided by this application. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0055] The embodiments of the present invention provide a data processing method, device, storage medium and computer equipment. The data processing method can be used in a data processing device. The data processing device can be integrated in a computer device, and the computer device can be a terminal with a data processing function. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart watch, etc., but is not limited to this. The computer device can also be a server, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0056] See also Figure 1, which is a schematic diagram of the data processing scenario provided in the present application; as shown in the figure, after the computer device obtains the training sample data, it inputs the training sample data into the preset model, and determines the loss function of the preset model based on the training sample data input into the preset model. After determining the loss function of the preset model, the model parameters in the loss function are compensated to obtain the target loss function. The computer device further performs multi-order derivatives on the target loss function, updates the model parameters based on the derivative results, and then returns to repeat the aforementioned compensation and update steps, and continuously updates the model parameters of the preset model until the model parameters of the preset model converge, thereby obtaining the model parameters of the preset model.
[0057] It should be noted that Figure 1 The data processing scenario diagram shown is only an example. The data processing scenario described in the embodiment of the present application is to more clearly illustrate the technical solution of the present application and does not constitute a limitation on the technical solution provided by the present application. It is known to those skilled in the art that with the evolution of data processing and the emergence of new business scenarios, the technical solution provided by the present application is also applicable to similar technical problems.
[0058] Based on the above implementation scenarios, detailed descriptions are given below.
[0059] The embodiments of the present application will be described from the perspective of a data processing device, which can be integrated into a computer device. The computer device can be a terminal or a server, and the present application does not limit this. Figure 2 FIG. 1 is a flow chart of a data processing method provided by the present application, and the method comprises:
[0060] Step 101, obtaining training sample data.
[0061] The training sample data may be obtained from a memory connected to the data processing device or from other data storage terminals. The training sample data may be obtained from the memory of a physical terminal or from a virtual storage space such as a cloud disk. In some embodiments, the training sample data may be obtained from one storage location or from multiple storage locations. For example, the training sample data may be stored on a blockchain, and the data processing device obtains the training sample data from the blockchain. The data processing device may centrally obtain the training sample data in a time period in response to a training sample data acquisition instruction, or may continuously obtain the training sample data according to a data acquisition logic.
[0062] The training sample data includes input sample data and output sample data (or label data) corresponding to the input sample data. The input sample data may be image data, speech data, text data, etc. When the input sample data is image data, the corresponding output sample data may be image description text data (e.g., a bird flying in the sky), or image classification data (a dog or a cat in the image), etc. It is understandable that different model training results will be obtained when the training sample data includes different input sample data and corresponding output sample data.
[0063] Step 102: input the training sample data into a preset model, and perform compensation processing on the first model parameter in the loss function of the preset model to obtain a target loss function after compensation processing.
[0064] Among them, the data processing device inputs the acquired training sample data into the preset model and performs model training on the preset model according to the training sample data. The preset model can be a logistic regression model. For the logistic regression model, the loss function (or cost function) of the model parameters can be used to show the degree of fit of the model. Generally, the smaller the value of the loss function, the better the degree of fit of the model. Further, in order to prevent the model from overfitting, an L2 regularization term is added to the loss function. In the related art, the model parameters corresponding to the best model fitting effect are solved by solving the minimum value of the loss function, and the method for solving the minimum value of the loss function is to iteratively solve by the gradient descent method until the model parameters converge and determine the model parameters at the time of convergence as the model parameters of the preset model. However, it is necessary to determine a suitable step size first when using the gradient descent method for iterative solution. If the step size is too large, the fitting effect will be poor, and if the step size is too small, the number of iterations will be too many, affecting the calculation efficiency of the model parameters.
[0065] In the embodiment of the present application, the inventor of the present application found through research that the gradient descent method is used in the prior art to iteratively solve the minimum value of the loss function, which not only has the disadvantage of difficult step size selection, but also because the step size of the gradient descent method is fixed, and the gradient descent is performed using a first-order iteration method, and its iterative solution efficiency is low. Therefore, the inventor of the present application proposes a multi-order iteration method to solve the loss function, and the multi-order iteration method can be a second-order iteration method, or a multi-order iteration method such as a third-order iteration method. In the embodiment of the present application, taking the second-order iteration as an example, in the iterative training process, the singular problem of the second-order derivative matrix (Hayssian matrix) of the loss function will be involved. When the Hessian matrix is a singular matrix, it will cause the model parameters to be unable to be iteratively updated. To solve the above problem, the inventor of the present application proposes to compensate the first model parameter in the model loss function, and specifically, a compensation factor can be added to the first model parameter of the loss function to obtain the compensated target loss function. Since the compensation factor of the first model parameter is added to the loss function, it can be ensured that the second-order matrix (i.e., the Hessian matrix) of the loss function is not a singular matrix, which can ensure that the update of the model parameters can be carried out normally. It can be understood that the first in the first model parameter here is only to distinguish it from the model parameter updated below, and does not limit the number of model parameters. The first model parameter may include multiple sub-model parameters, and compensating the first model parameter means compensating the multiple sub-model parameters included in the first model parameter respectively.
[0066] In some embodiments, compensating a first model parameter in a loss function of a preset model includes:
[0067] 1. Determine the loss function of the preset model based on the training sample data;
[0068] 2. Obtain the weight constraint of the first model parameter of the preset model;
[0069] 3. Compensate the first model parameter in the loss function according to the weight constraint.
[0070] Among them, the loss function of the preset model here is a loss function with an L2 regularization term added, and the weight constraint of the first model parameter of the preset model includes the weight constraint of each sub-model parameter contained in the first model parameter. The weight constraint of each sub-model parameter can be pre-set or obtained by the data processing device based on statistical results. After obtaining the weight constraint of each sub-model parameter, the first model parameter in the loss function is compensated using the weight constraint to obtain a new loss function, which is referred to as the target loss function here. The weight constraint here can be understood as a constraint parameter that controls the influence of the model parameter on the model.
[0071] In some embodiments, obtaining a weight constraint of a first model parameter of a preset model includes:
[0072] a. Obtaining the expected contribution of the first model parameter in the preset model to the preset model;
[0073] b. Determine the weight constraint of the first model parameter of the preset model according to the expected contribution.
[0074] Among them, a specific example is used to illustrate the meaning of the expected contribution of model parameters to the model. Taking a house price estimation model as an example, the input data includes the city where the house is located, the area where the house is located, the degree included in the house, the traffic near the house, the business district and supporting facilities near the house, the floor of the house, the direction of the house, and the area of the house, etc., and the output data is the price of the house. It can be understood that in this model, the city where the house is located, the area where the house is located, the degree included in the house, the traffic near the house, the business district and supporting facilities near the house, the floor of the house, the direction of the house, and the area of the house are independent variables, and the price of the house is the dependent variable. The model is trained according to the obtained training sample data, that is, the coefficients of these independent variables are determined, and the coefficients can be called the model parameters of the house price estimation model. However, since the obtained training sample data is historical data, and the house price is affected by market factors and policy factors, the impact of each independent variable on the house price will change. For example, if the city where the house is located has a greater impact on the house price, while the traffic near the house has a lower impact on the house price, then in order to make the house price estimation result of the trained model more accurate, it is necessary to control the model parameters corresponding to the city where the house is located to increase the expected contribution of the model, while the model parameters corresponding to the traffic near the house to reduce the expected contribution of the model. Furthermore, after obtaining the expected contribution of the first model parameter to the preset model, the weight constraint of the first model parameter of the preset model is determined according to the expected contribution. Specifically, when it is necessary to control the expected contribution of a sub-model parameter to the model to increase, the weight constraint corresponding to the sub-model parameter can be set to be less than 1. When it is necessary to control the expected contribution of a sub-model parameter to the model to decrease, the weight constraint corresponding to the sub-model parameter can be set to be greater than 1.
[0075] Furthermore, in some embodiments, obtaining the expected contribution of the first model parameter in the preset model to the preset model may be obtaining the expected contribution of each sub-model parameter input manually to the preset model. It may also be the expected contribution of each sub-model parameter to the preset model determined by the data processing device after dynamically evaluating the importance of each sub-model parameter.
[0076] In some embodiments, determining the loss function of a preset model according to the training sample data includes:
[0077] Preprocessing the training sample data to obtain target training sample data;
[0078] Determine the loss function of the preset model based on the target training sample data.
[0079] The training sample data is preprocessed, including but not limited to data cleaning of the training sample data, such as removing abnormal values and missing values contained in the training sample data, and standardizing the training sample data. After the training sample data is preprocessed, target training sample data is obtained. The target training sample data is then input into a preset model for model training, and the loss function of the preset model is determined based on the target training sample data.
[0080] Step 103, performing multi-order derivative processing on the target loss function, and updating the first model parameters according to the results of the multi-order derivative processing to obtain the second model parameters.
[0081] Among them, as described above, in the embodiment of the present application, the inventor proposes a method for solving the model parameters corresponding to the minimum value of the loss function by multi-order iteration. Taking the second-order iteration as an example, since the model parameters in the loss function are compensated, the Hessian matrix obtained by the second-order derivative of the loss function is non-singular, thereby ensuring that the second-order iterative update of the model parameters can be carried out stably.
[0082] In some embodiments, performing multi-order derivation on the target loss function, and updating the first model parameter according to the result of the multi-order derivation to obtain the second model parameter, includes:
[0083] 1. Calculate the first-order derivative matrix and the second-order derivative matrix of the target loss function;
[0084] 2. Determine a model parameter update rule of the preset model according to the first-order derivative matrix, the second-order derivative matrix and the first model parameter;
[0085] 3. Perform calculations based on the model parameter update rules to obtain the calculated second model parameters.
[0086] Among them, after the first model parameter in the loss function is compensated and the target loss function after compensation is obtained, the target loss function can be solved by second-order iteration or even third-order iteration. Since the higher the iteration order, the more difficult it is to solve the multi-order matrix, which will affect the solution efficiency. Therefore, the inventors of the present application have found through research that the second-order iterative solution method can achieve the best solution efficiency in practical applications. Therefore, in an embodiment of the present application, after obtaining the target loss function, the first-order derivative matrix and the second-order derivative matrix of the target loss function are calculated, and the model parameter update rule of the preset model is determined according to the first-order derivative matrix, the second-order derivative matrix and the first model parameter, and then the first model parameter is further updated according to the model parameter update rule to obtain the updated second model parameter. Here, the second model parameter is only used to distinguish it from the first model parameter before the update, and does not limit the number of model parameters. It can be understood that the second model parameter also includes the same number of sub-model parameters as the first model parameter.
[0087] In some embodiments, determining a preset model parameter update rule according to the first-order derivative matrix, the second-order derivative matrix, and the first model parameter includes:
[0088] 1.1. Calculate the ratio of the first-order derivative matrix to the second-order derivative matrix;
[0089] 1.2. Determine the model parameter update rule of the preset model parameter by calculating the difference between the first model parameter and the ratio.
[0090] Among them, in some embodiments, the second-order iterative method can use Newton's iteration method for iterative solution. Newton's iteration method is a method proposed by Newton in the 17th century to approximately solve equations in the real number domain and the complex number domain. The core iteration method of Newton's iteration method is: first determine the ratio of the function value of the function to be solved at the function solution before the update to the partial derivative of the function at this point, and the updated function solution is equal to the difference between the function solution before the update and the ratio. And to solve the minimum value of the target loss function, that is, to solve the function value when the first-order derivative function of the target loss function is equal to 0, the Newton iteration method can be used to solve the problem of the function value when the first-order derivative function of the target loss function is equal to 0. Further, it can be derived that the update rule of the model parameters of the preset model is: the difference between the first model parameter and the ratio of the first-order derivative matrix and the second-order derivative matrix is determined as the second model parameter.
[0091] Step 104, update the first model parameters based on the second model parameters, and return to perform compensation processing on the first model parameters in the loss function of the preset model, obtain the target loss function after compensation processing and perform iterative training until the first model parameters converge.
[0092] After the first model parameter is updated to obtain the second model parameter, the first model parameter is updated based on the second model parameter. The updated first model parameter is substituted into the target loss function and then steps 102 and 103 are repeated to continuously compensate the updated first model parameter to obtain a new target loss function, and then the new target loss function is multi-order derived and the updated first model parameter is updated again according to the multi-order derivative result, so as to realize continuous iterative update of the first model parameter until the first model parameter converges.
[0093] In some embodiments, updating the first model parameters based on the second model parameters, and returning to perform compensation processing on the first model parameters in the loss function of the preset model, obtaining the target loss function after compensation processing and performing iterative training until the first model parameters converge, includes:
[0094] 1. Update the first model parameter in the loss function according to the value of the second model parameter, and return to perform compensation processing on the first model parameter in the loss function of the preset model to obtain the target loss function after compensation and perform iterative training;
[0095] 2. Count the number of iterative training after each iterative training;
[0096] 3. When the number of iterative training reaches a preset number, determine that the current first model parameters are model parameters of the preset model.
[0097] Among them, in this embodiment, a target number of iterative training can be pre-set. After each iterative training, the number of iterative trainings that have been performed is counted, and the counted number is compared with the target number. When the counted number reaches the preset target number, the current first model parameter is determined to be the model parameter of the preset model. In this way, for some models with low requirements on the accuracy of model parameters, the number of iterative trainings can be set so that the model training converges as soon as possible, thereby improving the efficiency of model training.
[0098] In some embodiments, updating the first model parameters based on the second model parameters, and returning to perform compensation processing on the first model parameters in the loss function of the preset model, obtaining the target loss function after compensation processing and performing iterative training until the first model parameters converge, includes:
[0099] a. Update the first model parameter in the loss function according to the value of the second model parameter, and return to perform compensation processing on the first model parameter in the loss function of the preset model, obtain the target loss function after compensation processing and perform iterative training;
[0100] b. after each update of the first model parameter, calculating the absolute value of the difference between the current first model parameter and the first model parameter before the current update;
[0101] c. When the absolute value of the difference is less than the preset value, determine that the current first model parameter is the model parameter of the preset model.
[0102] Among them, in this embodiment, after each update of the first model parameter, an error calculation is performed on each sub-model parameter in the first model parameter before and after the update, and the error calculation here is to calculate the absolute value of the difference between each sub-model parameter before and after the update. When the absolute value of the difference between each sub-model parameter is less than a preset threshold, it can be determined that the model parameters have converged and the model training is completed. At this time, the first model parameter after the last update is determined to be the model parameter of the preset model. In this way, for models with high requirements for model parameter accuracy, model training can be controlled by controlling the error of model parameters before and after the update, and model training is completed only when the error of model parameters before and after the update meets the set conditions, thereby improving the accuracy of model parameters.
[0103] According to the above description, the data processing method provided by the present application is to obtain training sample data; input the training sample data into a preset model, and compensate the first model parameter in the loss function of the preset model to obtain the target loss function after compensation; perform multi-order derivative processing on the target loss function, and update the first model parameter according to the result of the multi-order derivative to obtain the second model parameter; update the first model parameter based on the second model parameter, and return to perform compensation processing on the first model parameter in the loss function of the preset model, obtain the target loss function after compensation and perform iterative training until the first model parameter converges. In this way, by compensating the model parameters in the model loss function, the model parameters can be updated in multiple orders of iterations, thereby improving the efficiency of iterative updating of the model parameters. That is, the data processing efficiency is improved, and then the speed of solving the model parameters is improved.
[0104] Accordingly, the embodiment of the present application will further describe the data processing method provided by the present application in detail from the perspective of a computer device. The computer device in this embodiment can be a terminal or a server. Figure 3 FIG. 1 is another flow chart of the data processing method provided by the present application, the method comprising:
[0105] Step 201: A computer device obtains training sample data.
[0106] The computer device can obtain training sample data from the server, and the training sample data includes input data set X t And the output dataset Y tAfter the computer device obtains the training sample data, it can preprocess the training sample data. Preprocessing the training sample data can be data cleaning of the training sample data. Data cleaning can include detecting the training sample data to determine whether there are abnormal values or missing values in the training sample data, and then removing the input or output data corresponding to the abnormal values and missing values. Then, the training sample data after removing the abnormal data is standardized to obtain the target training sample data. The target training sample data includes the input data set X t ′ And the output dataset X p ′ .
[0107] In step 202, the computer device inputs the target training sample data into the logistic regression model.
[0108] Among them, the scheme provided in this embodiment optimizes the model training efficiency of the logistic regression model. Unlike the linear regression model, in the linear regression model, the output value of the linear regression model can have multiple possibilities, while the output value of the logistic regression model is 0 or 1. Or, to a certain extent, the logistic regression model can be understood as a logic function applied on the basis of linear regression, and the logic function maps the output value of the linear regression model to 0 or 1. Therefore, it can be understood that the output data set X in the target training sample data p ′ The elements contained in are only 0 or 1. Here, 0 or 1 does not only represent the numbers 0 or 1, but a classification result, such as yes and no, cat or dog, etc., which classify the output results. That is, the logistic regression model can also be understood as a simple binary classification model. After the computer device cleans the training sample data to obtain the target training sample data, it inputs the target training sample data into the logistic regression model to train the logistic regression model.
[0109] In step 203, the computer device determines the loss function of the logistic regression model.
[0110] Among them, the evaluation of the fitting effect of the model parameters of the logistic regression model can be evaluated by the loss function of the logistic regression model. The smaller the loss function, the better the fitting effect of the model parameters of the logistic regression model. Moreover, in general, in order to avoid overfitting in the logistic regression model and to make the model more stable, an L2 regularization term is added to the loss function of the logistic regression model. Specifically, since the output result of the logistic regression model is 0 or 1, the probability of the event occurring is regarded as p, and the probability of the output result being 1 is: Where P y=1represents the probability of the output result being 1, that is, the probability of the event occurring; x is the input data, y is the output data corresponding to the input data x, w T is the transposed matrix of the diagonal matrix of the model parameters. By maximizing the conditional likelihood estimate, the loss function with L2 regularization can be deduced as:
[0111]
[0112] Where argmin is the minimum value, N is the number of samples in the target training sample data, λ is the L2 regularization coefficient, ‖w i ‖ represents the sum of squares of all model parameters.
[0113] Among them, in the related technology, the model parameters of the logistic regression model are solved by using the gradient descent method to solve the minimum value of the loss function. When the loss function is minimized, the corresponding model parameter value is the model parameter of the logistic regression model. Specifically, the gradient descent method is used to solve the model parameter w i The update formula is:
[0114]
[0115] Among them, w t+1 is the updated model parameter, w t is the model parameter before updating, η is the step size of gradient descent, is the model parameter w of the loss function L before updating t The first derivative at .
[0116] In step 204, the computer device adds weight constraints to the model parameters in the loss function to obtain a target loss function.
[0117] Among them, in the related art, the gradient descent method is used to solve the loss function of the logistic regression model. It is necessary to first determine the step size η of the gradient descent. It is difficult to determine the appropriate step size η. If the step size is determined to be too large, the model fitting effect will be poor. If the step size is too small, the gradient descent efficiency will be low, and the model training rate will decrease. Furthermore, the gradient descent method performs a first-order iteration with a fixed step size, and its iteration efficiency is low and the number of iterations is large. When the amount of training sample data is large, each iteration requires a large number of calculations, and a large number of iterations will greatly reduce the model training efficiency. In this regard, the inventor of the present application proposed a second-order iteration method after research to improve the iteration efficiency. The second-order iteration method is derived from Newton's method and will be described in detail below. Further, since there is a high probability of encountering the Hessian matrix singularity problem when using Newton's method to iteratively solve the model parameters in the loss function, the inventor of the present application proposed a solution to compensate the model parameters in the loss function to avoid the Hessian matrix singularity, so that the second-order iteration can be carried out stably. Specifically, the model parameters in the loss function are compensated by adding constraint weights to the model parameters in the loss function. A new loss function is obtained, which is referred to as the target loss function. The formula of the target loss function is as follows:
[0118]
[0119] Among them, β i is the constraint weight of the i-th model parameter, and β i >0;w i is the i-th model parameter.
[0120] It can be understood that due to the Equivalent to formula (2) Therefore, β i The value of will affect the contribution of model parameters to the model, as follows:
[0121] 1. When β i =1, the contribution of model parameters to the model remains unchanged;
[0122] 2. When β i When >1, the contribution of model parameters to the model decreases;
[0123] 3. When β i When <1, the contribution of model parameters to the model increases.
[0124] The constraint weight β for each model parameter iThe value of can be set according to actual needs. For example, in a logistic regression model that predicts whether a user can be given a loan, the input data set (i.e., independent variable) in the training sample data can be user data authorized by the user, such as the user's expenditure flow, asset information, etc., and the output data set (i.e., dependent variable) is whether a loan can be given or not. Training the model means solving the influence coefficient of each independent variable in the model, and these influence coefficients are the model parameters of the logistic regression model. Since the training data is historical data, when some lending policies of the country or the bank change, the influence of different independent variables on the model evaluation results will change. Therefore, the weight constraints of the model parameters can be added to the loss function to change the contribution (i.e., influence) of the model parameters to the model. For example, when the policy changes, the influence of asset information on the lending results decreases, then a constraint weight greater than 1 can be added to the model parameters corresponding to the asset information in the loss function to reduce the contribution of the model parameters corresponding to the asset information to the model. In this way, the model parameters obtained through training are more accurate, and the prediction results using the model are also more accurate. In this way, by compensating the model parameters in the loss function of the logistic regression model (i.e., adding weight constraints), the training results of the model training are made more reasonable, and thus the prediction results based on the trained model are made more accurate. On the other hand, by compensating the model parameters in the loss function of the logistic regression model, the second-order derivative matrix of the loss function is made non-singular, which ensures that the second-order iterative solution can be executed stably, reduces the number of iterations, and improves the efficiency of model training.
[0125] In step 205, the computer device calculates the first-order derivative matrix and the second-order derivative matrix of the target loss function, and determines the updating rule of the model parameters according to the first-order derivative matrix and the second-order derivative matrix.
[0126] Among them, the second-order iterative method used in this application is derived from Newton's method. Specifically, the basic iterative formula of Newton's method is: where x t+1 is the updated solution of function f(x)=0, x t is the solution of the function f(x) = 0 before updating, f(x t ) is the function f(x) at x=x t The value at f′(x t ) is the function f(x) at x=x t The derivative at . Since Newton's method is an iterative method for solving the function f(x) = 0, our solution to the target loss function is to find the minimum value of the target loss function, and finding the minimum value of the target loss function is to find a solution whose first-order derivative is 0. In this way, the update rule of the model parameters in the target loss function can be derived according to the basic iterative formula of Newton's method:
[0127] wnew =w old -(H L|w ) -1 G L|w Formula (4)
[0128] where w new is the updated model parameter, w old is the model parameter before updating. L|w is the first-order derivative matrix of the target loss function with respect to the model parameters, H L|w is the second-order derivative matrix of the target loss function to the model parameters. Specifically, the first-order derivative matrix can be rewritten as:
[0129] G L|w =-(X T (yp)-λβw) Formula (5)
[0130] The second-order derivative matrix can be rewritten as:
[0131] H L|w =X T PX+λβI Formula (6)
[0132] Where X is an N*m matrix consisting of input data (N represents the number of samples, and m represents the number of model parameters). T is the transposed matrix of X; y is the N-dimensional vector consisting of output data; p is the vector consisting of p(x i ; w) composed of an N-dimensional vector, where Where sigmiod is the likelihood function, x i is an m-dimensional vector consisting of the values of each input data in different model parameter dimensions, For x i The transposed vector of the model, w is the m-dimensional vector consisting of the model parameters to be solved; β is the coefficient constraint β of each model parameter i The m*m diagonal matrix is formed; P is an N*N diagonal matrix, and its diagonal elements are p(x i ;w)(1-p(x i ; w)), I is a unit vector.
[0133] It is understandable that if the model parameter w in the target loss function is not i Adding the weight coefficient or L2 regularization coefficient, the second-order derivative matrix (i.e., Hessian matrix) of the target loss function is obtained as X T PX, the Hessian matrix has a high probability of being a singular matrix. When the Hessian matrix is a singular matrix, the update formula of formula (4) cannot be updated. i Add weight coefficient β i After that, the Hessian matrix of the target loss function is obtained as XT PX + λβI. Since λβI is a diagonal matrix with non-zero diagonal elements, adding this term can ensure that the Hessian matrix is non-singular, and further ensure that the model parameters can be updated stably.
[0134] Further, substituting equations (5) and (6) into equation (4) and simplifying, the update rule for the model parameters is derived as follows:
[0135] w new = [I - λβ(X T PX + λβI) -1 w old +(X T PX + λβI) -1 X T (y - p) Equation (7)
[0136] Step 206, the computer device continuously updates the model parameters according to the update rule until the model parameters converge.
[0137] Among them, after determining the update rule of the model parameters, the model parameters can be continuously iteratively updated based on an initial locally optimal model parameter until the model parameters converge. Among them, when iteratively updating the model parameters according to equation (7), it will involve the problem of calculating the large matrix multiplication X T PX. When the number of target training sample data continues to increase, it will lead to an excessive amount of calculation and even exceed the maximum memory of the computer device, resulting in a memory overflow problem. For this reason, this application proposes a simplified calculation method. Since the matrix P is a diagonal matrix, according to the special property of the diagonal matrix: multiplying a matrix on the right by a diagonal matrix is equal to multiplying each column of the matrix by the diagonal elements of the diagonal matrix for calculation. Since X T is an m*N matrix and P is an N*N diagonal matrix, where m << N; performing element-wise multiplication of each row of X T with the diagonal elements respectively, we get:
[0138] row(X T P) ij = row(X T ) ij * diag(p jj ) Equation (8)
[0139] Among them, row(X T P) ij represents the element in the i-th row and j-th column of the matrix X T P, and row(X T ) ij represents the element in the i-th row and j-th column of the matrix X T , and diag(p jj) represents the element in the jth row and jth column of the diagonal matrix P. The matrix X is calculated in this way T After P, the matrix is right-multiplied by the matrix X, which simplifies the calculation process and improves the calculation speed.
[0140] In some embodiments, after each update to obtain the updated model parameters, the absolute value of the difference between the updated model parameters and the model parameters before the update is calculated. When the absolute value is less than a preset threshold, for example, 10 -6 , it can be determined that the model parameters of the logistic regression model have converged, and the model parameters after the last update are determined to be the model parameters of the logistic regression model.
[0141] According to the above description, the data processing method provided by the present application obtains training sample data, inputs the target training sample data into the logistic regression model, determines the loss function of the logistic regression model, adds weight constraints to the model parameters in the loss function, and obtains the target loss function; calculates the first-order derivative matrix and the second-order derivative matrix of the target loss function, and determines the update rule of the model parameters according to the first-order derivative matrix and the second-order derivative matrix; and continuously updates the model parameters according to the update rule until the model parameters converge. In this way, by adding weight constraints to the model parameters in the loss function of the logistic regression model, the loss function is solved by a second-order iteration until the model parameters of the logistic regression model converge. This method can effectively improve the efficiency of solving the model parameters of the logistic regression model and improve the training speed of the logistic regression model.
[0142] Furthermore, the embodiment of the present application also provides a permission prediction method, which can be used in a permission prediction device, and the permission prediction method includes:
[0143] Receiving user request information, where the user request information includes user data authorized by the user;
[0144] The user data is input into the trained preset model. The model parameters of the preset model are as follows: Figure 2 or Figure 3 The data processing method provided in various optional implementations is trained to obtain the result;
[0145] The output results of the trained preset model are determined as the user's permissions.
[0146] Among them, it can be understood that the preset model is also a logistic regression model, that is, a binary classification model, so the output result of the preset model is either authorized or unauthorized. The permission prediction method provided in the present application can be used to perform permission analysis on the user's loan request, and determine whether the user is eligible for a loan or whether the user can be loaned based on the relevant user data provided by the user. The permission prediction method provided in the present application can also be used to estimate the user's permission to access a server resource. For example, after the user makes an access request to a server resource, the server invites the user to answer several preset questions, and predicts whether the user has permission to access the server based on the user's answer results.
[0147] Among them, the preset model (logistic regression model) also needs to be trained with a certain amount of historical data before use to determine the model parameters of the preset model. Different training sample data are required for different model functions. For example, when the function of the authority prediction model is to predict the user's loan authority, the training sample data used for training is the user data authorized by the user and the authority results corresponding to each group of user data. The process of model training, that is, the process of training the model parameters, can be trained using any of the data processing methods provided in the aforementioned embodiments.
[0148] In order to better implement the above method, an embodiment of the present invention further provides a data processing device, which can be integrated in a computer device, and the computer device can be a mobile terminal or a server.
[0149] For example, Figure 4 As shown, it is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. The data processing device may include an acquisition unit 301, a compensation unit 302, an update unit 303 and a training unit 304, as follows:
[0150] An acquisition unit 301 is used to acquire training sample data;
[0151] The compensation unit 302 is used to input the training sample data into the preset model, and perform compensation processing on the first model parameter in the loss function of the preset model to obtain a target loss function after compensation processing;
[0152] An updating unit 303 is used to perform multi-order derivation processing on the target loss function, and update the first model parameters according to the results of the multi-order derivation to obtain second model parameters;
[0153] The training unit 304 is used to update the first model parameters based on the second model parameters, and return to perform compensation processing on the first model parameters in the loss function of the preset model, obtain the target loss function after compensation processing and perform iterative training until the first model parameters converge.
[0154] In some embodiments, Figure 5 FIG. 2 is another schematic diagram of the structure of the data processing device provided by the present application, wherein the compensation unit 302 includes:
[0155] A first determining subunit 3021 is used to determine a loss function of a preset model according to training sample data;
[0156] An acquisition subunit 3022 is used to acquire a weight constraint of a first model parameter of a preset model;
[0157] The compensation subunit 3023 is used to compensate the first model parameter in the loss function according to the weight constraint.
[0158] In some embodiments, obtaining a subunit includes:
[0159] An acquisition module, used for acquiring an expected contribution of a first model parameter in a preset model to the preset model;
[0160] The first determination module is used to determine the weight constraint of the first model parameter of the preset model according to the expected contribution.
[0161] In some embodiments, the first determining subunit includes:
[0162] A preprocessing module is used to preprocess the training sample data to obtain target training sample data;
[0163] The second determination module is used to determine the loss function of the preset model according to the target training sample data.
[0164] In some embodiments, Figure 6 As shown, it is another structural schematic diagram of the data processing method provided by the present application, and the updating unit 303 includes:
[0165] The first calculation subunit 3031 is used to calculate the first-order derivative matrix and the second-order derivative matrix of the target loss function;
[0166] A second determining subunit 3032 is used to determine a model parameter update rule of a preset model according to the first-order derivative matrix, the second-order derivative matrix and the first model parameter;
[0167] The operator unit 3033 is used to perform operations based on the model parameter update rule to obtain the second model parameters after the operation.
[0168] In some embodiments, the training unit 304 includes:
[0169] A first training subunit is used to update the first model parameter in the loss function according to the value of the second model parameter, and return to perform compensation processing on the first model parameter in the loss function of the preset model, obtain the target loss function after compensation processing and perform iterative training;
[0170] A statistics subunit, used to count the number of iterative training after each iterative training;
[0171] The third determining subunit is used to determine that the current first model parameters are model parameters of a preset model when the number of iterative training times reaches a preset number.
[0172] In some embodiments, the training unit 304 includes:
[0173] The second training subunit updates the first model parameter in the loss function according to the value of the second model parameter, and returns to perform compensation processing on the first model parameter in the loss function of the preset model, obtains the target loss function after compensation processing, and performs iterative training;
[0174] A second calculation subunit is used to calculate the absolute value of the difference between the target loss function value corresponding to the current first model parameter and the target loss function value corresponding to the first model parameter before the update after each update of the first model parameter;
[0175] The fourth determining subunit determines that the current first model parameter is a model parameter of a preset model when the absolute value of the difference is less than a preset value.
[0176] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.
[0177] As can be seen from the above, the data processing device provided by this embodiment obtains training sample data through the acquisition unit 301; the compensation unit 302 inputs the training sample data into the preset model, and performs compensation processing on the first model parameter in the loss function of the preset model to obtain the target loss function after compensation processing; the update unit 303 performs multi-order derivative processing on the target loss function, and updates the first model parameter according to the result of the multi-order derivative to obtain the second model parameter; the training unit 304 updates the first model parameter based on the second model parameter, and returns to perform compensation processing on the first model parameter in the loss function of the preset model, obtains the target loss function after compensation processing and performs iterative training until the first model parameter converges. In this way, by compensating the model parameters in the loss function, the model parameters can be updated in multiple orders of iterations, thereby improving the efficiency of iterative updating of the model parameters. That is, the data processing efficiency is improved, and the speed of model training is thereby improved.
[0178] The present application also provides a computer device, such as Figure 7 The figure is a schematic diagram of the structure of the computer device provided by this application. Specifically:
[0179] The computer device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that Figure 7 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0180] in:
[0181] The processor 401 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 402 and calling data stored in the memory 402, it executes various functions of the computer device and processes data, thereby performing overall detection of the computer device. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
[0182] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, and web page access, etc.); the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0183] The computer device also includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0184] The computer device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0185] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:
[0186] Acquire training sample data; input the training sample data into a preset model, and compensate the first model parameters in the loss function of the preset model to obtain the compensated target loss function; perform multi-order derivative processing on the target loss function, and update the first model parameters according to the results of the multi-order derivatives to obtain the second model parameters; update the first model parameters based on the second model parameters, and return to perform compensation processing on the first model parameters in the loss function of the preset model to obtain the compensated target loss function and perform iterative training until the first model parameters converge.
[0187] It should be noted that the computer device provided in the embodiment of the present application and the data processing method in the above embodiment belong to the same concept, and the specific implementation of the above operations can be referred to the previous embodiment, which will not be repeated here.
[0188] A person skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a storage medium and loaded and executed by a processor.
[0189] To this end, an embodiment of the present invention provides a storage medium in which a plurality of instructions are stored. The instructions can be loaded by a processor to execute the steps in any data processing method provided in the embodiment of the present invention. For example, the instructions can execute the following steps:
[0190] Acquire training sample data; input the training sample data into a preset model, and compensate the first model parameters in the loss function of the preset model to obtain the compensated target loss function; perform multi-order derivative processing on the target loss function, and update the first model parameters according to the results of the multi-order derivatives to obtain the second model parameters; update the first model parameters based on the second model parameters, and return to perform compensation processing on the first model parameters in the loss function of the preset model to obtain the compensated target loss function and perform iterative training until the first model parameters converge.
[0191] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0192] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0193] Since the instructions stored in the storage medium can execute the steps in any data processing method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any data processing method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0194] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a storage medium. A processor of a computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions, so that the computer device performs the above Figure 2 or Figure 3 The data processing method provided in various optional implementations.
[0195] The above is a detailed introduction to a data processing method, device, storage medium and computer equipment provided by an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A permission prediction method, characterized in that: The method comprises: Receiving user request information, wherein the user request information includes user data authorized by the user; The user data is input into a preset model after training, and the method for determining the model parameters of the preset model includes: obtaining training sample data, and inputting the training sample data into the preset model, determining the loss function of the preset model according to the training sample data, obtaining the expected contribution of the first model parameter in the preset model to the preset model, determining the weight constraint of the first model parameter of the preset model according to the expected contribution, when it is necessary to control the expected contribution of the first model parameter to the preset model to increase, determining that the weight constraint is less than 1, when it is necessary to control the expected contribution of the first model parameter to the preset model to decrease, determining that the weight constraint is greater than 1, adding a compensation factor to the first model parameter of the loss function according to the weight constraint, obtaining a target loss function after compensation processing, so that the Hessian matrix of the target loss function is a non-singular matrix, performing multi-order derivative processing on the target loss function, and updating the first model parameter according to the result of the multi-order derivative to obtain a second model parameter, updating the first model parameter based on the second model parameter, and returning to perform compensation processing on the first model parameter in the loss function of the preset model to obtain a target loss function after compensation processing and perform iterative training until the first model parameter converges; The output result of the trained preset model is determined as the user's authority.
2. The method according to claim 1, characterized in that The step of determining the loss function of the preset model according to the training sample data comprises: Preprocessing the training sample data to obtain target training sample data; The loss function of the preset model is determined according to the target training sample data.
3. The method according to claim 1 or 2, characterized in that: The performing multi-order derivation on the target loss function and updating the first model parameter according to the result of the multi-order derivation to obtain the second model parameter includes: Calculate the first-order derivative matrix and the second-order derivative matrix of the target loss function; Determine a model parameter update rule of the preset model according to the first-order derivative matrix, the second-order derivative matrix and the first model parameter; An operation is performed based on the model parameter update rule to obtain a second model parameter after the operation.
4. The method according to claim 3, characterized in that: The determining the preset model parameter update rule according to the first-order derivative matrix, the second-order derivative matrix and the first model parameter comprises: Calculating a ratio of the first-order derivative matrix to the second-order derivative matrix; The model parameter update rule for determining the preset model parameter is to calculate the difference between the first model parameter and the ratio.
5. The method according to claim 1, characterized in that The updating of the first model parameters based on the second model parameters, and returning to perform compensation processing on the first model parameters in the loss function of the preset model, obtaining the target loss function after compensation processing and performing iterative training until the first model parameters converge, includes: The first model parameter in the loss function is updated according to the second model parameter, and the compensation processing of the first model parameter in the loss function of the preset model is returned to obtain the target loss function after the compensation processing and perform iterative training; Count the number of iteration training after each iteration training; When the number of iterative training times reaches a preset number, the current first model parameters are determined to be model parameters of the preset model.
6. The method according to claim 1, characterized in that The updating of the first model parameters based on the second model parameters, and returning to perform compensation processing on the first model parameters in the loss function of the preset model, obtaining the target loss function after compensation processing and performing iterative training until the first model parameters converge, includes: The first model parameter in the loss function is updated according to the value of the second model parameter, and the compensation processing of the first model parameter in the loss function of the preset model is returned to obtain the target loss function after the compensation processing and perform iterative training; After each update of the first model parameter, calculating the absolute value of the difference between the current first model parameter and the first model parameter before the current update; When the absolute value of the difference is smaller than a preset value, the current first model parameter is determined to be a model parameter of the preset model.
7. A permission prediction device, characterized in that: The device is used to execute the authority prediction method as described in any one of claims 1-6.
Citation Information
Patent Citations
Rapid sequence labeling method
CN103064878A
