Feature completion model training method and device, medium, equipment and product
By using the feature filling model based on the adversarial generator, the adversarial generator is trained using positive and negative samples, and modeling based on the user's feature distribution, the problem of insufficient feature filling accuracy in the existing technology is solved, and a higher Feature Compensation Accuracy and Model Performance Improvement.
Patent Information
- Application Number
- CN202411266610.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2025-01-14
AI Technical Summary
The accuracy of feature filling methods in the prior art is insufficient, especially in the process of missing features in the training process of machine learning model. Commonly used statistical value methods do not conform to the refinement trend of machine learning and affect model performance.
Using the feature-complement model training method based on adversarial generator (GAN), the discriminator and generator of adversarial generator are trained by determining positive and negative samples, and the loss function of the generator is used to display distribution based on the sample user characteristics. Model, output target hidden vectors to determine the complementary features.
It improves the accuracy and stability of feature filling, can predict the values of elements to be filled more accurately, and improves the performance of machine learning models and the richness of character portraits.
Smart Images

Figure CN119312074A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a feature completion model training method, a feature completion model training device, a computer-readable storage medium, an electronic device, and a computer program product. Background Art
[0002] In the process of character portraiture or machine learning model training, if some features have missing elements, they need to be filled in. In related technologies, the missing elements are generally filled in by obtaining statistical values (such as mode value, mean value, etc.) of the missing elements.
[0003] However, the accuracy of the completion features determined by the feature completion solution provided by the related technology needs to be improved.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this specification, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of this specification is to provide a feature completion model training method, a feature completion model training device, a computer-readable storage medium, an electronic device and a computer program product, which are helpful in improving the accuracy of the completed features at least to a certain extent.
[0006] Other features and advantages of the present specification will become apparent from the following detailed description, or may be learned in part from the practice of the present specification.
[0007] According to one aspect of the present specification, a feature completion model training method is provided, the method comprising: determining positive samples and determining negative samples; fixing a first parameter of a generator of an adversarial generator to remain unchanged, and training a discriminator of the adversarial generator through the positive samples and the negative samples; fixing a second parameter of the discriminator of the adversarial generator to remain unchanged, and training the generator of the adversarial generator through the negative samples; and determining the trained adversarial generator as a feature completion model.
[0008] According to another aspect of the present specification, a feature completion model training device is provided, the device comprising:
[0009] A sample determination module is used to determine positive samples and negative samples;
[0010] A discriminator training module, used to fix the first parameter of the generator of the adversarial generator unchanged, and train the discriminator of the adversarial generator through the positive samples and the negative samples;
[0011] A generator training module, used to fix the second parameter of the discriminator of the adversarial generator to remain unchanged, and train the generator of the adversarial generator through the negative class samples;
[0012] The model training module is used to determine the trained adversarial generator as a feature completion model.
[0013] According to another aspect of the present specification, a feature completion model is provided, the model comprising: a generator and a latent vector processing module.
[0014] Among them, the above-mentioned generator is used to receive the target feature, the above-mentioned target feature contains one or more elements to be completed, and the multiple elements contained in the above-mentioned target feature are used to reflect multiple attributes belonging to the same user; the above-mentioned generator is also used to process the above-mentioned target feature to obtain the target latent vector corresponding to the target, wherein the loss function of the generator of the above-mentioned feature completion model is determined based on the display distribution modeling of the sample user characteristics, and the above-mentioned target latent vector includes a target continuous sub-feature and a target discrete sub-feature; and the latent vector processing module is used to determine the completion feature of the above-mentioned target feature based on the above-mentioned target continuous sub-feature and the above-mentioned target discrete sub-feature.
[0015] According to another aspect of the present specification, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the feature completion method in the above-mentioned embodiment when executing the computer program.
[0016] According to one aspect of the present specification, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer or a processor, the computer or the processor executes the feature completion method in the above embodiment.
[0017] According to another aspect of the present specification, a computer program product comprising instructions is provided. When the computer program product is run on a computer or a processor, the computer or the processor executes the feature completion method in the above-mentioned embodiment.
[0018] The feature completion model training method, device, medium, equipment and product provided in the embodiments of this specification have the following technical effects:
[0019] The solution provided by the exemplary embodiment of this specification is implemented based on a trained machine learning model (i.e., based on a feature completion model), and the loss function of the generator of the feature completion model is determined based on the display distribution modeling of sample user features. Specifically, the target features of the same user are input into the above-mentioned feature completion model, wherein the above-mentioned target features contain one or more elements to be completed. After being processed by the generator of the feature completion model, a target latent vector corresponding to the target feature is output, wherein the target latent vector contains a target continuous sub-feature and a target discrete sub-feature. Further, based on the target continuous sub-feature determination and the target discrete sub-feature, the completion features of the above-mentioned target features are determined. Compared with the method of using statistical values to perform feature completion in the related art, the features completed by the feature completion scheme provided in the embodiment of this specification have higher accuracy.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the specification, and together with the specification are used to explain the principles of the specification. Obviously, the accompanying drawings described below are only some embodiments of the specification, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0022] Figure 1 A flowchart of a feature completion method provided in one embodiment of this specification.
[0023] Figure 2 A flowchart of a feature completion method provided in another embodiment of this specification.
[0024] Figure 3 A schematic diagram of the structure of a feature extraction model provided in an embodiment of the feature completion method of this specification.
[0025] Figure 4 A flowchart of a method for training a feature extraction model provided in accordance with an embodiment of the present disclosure.
[0026] Figure 5 A flowchart of a method for determining positive class samples of a feature extraction model provided in an embodiment of this specification.
[0027] Figure 6 A flowchart of a method for determining negative samples of a feature extraction model provided in an embodiment of this specification.
[0028] Figure 7A flowchart of a method for training a discriminator in a feature extraction model provided in an embodiment of this specification.
[0029] Figure 8 A flowchart of a method for training a generator in a feature extraction model provided in an embodiment of this specification.
[0030] Fig. 9 A schematic diagram of the structure of a feature completion device provided in one embodiment of this specification.
[0031] Fig.10 A schematic structural diagram of a feature completion device provided in another embodiment of the present specification.
[0032] Fig.11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of this specification more clear, the embodiments of this specification will be further described in detail below with reference to the accompanying drawings.
[0034] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Instead, they are only examples of devices and methods consistent with some aspects of this specification as detailed in the attached claims.
[0035] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that this specification will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of this specification. However, those skilled in the art will appreciate that the technical solutions of this specification may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of this specification.
[0036] In addition, the drawings are only schematic illustrations of the present specification and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0037] Taking the training scenario of machine learning as an example, the accuracy of the features in the training samples has an important impact on the performance of the trained machine learning model. However, for features with missing elements, the commonly used filling scheme in related technologies is to use statistical values (e.g., mode, mean) to fill, or directly fill with 0. However, the filling features provided by related technologies do not conform to the trend of machine learning refinement, nor are they conducive to the training of machine learning models.
[0038] The embodiments of this specification can provide a feature completion method, a feature completion device, a feature completion model, a computer-readable storage medium, an electronic device, and a computer program product, which are at least helpful to improve the accuracy of the completed features to a certain extent. Figures 1 to 8 The feature completion method embodiment provided in this specification is described in detail:
[0039] For example, Figure 1 A flowchart of a feature completion method provided in an embodiment of this specification. Figure 1 , the embodiment shown in the figure includes: S110-S130.
[0040] In S110 , the target features are input into the trained feature completion model.
[0041] Among them, the above-mentioned target feature contains multiple elements, and the multiple elements contained in the above-mentioned target feature are used to reflect multiple attributes belonging to the same user. Exemplary, multiple attributes of the same user are such as a user's education level, asset status level, city level, etc. It should be noted that, in this embodiment, the above-mentioned target feature is a feature to be completed, that is, one or more of the multiple elements contained in the above-mentioned target feature are elements to be completed (i.e., missing elements). And the values of the above-mentioned one or more elements to be completed can be determined specifically by the scheme provided in the embodiments of this specification.
[0042] In an exemplary embodiment, Figure 2 A flowchart of a feature completion method provided in another embodiment of this specification. Figure 2, the above target feature can be expressed as u', which contains six elements, of which the second and third elements are elements to be completed.
[0043] In S120, after being processed by the generator of the feature completion model, a target latent vector corresponding to the target feature is output.
[0044] refer to Figure 2 , the target feature u' (5__3 6 8, where "_" represents a missing element) is input into a feature completion model 100, which is obtained by training a Generative Adversarial Network (GAN) with multiple sample user features.
[0045] It should be noted that in the financial scenario, the characteristic attributes belonging to the same user are the representation of the user, and there is a certain constraint relationship between the characteristics of different users, that is, the characteristics of different users are not completely independent; at the same time, in the human economic society, people have certain similarities at the characteristic level, so this solution uses multiple cluster centers corresponding to the feature completion model to represent the population, and the user characteristics in the same population have a certain degree of similarity. For example, based on big data, the level of asset status of users with attributes (first-tier cities, high education, middle-aged people, etc.) will be relatively high, while the level of asset status of users with attributes (fourth-tier cities, fifth-tier cities, low education, elderly people, etc.) will be relatively low. It can be seen that user characteristics conform to a high-dimensional distribution. Since this high-dimensional distribution is difficult to represent with commonly used formulas, it can be called an implicit high-dimensional distribution.
[0046] The feature completion solution provided in the embodiments of this specification is a learning mechanism based on game confrontation to supplement the missing elements in the user features. The implicit high-dimensional distribution is explicitly modeled by training GAN. Specifically, the invisible high-dimensional distribution that the sample user features conform to is learned by training GAN. Furthermore, since the target features to be completed also conform to the invisible high-dimensional distribution, the completed features corresponding to the target features can be effectively predicted based on the trained GAN.
[0047] The training process of the model will be described in detail in the following embodiments.
[0048] Specifically, refer to Figure 2 , the feature completion model 100 (trained GAN) includes: a generator 10 and a latent vector processing module 20.
[0049] Among them, the model parameters of the generator 10 in the feature completion model 100 (trained GAN) are optimized, and the implicit feature representation of the user features can be learned. Then the above-mentioned generator 10 performs feature processing on the input user features based on the optimized model parameters. Specifically, the generator 10 processes each element of the user features in a distributed and parallel manner to extract, compress information and filter noise from the input user features to obtain the latent vector corresponding to the user features.
[0050] In this embodiment, the target vector u' is input into the generator 10, and after being processed by the generator 10, the target latent vector e' corresponding to the target feature is output. Since the user feature (target feature) includes a continuous feature part and a discrete feature part, the target latent vector e' includes a target continuous sub-feature e1' and a target discrete sub-feature e2'. For example, Figure 3 This is a schematic diagram of the structure of the feature extraction model provided in the feature completion method embodiment of this specification. Figure 3 , the latent vector e output by the generator 10 contains a continuous feature part 310 and a discrete feature part 320.
[0051] Continue to refer Figure 1 In S130, the complement feature of the target feature is determined according to the target continuous sub-feature and the target discrete sub-feature.
[0052] Exemplary, reference Figure 2 , the target latent vector e' containing the target continuous sub-feature e1' and the target discrete sub-feature e2' is input into the latent vector processing module 20, and the target feature complement V' is output after being processed by the latent vector processing module 20. As mentioned above, the complement feature V' also contains a continuous feature part and a discrete feature part. Therefore, the following embodiments will determine the continuous feature part in the complement feature V' through the target continuous sub-feature e1' contained in the target latent vector e', and determine the discrete feature part in the complement feature V' through the target discrete sub-feature e2' contained in the target latent vector e'.
[0053] Specifically, the target continuous sub-feature e1' is determined as the continuous feature part in the complement feature V'. As for the discrete feature part in the complement feature V', the target discrete sub-feature e2' is processed by a preset function to obtain the discrete feature part in the complement feature V'.
[0054] Exemplarily, the preset function includes a softmax function and an argmax function. That is, the target discrete sub-feature e2' is processed by the softmax function to obtain the target intermediate sub-feature; and the target intermediate sub-vector is processed by the argmax function to obtain the discrete feature part in the complementary feature V'. Thus, the complementary feature V' of the target feature is determined, that is, the missing elements in the target feature u' are complemented.
[0055] In an exemplary embodiment, reference Figure 3 , the discrete feature part 320 contained in the latent vector e is processed by the softmax function to obtain the discrete feature part [0.1 0.4 0.30.2] in the intermediate feature f. Further, the discrete feature part [0.1 0.4 0.3 0.2] in the intermediate feature f is processed by the argmax function to obtain the discrete feature part [0 1 0 0] in the generated feature v_gen.
[0056] Among them, the softmax function is a normalized exponential function, which specifically converts the discrete feature part 320 contained in the latent vector e into a probability between 0 and 1 to obtain the discrete feature part in the intermediate feature f; the above argmax function is a function that finds the parameter (set) of the function, and its role is to determine the distribution of elements with the maximum value among multiple elements of the discrete feature. During the model training process, the argmax function is used to determine the display distribution of the discrete features of the sample users.
[0057] In an exemplary embodiment, Figure 4 This is a flow chart of a method for training a feature extraction model provided in one embodiment of this specification. Figure 4 , the embodiment shown in the figure includes: S410-S440.
[0058] In S410, positive samples are determined.
[0059] In an exemplary embodiment, Figure 5 This is a flow chart of a method for determining positive samples of a feature extraction model provided in an embodiment of this specification. Figure 5 , the embodiment shown in the figure includes:
[0060] S4102, performing random element masking processing on the i-th sample user feature to obtain the i-th missing feature corresponding to the i-th sample user feature; and, S4104, determining the i-th sample user feature and the i-th missing feature as the i-th positive class sample, where i is a positive integer.
[0061] For example, the i-th sample user feature is represented as v i , for v iRandom element shielding means randomly shielding v i One or more elements in , so that v i The corresponding feature element is missing. In this embodiment, the i-th missing feature corresponding to the i-th sample user feature is represented as c i For example, the feature of the i-th sample user is v i The elements are as follows: f1, f2, f3, ... fn (n is a positive integer), and the elements to be shielded are f1, f3, f6, fk (k is a positive integer less than n). Then for v i Random element shielding means that one or more of f1, f3, f6, and fk can be randomly removed. The number of shielded elements depends on the actual demand for samples.
[0062] In this embodiment, the above-mentioned i-th sample user feature and the above-mentioned i-th missing feature are determined as the i-th positive class sample, that is, (v i ,c i ) is determined as the i-th positive sample.
[0063] Continue to refer Figure 4 , in S410, negative class samples are also determined.
[0064] In an exemplary embodiment, Figure 6 This is a flow chart of a method for determining negative samples of a feature extraction model provided in an embodiment of this specification. Figure 6 , the embodiment shown in the figure includes: S4102'-S41012'.
[0065] In S4102', random element masking is performed on the j-th sample user feature to obtain the j-th missing feature corresponding to the j-th sample user feature.
[0066] In the embodiment corresponding to S4102, for the j-th sample user feature v j Perform random element masking to obtain the j-th sample user feature v j The corresponding j-th missing feature c j .
[0067] In S4104', the j-th missing feature and the randomly distributed sampling feature are input into the generator of the anti-generator.
[0068] For example, the randomly distributed sampling features are determined by tensorflow as follows:
[0069] tf.random.normal(
[0070] shape,
[0071] mean=0.0,
[0072] stddev=1.0,
[0073] dtype = tf.dtypes.float32,
[0074] seed=None,
[0075] name=None )
[0077] The generated random vector or random matrix with the dimension of shape (the value of shape is an integer array) can be used as the sampling feature of the above random distribution. For example, if the value of shape is [3,4], a 3×4 random matrix is generated. In this embodiment, the jth missing feature c j The sampled features input to the generator 10 are denoted as z j .
[0078] In this embodiment, by introducing randomly distributed sampling features as training samples, the generation diversity of the generator can be increased, which is conducive to modeling the distribution of sample user features in the adversarial network.
[0079] refer to Figure 3 , the above c j and z j The generator 10 of the anti-generator is inputted, and further, the latent vector e is generated according to the j-th output of the generator of the anti-generator. j To determine the jth generated feature v corresponding to the jth sample user feature j _gen. Specifically, according to e j Determine v j The execution process of _gen is as follows: S4106'-S41010':
[0080] In S4106', the j-th discrete sub-feature in the j-th generated latent vector is processed by the softmax function to obtain the j-th intermediate sub-feature; in S4108', the j-th intermediate sub-vector is processed by the argmax function to obtain the j-th discrete feature part in the j-th generated feature; and, in S41010', the j-th continuous sub-feature in the j-th generated latent vector is determined as the j-th continuous feature part in the j-th generated feature.
[0081] Exemplarily, similar to the implementation method provided in the embodiment corresponding to S130: the j-th generated latent vector e j The j-th discrete sub-feature in is processed by the softmax function to obtain the j-th intermediate sub-feature; in S4108', the j-th intermediate sub-vector is processed by the argmax function to obtain the j-th generated feature vj The jth discrete feature part v in _gen j2 _gen; and, in S41010', the j-th generated latent vector e j The j-th continuous sub-feature in is determined as the j-th generated feature v j The jth continuous feature part v in _gen j1 _gen, thereby determining the jth user feature v j The corresponding j-th generated feature v j _gen.
[0082] In S41012', the j-th sample user feature and the j-th generated feature are determined as j-th negative class samples, where the value of j is a positive integer.
[0083] In this embodiment, the j-th generated feature v j _gen and the j-th missing feature c j Determine the jth negative sample, that is, (v j _gen,c j ) is determined as the jth negative sample.
[0084] Among them, the values of j and i are both positive integers, so they can take the same value. That is, the positive samples and negative samples of the same user sample feature can be regarded as a group of samples. For example, the i-th positive sample (v i ,c i ) and the i-th negative sample (v i _gen,c i ) The i-th group of samples determined is expressed as (v i ,c i ;v i _gen,c i ). Each set of sample features corresponds to one user, that is, different sets of sample features correspond to different users. In other words, the i-th set of sample features corresponds to the i-th user.
[0085] Continue to refer Figure 4 In S420, the first parameter of the generator of the adversarial generator is fixed unchanged, and the discriminator of the adversarial generator is trained through the positive samples and the negative samples.
[0086] In the solution provided in the embodiment of this specification, the parameters of the generator (referred to as the first parameter, where the first parameter is the initial parameter of the generator) are fixed first, and then Figure 7 The embodiment shown is used to train the discriminator, with the goal of maximizing the accuracy of discriminating whether the sample is generated.
[0087] Among them, the M groups of samples used to train the discriminator are as follows Figure 5and Figure 6 As determined in the illustrated embodiment, the value of M is a positive integer.
[0088] In an exemplary embodiment, Figure 7 A flowchart of a method for training a discriminator in a feature extraction model provided in an embodiment of this specification. Figure 7 , the embodiment shown in the figure includes:
[0089] S4202, input the positive class samples into the discriminator of the anti-generator to obtain the first class probability; S4202', input the negative class samples into the discriminator of the anti-generator to obtain the second class probability.
[0090] For example, for the positive sample (v i ,c i ), and input it into the discriminator of the above anti-generator to obtain the first class probability d(v i ,c i ). For the negative samples in the i-th group of samples (v i _gen,c i ), and input it into the discriminator of the above anti-generator to obtain the second class probability d(g(z i ,c i ),c i ).
[0091] S4204, determining a discriminator loss function according to the first category probability and the second category probability, and optimizing the second parameter by maximizing the discriminator loss function to train the discriminator of the adversarial generator.
[0092] Exemplarily, the discriminator loss function can be expressed as D, then D can be expressed as formula (1); in addition, the discriminator parameter θ is updated by formula (2):
[0093]
[0094] The discriminator loss function D is essentially a variant of the logistic regression loss function. As mentioned above, the purpose of training the discriminator is to maximize the accuracy of the discriminator for "whether the sample is generated". Therefore, this embodiment optimizes the second parameter by maximizing the discriminator loss function to train the discriminator of the adversarial generator. Specifically, for the positive sample (v i ,c i ), the discriminator outputs probability d(v i ,c i ) needs to be as close to 1 as possible, then log(d(v i ,c i )) takes a value close to 0; for negative samples (vi _gen,c i ), the discriminator outputs probability d(g(z i ,c i ),c i ) needs to be as close to 0 as possible, then log(1-d(g(z i ,c i ),c i ))The value is close to 0.
[0095] Exemplarily, γ represents a learning rate, and the value can be set according to actual needs.
[0096] After the discriminator is trained to obtain the preset evaluation index, S430 is executed to fix the second parameter of the discriminator of the adversarial generator to remain unchanged, and the generator of the adversarial generator is trained through the negative class samples.
[0097] In the solution provided in the embodiments of this specification, the parameters of the trained discriminator (referred to as the second parameter, where the second parameter is the optimized parameter after the training of the discriminator) are fixed unchanged, and the following is done: Figure 8 The illustrated embodiment is used to train the discriminator, with the goal of obtaining a high score for the discriminator (after training) for the generated feature v_gen.
[0098] Among them, the N groups of samples used to train the discriminator are as follows Figure 5 and Figure 6 As determined in the illustrated embodiment, the value of N is a positive integer.
[0099] In an exemplary embodiment, Figure 8 A flowchart of a method for training a generator in a feature extraction model provided in an embodiment of this specification. Figure 8 , the embodiment shown in the figure includes:
[0100] S4402, determining a supervision loss function based on the j-th generated feature and the j-th sample user feature.
[0101] For example, the supervised loss function is the difference between the generated feature v_gen and the corresponding original sample user feature v. The supervised loss function can be expressed as "supervise loss", and the "supervise loss" can be expressed as formula (3):
[0102]
[0103] Among them, the above-mentioned supervised loss function includes two parts. The first part is the loss of v_gen and the corresponding original sample user feature v about the continuous feature part, and the second part is the loss of v_gen and the corresponding original sample user feature v about the calculation feature part.
[0104] Specifically, the jth generated feature v j The continuous feature part in _gen can be expressed as f kj , and the jth sample user feature v j The continuous feature part can be expressed as r kj , further, calculate f kj With r kj The second norm between , where k is a positive integer not greater than dense, and dense is a positive integer.
[0105] The jth generated feature v j The discrete feature part in _gen can be expressed as f k'j , and the jth sample user feature v j The discrete feature part can be expressed as r k'j , further, calculate f k'j With r k'j The cross entropy between , where k' is a positive integer not greater than category, and category is a positive integer.
[0106] It can be seen that the above supervision function takes the sample user feature (normal feature-free loss data) v as the learning target. The continuous feature part of the loss takes the minimum distance as the loss, and the discrete feature part takes the cross entropy as the loss. The goal is to minimize the supervision loss so that the generated features are as close as possible to the corresponding sample user features.
[0107] If feature learning is done only in a supervised manner (i.e., the generator is trained only through the above-mentioned supervised loss), the purpose is to minimize the global experience loss, which will cause the feature of the supplementary feature to tend to the overall average of the feature and tend to select the mean, but this overall mean does not conform to the actual sample feature distribution. It can be seen that training the generator only through the above-mentioned supervised loss is not conducive to improving the prediction accuracy of the elements to be supplemented. Therefore, the embodiment of this specification is also based on sample user feature distribution modeling, and the loss function is determined based on the display distribution modeling of sample user features.
[0108] Furthermore, since user features may contain both discrete feature parts and continuous feature parts, discrete features have the problem of not being able to be transferred by gradients. In order to solve this problem, the embodiments of this specification will perform display modeling on the continuous features of sample user features and determine the "continuous feature distribution loss function" (such as S4402' and S4404') based on this, and will also perform display modeling on the discrete features of sample user features and determine the "discrete feature distribution loss function" (such as S4402" and S4406") based on this, thereby effectively improving the stability of the feature completion model. Specifically:
[0109] S4402', input the j-th continuous feature part and the j-th missing feature in the above-mentioned j-th generated feature into the above-mentioned discriminator after training to obtain the third type probability; and, S4204', determine the continuous feature distribution loss function according to the above-mentioned third type probability, and the above-mentioned continuous feature distribution loss function is determined based on the display distribution modeling of the continuous features in the sample user features.
[0110] Exemplarily, the j-th continuous feature part v in the j-th generated feature is j1 _gen(can also be written as g(z j ,c j )') and the jth missing feature are input into the trained discriminator to obtain the third class probability d(g(z j ,c j )',c j ). Among them, the continuous feature distribution loss function can be expressed as G, then G can be expressed as formula (4):
[0111]
[0112] As mentioned above, the purpose of training the generator is to obtain a high score for the discriminator (after training) for the generated feature v_gen. Therefore, the continuous feature distribution loss function G, the supervisory loss, and the discrete feature distribution loss function "category reward" are used together to optimize the first parameter to train the generator of the adversarial generator. For the loss function G, this embodiment optimizes the first parameter by maximizing G. Specifically, for the jth continuous feature part g(z j ,c j )', the discriminator outputs the probability d(g(z j ,c j )') needs to be as close to 1 as possible, then log(d(g(z j ,c j )')) takes a value close to 0.
[0113] Continue to refer Figure 8 In S4402", the j-th discrete feature part and the j-th missing feature in the j-th generated feature are input into the trained discriminator to obtain the fourth category probability.
[0114] The j-th discrete feature part v in the j-th generated feature is j2 _gen(can also be written as g(z j ,c j )”) and the jth missing feature c j Input to the trained discriminator above, and get the third class probability d(g(z j ,cj )”,c j ). Among them, the discrete feature distribution loss function can be expressed as "category reward", and the category reward can be expressed as formula (5):
[0115]
[0116] It can be seen that the third type probability d(g(z j ,c j )”,c j ) and "0.5", and multiply the difference by the reward operator Specifically:
[0117] In S4404", a reward operator is determined based on the j-th discrete feature in the j-th intermediate sub-feature and the j-th generated feature.
[0118] In this embodiment, a reward operator is introduced to optimize the display distribution of discrete features of sample users. Specifically, The meaning is to reward the current sample argmax to generate one hot selection behavior. The size and positive or negative of the reward is determined by the final discriminant probability d(g(z j ,c j )”,c j )Decide:
[0119] In d(g(z j ,c j )”,c j ) is greater than 0.5, indicating that the display distribution of the discrete features in the current generated feature v_gen is close to the sample user feature v (which can get a high score after passing the discriminator), and a positive reward is obtained; in d(g(z j ,c j )”,c j ) is less than 0.5, indicating that the display distribution of the discrete features in the current generated feature v_gen is far away from the sample user feature v (it cannot get a high score after passing the discriminator), and it is penalized, thereby reducing the selection probability of the current one hot feature, and then optimizing the selection of the one hot category by selecting the selection probability of other one hot categories.
[0120] Exemplarily, the j-th intermediate sub-feature is the output of the softmax function, which is denoted as “soft js ", the j-th discrete feature in the j-th generated feature is recorded as "one_hot js ", where s is a positive integer not greater than C, and C is a positive integer representing the elements in the discrete feature.
[0121] In S4206", a discrete feature distribution loss function is determined according to the fourth type of probability and the reward operator, and the discrete feature distribution loss function is determined based on display distribution modeling of discrete features in sample user features.
[0122] In the embodiments of this specification, a category selection reward for discrete features is constructed, which effectively solves the problem that discrete features cannot be transferred by gradients and improves the stability of the feature completion model.
[0123] After determining the three loss functions used to train the generator, execute S4408: combine the above-mentioned supervised loss function, the above-mentioned discrete feature distribution loss function and the above-mentioned discrete feature distribution loss function to optimize the above-mentioned first parameter to train the generator of the above-mentioned adversarial generator.
[0124] Exemplarily, the first parameter g of the generator is updated by formula (6):
[0125]
[0126] Among them, δ, α and β are three different learning rates, and the values can be set according to actual needs.
[0127] Specifically, the formula updates the parameters of the generator by maximizing the discrimination probability of the discriminant network, the reward for discrete feature selection based on the discrimination probability, and minimizing the supervision loss. The generator is trained through the above loss function until the trained generator can obtain the preset evaluation index.
[0128] Continue to refer Figure 4 In S440, the trained adversarial generator is determined as the feature completion model. Figure 2 , the completed feature V' obtained in S130 is input to the discriminator in the feature completion model, and the output value of the discriminator is greater than the preset value, and the preset value is greater than 0.5 and less than 1. It means that the completed feature can achieve good accuracy. The completed feature V' is used in scenarios such as training of machine learning models and determination of character portraits, which can effectively improve model performance and the richness of character portraits.
[0129] In the feature completion scheme provided in the embodiments of this specification, the feature completion scheme provided in the embodiments of this specification is a learning mechanism for supplementing missing elements in user features based on game confrontation. Specifically, by iteratively training the discriminator and the generator, the discriminative ability of the discriminator is alternately improved, and the deception of the generator to the discriminative network is improved, so that the above-mentioned implicit high-dimensional distribution is explicitly modeled by training GAN, and the invisible high-dimensional distribution that the sample user features conform to is learned by training GAN. Furthermore, since the target features to be completed also conform to the above-mentioned invisible high-dimensional distribution, the completed features corresponding to the target features can be effectively predicted based on the trained GAN. This is conducive to making the values of the elements to be completed more accurate, thereby effectively improving the accuracy, stability and granularity of the completed features. The effective use of data is improved, and the subsequent machine learning improvement effect is significant.
[0130] At the same time, based on the adversarial loss framework, we construct a category selection reward for discrete features, which solves the problem that discrete features cannot be transferred by gradients, and can make the feature completion model more stable. As a result, the target features can effectively enhance the learning performance of the model after feature completion, and realize the commercial implementation of completing user features based on game adversarial modeling feature distribution in industrial financial scenarios.
[0131] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present specification, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0132] The following are device embodiments of this specification, which can be used to implement the method embodiments of this specification. For details not disclosed in the device embodiments of this specification, please refer to the method embodiments of this specification.
[0133] in, Fig. 9 The structure diagram of the feature completion device of an embodiment of this specification is shown. Fig. 9 The feature completion device shown in the figure can be implemented as all or part of the electronic device through software, hardware or a combination of both, and can also be integrated on the server as an independent module, or can also be integrated in the electronic device as an independent module.
[0134] The feature completion device 900 in the embodiment of this specification includes: a feature input module 910 , a latent vector determination module 920 , and a feature completion module 930 .
[0135] Among them, the above-mentioned feature input module 910 is used to: input the target feature into the feature completion model, wherein the above-mentioned target feature contains one or more elements to be completed, and the multiple elements contained in the above-mentioned target feature are used to reflect multiple attributes belonging to the same user; the above-mentioned latent vector determination module 920 is used to: output the target latent vector corresponding to the above-mentioned target feature after being processed by the generator of the above-mentioned feature completion model, wherein the loss function of the generator of the above-mentioned feature completion model is determined based on the display distribution modeling of the sample user characteristics, and the above-mentioned target latent vector includes a target continuous sub-feature and a target discrete sub-feature; and the above-mentioned feature completion module 930 is used to: determine the completion feature of the above-mentioned target feature based on the above-mentioned target continuous sub-feature determination and the above-mentioned target discrete sub-feature.
[0136] In an exemplary embodiment, Fig.10 The structure diagram of the feature completion device according to another exemplary embodiment of this specification is schematically shown. Fig.10 :
[0137] In an exemplary embodiment, after the above-mentioned complement features are processed by the discriminator of the above-mentioned feature complement model based on the above-mentioned scheme, the output value of the above-mentioned discriminator is greater than a preset value, and the value of the above-mentioned preset value is greater than 0.5 and less than 1.
[0138] In an exemplary embodiment, based on the aforementioned solution, the feature completion module 930 includes: a first determination unit 9302 , a function processing unit 9304 , and a second determination unit 9306 .
[0139] Among them, the above-mentioned first determination unit 9302 is used to: determine the above-mentioned target continuous sub-feature as the continuous feature part in the above-mentioned complementary feature; the above-mentioned function processing unit 9304 is used to: obtain the discrete feature part in the above-mentioned complementary feature after processing the above-mentioned target discrete sub-feature through a preset function; and the above-mentioned second determination unit 9306 is used to: determine the above-mentioned complementary feature according to the above-mentioned continuous feature part and the above-mentioned discrete feature part.
[0140] In an exemplary embodiment, based on the aforementioned scheme, the function processing unit 9304 is specifically used for: processing the target discrete sub-features through a softmax function to obtain target intermediate sub-features; and processing the target intermediate sub-vectors through an argmax function to obtain the discrete feature part in the above-mentioned complement feature.
[0141] In an exemplary embodiment, based on the aforementioned solution, the apparatus further includes: a model training module 940.
[0142] Among them, the above-mentioned model training module 940 includes: a sample determination unit 9402, a discriminator training unit 9404, and a generator training unit 9406.
[0143] Among them, the above-mentioned sample determination unit 9402 is used to: determine the positive samples and the negative samples before inputting the target features into the feature completion model; the above-mentioned discriminator training unit 9404 is used to: fix the first parameter of the generator of the adversarial generator unchanged, and train the discriminator of the above-mentioned adversarial generator through the above-mentioned positive samples and the above-mentioned negative samples; the above-mentioned generator training unit 9406 is used to: fix the second parameter of the discriminator of the above-mentioned adversarial generator unchanged, and train the generator of the above-mentioned adversarial generator through the above-mentioned negative samples; and the above-mentioned model training module 940 is used to: determine the trained adversarial generator as the above-mentioned feature completion model.
[0144] In an exemplary embodiment, based on the aforementioned scheme, the sample determination unit 9402 is specifically used to: perform random element masking processing on the i-th sample user feature to obtain the i-th missing feature corresponding to the i-th sample user feature; and determine the i-th sample user feature and the i-th missing feature as the i-th positive sample, where i is a positive integer.
[0145] In an exemplary embodiment, based on the aforementioned scheme, the sample determination unit 9402 is further specifically used to: perform random element masking processing on the j-th sample user feature to obtain the j-th missing feature corresponding to the j-th sample user feature; input the j-th missing feature and the randomly distributed sampling feature into the generator of the anti-generator, and determine the j-th generated feature corresponding to the j-th sample user feature according to the j-th generated latent vector output by the generator of the anti-generator; and, determine the j-th sample user feature and the j-th generated feature as the j-th negative class sample, where j is a positive integer.
[0146] In an exemplary embodiment, based on the aforementioned scheme, the jth generated feature includes: a jth discrete feature portion and a jth continuous feature portion;
[0147] The sample determination unit 9402 is further specifically used for: processing the j-th discrete sub-feature in the j-th generated latent vector through a softmax function to obtain a j-th intermediate sub-feature; processing the j-th intermediate sub-vector through an argmax function to obtain a j-th discrete feature part in the j-th generated feature; and determining the j-th continuous sub-feature in the j-th generated latent vector as the j-th continuous feature part in the j-th generated feature.
[0148] In an exemplary embodiment, based on the aforementioned scheme, the discriminator training unit 9404 is specifically used to: input the positive class samples into the discriminator of the anti-generator to obtain the first class probability; input the negative class samples into the discriminator of the anti-generator to obtain the second class probability; and, determine the discriminator loss function according to the first class probability and the second class probability, and optimize the second parameter by maximizing the discriminator loss function to train the discriminator of the adversarial generator.
[0149] In an exemplary embodiment, based on the above-mentioned scheme, the generator training unit 9406 is specifically used to: determine the supervision loss function according to the j-th generated feature and the j-th sample user feature; input the j-th continuous feature part of the j-th generated feature and the j-th missing feature into the trained discriminator to obtain the third type of probability; determine the continuous feature distribution loss function according to the third type of probability, and the continuous feature distribution loss function is determined based on the display distribution modeling of the continuous features in the sample user features; input the j-th discrete feature part of the j-th generated feature and the j-th missing feature into the trained discriminator to obtain the fourth type of probability; determine the reward operator according to the j-th intermediate sub-feature and the j-th discrete feature in the j-th generated feature; determine the discrete feature distribution loss function according to the fourth type of probability and the reward operator, and the discrete feature distribution loss function is determined based on the display distribution modeling of the discrete features in the sample user features; and, in combination with the supervision loss function, the discrete feature distribution loss function and the discrete feature distribution loss function, optimize the first parameter to train the generator of the adversarial generator.
[0150] It should be noted that, when the feature completion device provided in the above embodiment executes the feature completion method, it only uses the division of the above-mentioned functional modules as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0151] In addition, the feature completion device and feature completion method embodiments provided in the above embodiments belong to the same concept. Therefore, for details not disclosed in the device embodiments of this specification, please refer to the feature completion method embodiments described above in this specification, and no further details will be given here.
[0152] The serial numbers of the embodiments of this specification are for description only and do not represent the advantages or disadvantages of the embodiments.
[0153] The embodiments of this specification also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned embodiments when executing the program.
[0154] Fig.11 Schematically shows a structural diagram of an electronic device according to an exemplary embodiment of this specification. Fig.11 As shown, the electronic device 1100 includes: a processor 1101 and a memory 1102 .
[0155] In the embodiments of this specification, the processor 1101 is the control center of the computer system, which can be the processor of a physical machine or the processor of a virtual machine. The processor 1101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1101 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 1101 may also include a main processor and a coprocessor, the main processor being a processor for processing data in the wake-up state; the coprocessor is a low-power processor for processing data in the standby state.
[0156] In the embodiment of this specification, the processor 1101 is specifically used for:
[0157] The target feature is input into a feature completion model, wherein the target feature includes one or more elements to be completed, and the multiple elements included in the target feature are used to reflect multiple attributes belonging to the same user; after being processed by the generator of the feature completion model, a target latent vector corresponding to the target feature is output, wherein the loss function of the generator of the feature completion model is determined based on display distribution modeling of sample user features, and the target latent vector includes a target continuous sub-feature and a target discrete sub-feature; and, based on the target continuous sub-feature determination and the target discrete sub-feature, the completion feature of the target feature is determined.
[0158] Furthermore, based on the aforementioned scheme, after the above-mentioned completion features are processed by the discriminator of the above-mentioned feature completion model, the output value of the above-mentioned discriminator is greater than a preset value, and the value of the above-mentioned preset value is greater than 0.5 and less than 1.
[0159] Furthermore, the above-mentioned determination of the complementary feature of the target feature based on the above-mentioned target continuous sub-feature and the above-mentioned target discrete sub-feature includes: determining the above-mentioned target continuous sub-feature as the continuous feature part in the above-mentioned complementary feature; obtaining the discrete feature part in the above-mentioned complementary feature after processing the above-mentioned target discrete sub-feature by a preset function; and determining the above-mentioned complementary feature based on the above-mentioned continuous feature part and the above-mentioned discrete feature part.
[0160] Furthermore, the discrete feature part in the above-mentioned complement feature is obtained after the above-mentioned target discrete sub-feature is processed by the preset function, including: the above-mentioned target discrete sub-feature is processed by the softmax function to obtain the target intermediate sub-feature; and the above-mentioned target intermediate sub-vector is processed by the argmax function to obtain the discrete feature part in the above-mentioned complement feature.
[0161] Furthermore, the processor 1101 is further configured to:
[0162] Before inputting the target features into the feature completion model, the positive samples and the negative samples are determined; the first parameter of the generator of the adversarial generator is fixed unchanged, and the discriminator of the adversarial generator is trained through the positive samples and the negative samples; the second parameter of the discriminator of the adversarial generator is fixed unchanged, and the generator of the adversarial generator is trained through the negative samples; and the trained adversarial generator is determined as the feature completion model.
[0163] Furthermore, the above-mentioned determination of positive samples includes: performing random element masking processing on the i-th sample user feature to obtain the i-th missing feature corresponding to the i-th sample user feature; and determining the i-th sample user feature and the i-th missing feature as the i-th positive sample, where i is a positive integer.
[0164] Furthermore, the above-mentioned determination of negative samples includes: performing random element masking processing on the j-th sample user feature to obtain the j-th missing feature corresponding to the j-th sample user feature; inputting the j-th missing feature and the randomly distributed sampling feature into the generator of the above-mentioned anti-generator, and determining the j-th generated feature corresponding to the j-th sample user feature according to the j-th generated latent vector output by the generator of the above-mentioned anti-generator; and, determining the j-th sample user feature and the j-th generated feature as the j-th negative sample, where j is a positive integer.
[0165] Further, the j-th generated feature includes: a j-th discrete feature portion and a j-th continuous feature portion;
[0166] The j-th generated feature corresponding to the j-th sample user feature is determined according to the j-th generated latent vector output by the generator of the anti-generator, including: the j-th discrete sub-feature in the j-th generated latent vector is processed by a softmax function to obtain the j-th intermediate sub-feature; the j-th intermediate sub-vector is processed by an argmax function to obtain the j-th discrete feature part in the j-th generated feature; and the j-th continuous sub-feature in the j-th generated latent vector is determined as the j-th continuous feature part in the j-th generated feature.
[0167] Furthermore, the discriminator of the adversarial generator is trained by the positive samples and the negative samples, including: inputting the positive samples into the discriminator of the adversarial generator to obtain the first class probability; inputting the negative samples into the discriminator of the adversarial generator to obtain the second class probability; and determining the discriminator loss function according to the first class probability and the second class probability, and optimizing the second parameter by maximizing the discriminator loss function to train the discriminator of the adversarial generator.
[0168] Furthermore, the above-mentioned training of the generator of the adversarial generator through the above-mentioned negative class samples includes: determining a supervision loss function according to the above-mentioned j-th generated feature and the above-mentioned j-th sample user feature; inputting the j-th continuous feature part of the above-mentioned j-th generated feature and the above-mentioned j-th missing feature into the above-mentioned discriminator after training to obtain a third type of probability; determining a continuous feature distribution loss function according to the above-mentioned third type of probability, and the above-mentioned continuous feature distribution loss function is determined based on the display distribution modeling of continuous features in sample user features; inputting the j-th discrete feature part of the above-mentioned j-th generated feature and the above-mentioned j-th missing feature into the above-mentioned discriminator after training to obtain a fourth type of probability; determining a reward operator according to the above-mentioned j-th intermediate sub-feature and the j-th discrete feature in the above-mentioned j-th generated feature; determining a discrete feature distribution loss function according to the above-mentioned fourth type of probability and the above-mentioned reward operator, and the above-mentioned discrete feature distribution loss function is determined based on the display distribution modeling of discrete features in sample user features; and, in combination with the above-mentioned supervision loss function, the above-mentioned discrete feature distribution loss function and the above-mentioned discrete feature distribution loss function, optimizing the above-mentioned first parameter to train the generator of the above-mentioned adversarial generator.
[0169] The memory 1102 may include one or more computer-readable storage media, which may be non-transitory. The memory 1102 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments of the present specification, the non-transitory computer-readable storage medium in the memory 1102 is used to store at least one instruction, which is used to be executed by the processor 1101 to implement the method in the embodiment of the present specification.
[0170] In some embodiments, the electronic device 1100 further includes: a peripheral device interface 1103 and at least one peripheral device. The processor 1101, the memory 1102 and the peripheral device interface 1103 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1103 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a display screen 1104, a camera 1105 and an audio circuit 1106.
[0171] The peripheral device interface 1103 may be used to connect at least one peripheral device related to input / output (I / O) to the processor 1101 and the memory 1102. In some embodiments of the present specification, the processor 1101, the memory 1102, and the peripheral device interface 1103 are integrated on the same chip or circuit board; in some other embodiments of the present specification, any one or two of the processor 1101, the memory 1102, and the peripheral device interface 1103 may be implemented on a separate chip or circuit board. This embodiment of the present specification does not specifically limit this.
[0172] The display screen 1104 is used to display a user interface (UI). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1104 is a touch display screen, the display screen 1104 also has the ability to collect touch signals on the surface or above the surface of the display screen 1104. The touch signal can be input to the processor 1101 as a control signal for processing. At this time, the display screen 1104 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments of the present specification, the display screen 1104 can be one, and the front panel of the electronic device 1100 is set; in other embodiments of the present specification, the display screen 1104 can be at least two, which are respectively set on different surfaces of the electronic device 1100 or are folded; in some other embodiments of the present specification, the display screen 1104 can be a flexible display screen, which is set on the curved surface or folded surface of the electronic device 1100. Even, the display screen 1104 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1104 can be made of materials such as a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
[0173] Camera 1105 is used to capture images or videos. Optionally, camera 1105 includes a front camera and a rear camera. Usually, the front camera is arranged on the front panel of the electronic device, and the rear camera is arranged on the back of the electronic device. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and the virtual reality (VR) shooting function or other fusion shooting functions. In some embodiments of the present specification, camera 1105 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. Dual-color temperature flash refers to a combination of warm light flash and cold light flash, which can be used for light compensation at different color temperatures.
[0174] The audio circuit 1106 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1101 for processing. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the electronic device 1100. The microphone may also be an array microphone or an omnidirectional collection microphone.
[0175] The power supply 1107 is used to power various components in the electronic device 1100. The power supply 1107 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1107 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged through a wired line, and a wireless rechargeable battery is a battery that is charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0176] The electronic device structure block diagram shown in the embodiment of this specification does not constitute a limitation on the electronic device 1100. The electronic device 1100 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0177] In the description of this specification, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in this specification can be understood according to specific circumstances. In addition, in the description of this specification, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.
[0178] The embodiments of this specification also provide a computer-readable storage medium, which stores instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes one or more steps in the above embodiments. If the components of the above feature completion device are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium.
[0179] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer program instructions are loaded and executed on a computer, the above process or function according to the embodiment of this specification is generated in whole or in part. The above computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above computer instructions can be stored in a computer-readable storage medium or transmitted by the above computer-readable storage medium. The above computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The above computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The above-mentioned available media can be magnetic media (for example, floppy disks, hard disks, tapes), optical media (for example, digital versatile discs (DVD)), or semiconductor media (for example, solid state drives (SSD)), etc.
[0180] It should be noted that the above description is of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0181] The above is only a specific implementation of this specification, but the protection scope of this specification is not limited to this. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this specification, which should be included in the protection scope of this specification. Therefore, equivalent changes made according to the claims of this specification are still within the scope covered by this specification.
Claims
1. A feature completion model training method, wherein: The method comprises: Determine the positive samples and the negative samples; The first parameter of the generator of the adversarial generator is fixed unchanged, and the discriminator of the adversarial generator is trained by the positive class samples and the negative class samples; The second parameter of the discriminator of the adversarial generator is fixed unchanged, and the generator of the adversarial generator is trained by using the negative class samples; The trained adversarial generator is determined as the feature completion model.
2. The method according to claim 1, wherein: The determining of the positive sample comprises: Perform random element masking processing on the i-th sample user feature to obtain the i-th missing feature corresponding to the i-th sample user feature; The i-th sample user feature and the i-th missing feature are determined as the i-th positive class sample, where i is a positive integer.
3. The method according to claim 1, wherein: The determining of negative samples comprises: Perform random element masking processing on the j-th sample user feature to obtain the j-th missing feature corresponding to the j-th sample user feature; Inputting the j-th missing feature and the randomly distributed sampling feature into the generator of the adversarial generator, and determining the j-th generated feature corresponding to the j-th sample user feature according to the j-th generated latent vector output by the generator of the adversarial generator; The j-th sample user feature and the j-th generated feature are determined as the j-th negative class sample, where j is a positive integer.
4. The method according to claim 3, wherein: The jth generated feature includes: a jth discrete feature part and a jth continuous feature part; The determining, according to the j-th generated latent vector output by the generator of the adversarial generator, the j-th generated feature corresponding to the j-th sample user feature comprises: Processing the j-th discrete sub-feature in the j-th generated latent vector output by the generator of the adversarial generator through a softmax function to obtain the j-th intermediate sub-feature; The j-th intermediate sub-vector is processed by an argmax function to obtain a j-th discrete feature part in the j-th generated feature; The j-th continuous sub-feature in the j-th generated latent vector is determined as the j-th continuous feature part in the j-th generated feature.
5. The method according to any one of claims 1 to 4, wherein: The step of training the discriminator of the adversarial generator by using the positive samples and the negative samples includes: Inputting the positive class sample into the discriminator of the anti-generator to obtain the first class probability; Inputting the negative class sample into the discriminator of the anti-generator to obtain the second class probability; A discriminator loss function is determined according to the first class probability and the second class probability, and the second parameter is optimized by maximizing the discriminator loss function to train the discriminator of the adversarial generator.
6. The method according to claim 4, wherein: The step of training the generator of the adversarial generator by using the negative class samples includes: Determining a supervision loss function according to the j-th generated feature and the j-th sample user feature; Inputting the j-th continuous feature part and the j-th missing feature in the j-th generated feature into the trained discriminator to obtain a third class probability; Determining a continuous feature distribution loss function according to the third type of probability, wherein the continuous feature distribution loss function is determined based on display distribution modeling of continuous features in sample user features; Inputting the j-th discrete feature part of the j-th generated feature and the j-th missing feature into the trained discriminator to obtain a fourth category probability; Determining a reward operator according to the j-th discrete feature in the j-th intermediate sub-feature and the j-th generated feature; Determining a discrete feature distribution loss function according to the fourth type of probability and the reward operator, wherein the discrete feature distribution loss function is determined based on display distribution modeling of discrete features in sample user features; In combination with the supervised loss function, the discrete feature distribution loss function, and the discrete feature distribution loss function, the first parameter is optimized to train the generator of the adversarial generator.
7. The method according to claim 1, wherein: After determining the trained adversarial generator as the feature completion model, the method further includes: Inputting a target feature into the feature completion model, wherein the target feature includes one or more elements to be completed, and the multiple elements included in the target feature are used to reflect multiple attributes belonging to the same user; After being processed by the generator of the feature completion model, a target latent vector corresponding to the target feature is output, wherein the loss function of the generator of the feature completion model is determined based on display distribution modeling of sample user features, and the target latent vector includes a target continuous sub-feature and a target discrete sub-feature; A complement feature of the target feature is determined according to the target continuous sub-feature and the target discrete sub-feature.
8. The method according to claim 7, wherein: After the completed features are processed by the discriminator of the feature completion model, an output value of the discriminator obtained is greater than a preset value, and the preset value is greater than 0.5 and less than 1.
9. The method according to claim 7, wherein: The determining, according to the target continuous sub-feature and the target discrete sub-feature, a complementary feature of the target feature comprises: Determine the target continuous sub-feature as the continuous feature part in the complement feature; After processing the target discrete sub-features by a preset function, a discrete feature part in the complement feature is obtained; The complement feature is determined according to the continuous feature portion and the discrete feature portion.
10. The method according to claim 9, wherein: The step of obtaining the discrete feature part in the complement feature after processing the target discrete sub-feature by a preset function includes: The target discrete sub-features are processed by a softmax function to obtain target intermediate sub-features; The target intermediate sub-vector is processed by the argmax function to obtain the discrete feature part in the complement feature.
11. The method according to any one of claims 1 to 8, wherein: The feature completion model includes: A generator, configured to receive a target feature, wherein the target feature includes one or more elements to be completed, and the multiple elements included in the target feature are used to reflect multiple attributes belonging to the same user; The generator is further used to process the target feature to obtain a target latent vector corresponding to the target, wherein the loss function of the generator of the feature completion model is determined based on the display distribution modeling of the sample user features, and the target latent vector includes a target continuous sub-feature and a target discrete sub-feature; The latent vector processing module is used to determine the complementary features of the target features according to the target continuous sub-features and the target discrete sub-features.
12. A feature completion model training device, wherein: The device comprises: A sample determination module is used to determine positive samples and negative samples; A discriminator training module, used to fix the first parameter of the generator of the adversarial generator unchanged, and train the discriminator of the adversarial generator through the positive class samples and the negative class samples; A generator training module, used to fix the second parameter of the discriminator of the adversarial generator unchanged, and train the generator of the adversarial generator through the negative class samples; The model training module is used to determine the trained adversarial generator as a feature completion model.
13. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer or a processor, the computer or the processor executes the feature completion model training method as described in any one of claims 1 to 11.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the feature completion model training method as described in any one of claims 1 to 11 is implemented.
15. A computer program product comprising instructions, which, when executed on a computer or a processor, enables the computer or the processor to execute the feature completion model training method as described in any one of claims 1 to 11.