CN114021010A - Training method, device and equipment of information recommendation model - Google Patents

Training method, device and equipment of information recommendation model Download PDF

Info

Publication number
CN114021010A
CN114021010A CN202111294582.5A CN202111294582A CN114021010A CN 114021010 A CN114021010 A CN 114021010A CN 202111294582 A CN202111294582 A CN 202111294582A CN 114021010 A CN114021010 A CN 114021010A
Authority
CN
China
Prior art keywords
data
pieces
information recommendation
recommendation model
feature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111294582.5A
Other languages
Chinese (zh)
Inventor
曾程
佘琪
王长虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202111294582.5A priority Critical patent/CN114021010A/en
Publication of CN114021010A publication Critical patent/CN114021010A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a training method, a training device and training equipment of an information recommendation model, wherein at least two pieces of sample data are input into the information recommendation model to obtain first characteristic data and second characteristic data. And calculating a loss value according to the difference between the first characteristic data and the second characteristic data of the same sample data, and the difference between the first characteristic data and the second characteristic data of different sample data. And adjusting the model parameters of the information recommendation model by using the loss value. And when the stopping condition is reached, obtaining the initialized model parameters of the information recommendation model. And adjusting the model parameters of the information recommendation model on the basis of the initialized model parameters by using the training data, and finally obtaining the trained information recommendation model. The method has the advantages that the self-supervision pre-training is carried out in unbalanced sample data, and the initialization model parameters irrelevant to the label are obtained, so that the feature representation of the training data is more generalized by the information recommendation model during model training, and the accuracy of the information recommendation model is improved.

Description

Training method, device and equipment of information recommendation model
Technical Field
The application relates to the technical field of data processing, in particular to a training method, a training device and training equipment for an information recommendation model.
Background
With the continuous development of internet technology, various information such as advertisement information, commodity information, etc. is rapidly generated and continuously increased. In the information explosion stage, the user needs to spend a lot of time to find the information of interest. Based on the above, the recommendation system is produced and rapidly developed. The recommendation system can determine information which is interesting to the user from massive data information and recommend the information to the user, so that a great amount of time spent by the user for browsing irrelevant information is saved.
In practical application, a large amount of sample data, such as user behavior data and recommended object data, needs to be collected first. And the sample data corresponds to a recommendation label, and the sample data and the recommendation label are utilized to train the recommendation system. The recommendation label corresponding to the sample data can be determined according to whether the user generates an interactive behavior with the recommendation object. However, the user usually only has an interest in a part of the recommended objects, that is, the user only interacts with a small part of the recommended objects, so that the label distribution of the sample data is unbalanced. The recommendation system is trained based on sample data with unbalanced label distribution, which causes poor generalization performance of the recommendation system.
Disclosure of Invention
In view of this, embodiments of the present application provide a training method, an apparatus, and a device for an information recommendation model, which improve generalization capability of the information recommendation model by using an obtained initialization model parameter of the information recommendation model.
In order to solve the above problem, the technical solution provided by the embodiment of the present application is as follows:
in a first aspect, an embodiment of the present application provides a training method for an information recommendation model, where the method includes:
inputting at least two pieces of sample data into an information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of sample data; the sample data comprises user behavior data and recommendation object data;
inputting the at least two pieces of sample data into the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of sample data;
calculating a loss value according to the difference between the first characteristic data and the second characteristic data of the same sample data, and the difference between the first characteristic data and the second characteristic data of different sample data or the difference between the second characteristic data;
adjusting model parameters of the information recommendation model by using the loss value, repeatedly executing the input of at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain initialization model parameters of the information recommendation model;
and adjusting the model parameters of the information recommendation model on the basis of the initialization model parameters of the information recommendation model by using training data to obtain the trained information recommendation model.
In a second aspect, an embodiment of the present application provides an apparatus for training an information recommendation model, where the apparatus includes:
the first feature extraction unit is used for inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of sample data; the sample data comprises user behavior data and recommendation object data;
the second feature extraction unit is used for inputting the at least two pieces of sample data into the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of sample data;
the calculation unit is used for calculating a loss value according to the difference between the first characteristic data and the second characteristic data of the same sample data, and the difference between the first characteristic data or the second characteristic data of different sample data;
the execution unit is used for adjusting the model parameters of the information recommendation model by using the loss value, repeatedly executing the step of inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain the initialization model parameters of the information recommendation model;
and the adjusting unit is used for adjusting the model parameters of the information recommendation model on the basis of the initialization model parameters of the information recommendation model by using the training data to obtain the trained information recommendation model.
In a third aspect, an embodiment of the present application provides an electronic device, including:
one or more processors;
a storage device having one or more programs stored thereon,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for training the information recommendation model described above.
In a third aspect, the present application provides a computer readable medium, on which a computer program is stored, where the program is executed by a processor to implement the training method of the information recommendation model as described above.
Therefore, the embodiment of the application has the following beneficial effects:
the embodiment of the application provides a training method, a training device and training equipment for an information recommendation model. The sample data comprises user behavior data and recommendation object data. And inputting at least two pieces of sample data into the information recommendation model, and performing second data characteristic extraction to obtain second characteristic data of the at least two pieces of sample data. The first characteristic data and the second characteristic data of each piece of sample data are similar. It is generally necessary to make the difference between the first feature data and the second feature data of the same sample data smaller, and make the difference between the first feature data and the second feature data of different sample data larger. Therefore, a loss function is designed and a loss value is calculated according to the difference between the first characteristic data and the second characteristic data of the same sample data, and the difference between the first characteristic data and the second characteristic data of different sample data. And adjusting model parameters of the information recommendation model by using the loss value, repeatedly inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain initialization model parameters of the information recommendation model. Based on the information recommendation model, model parameters of the information recommendation model are adjusted on the basis of the initialization model parameters of the information recommendation model by using the training data, and the trained information recommendation model is obtained. In the embodiment of the application, the self-supervision pre-training of the information recommendation model is firstly carried out on the basis of sample data of label-free information. The label information is not used, and initialization model parameters irrelevant to the label are obtained through learning of a large number of sample data features. When the information recommendation model is formally trained, the obtained initialization model parameters enable the information recommendation model to more generalize and have more robustness on the feature representation of training data, and further the expressiveness and the accuracy of the trained information recommendation model are improved.
Drawings
Fig. 1 is a schematic diagram of a framework of an exemplary application scenario provided in an embodiment of the present application;
fig. 2 is a flowchart of a training method of an information recommendation model according to an embodiment of the present application;
fig. 3 is a schematic diagram of an information recommendation model according to an embodiment of the present application;
FIG. 4 is a schematic diagram of another information recommendation model provided in an embodiment of the present application;
fig. 5 is a flowchart of a training method for an information recommendation model according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a training apparatus for an information recommendation model according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanying the drawings are described in detail below.
In order to facilitate understanding and explaining the technical solutions provided by the embodiments of the present application, the following description will first describe the background art of the present application.
With the continuous development of internet technology, various information such as advertisement information, commodity information, etc. is rapidly generated and continuously increased. In the information explosion stage, the user needs to spend a lot of time to find the information of interest. Based on the above, the recommendation system is produced and rapidly developed. The recommendation system can determine information which is interesting to the user from massive data information and recommend the information to the user, so that a great amount of time spent by the user for browsing irrelevant information is saved.
In practical application, a large amount of sample data, such as user behavior data and recommended object data, needs to be collected first. The sample data corresponds to a recommendation tag, for example, 1 is recommended and 0 is not recommended. The recommendation system can be trained by using the sample data and the corresponding recommendation label. The recommendation label corresponding to the sample data can be determined according to whether the user generates an interactive behavior with the recommendation object. However, usually the user is only interested in a part of the recommended objects, i.e. the user only generates interactive behavior with a small part of the recommended objects. This makes the recommended label corresponding to only a small amount of sample data 1, which causes the problem of unbalanced label distribution. Furthermore, the recommendation system performs training based on sample data with unevenly distributed labels, so that the learning effect on the recommendation objects which are interested by the user is better, and the generalization effect on the recommendation objects which are not interested by the user is poor. Therefore, the problem of poor generalization performance of the recommendation system caused by high imbalance of label distribution of sample data needs to be solved urgently.
Based on this, the embodiment of the application provides a training method, a training device and training equipment for an information recommendation model, wherein at least two pieces of sample data are input into the information recommendation model, and first data feature extraction is performed to obtain first feature data of the at least two pieces of sample data. The sample data comprises user behavior data and recommendation object data. And inputting at least two pieces of sample data into the information recommendation model, and performing second data characteristic extraction to obtain second characteristic data of the at least two pieces of sample data. The first characteristic data and the second characteristic data of each piece of sample data are similar. It is generally necessary to make the difference between the first feature data and the second feature data of the same sample data smaller, and make the difference between the first feature data and the second feature data of different sample data larger. Therefore, a loss function is designed and a loss value is calculated according to the difference between the first characteristic data and the second characteristic data of the same sample data, and the difference between the first characteristic data and the second characteristic data of different sample data. And adjusting model parameters of the information recommendation model by using the loss value, repeatedly inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain initialization model parameters of the information recommendation model. Based on the information recommendation model, model parameters of the information recommendation model are adjusted on the basis of the initialization model parameters of the information recommendation model by using the training data, and the trained information recommendation model is obtained. In the embodiment of the application, the self-supervision pre-training of the information recommendation model is firstly carried out on the basis of sample data of label-free information. The label information is not used, and initialization model parameters irrelevant to the label are obtained through learning of a large number of sample data features. When the information recommendation model is formally trained, the obtained initialization model parameters enable the information recommendation model to more generalize and have more robustness on the feature representation of training data, and further the expressiveness of the trained information recommendation model is improved.
In order to facilitate understanding of the training method of the information recommendation model provided in the embodiment of the present application, the following description is made with reference to a scenario example shown in fig. 1. Referring to fig. 1, the drawing is a schematic diagram of a framework of an exemplary application scenario provided in an embodiment of the present application.
In practical application, at least two pieces of sample data are input into the information recommendation model, and first data feature extraction is carried out to obtain first feature data of the at least two pieces of sample data. The sample data comprises user behavior data and recommendation object data.
And inputting the at least two pieces of sample data into the information recommendation model, and performing second data characteristic extraction to obtain second characteristic data of the at least two pieces of sample data. It will be appreciated that the first and second characteristic data of each sample datum are similar.
And calculating a loss value according to the difference between the first characteristic data and the second characteristic data of the same sample data, and the difference between the first characteristic data and the second characteristic data of different sample data or the difference between the second characteristic data. And adjusting model parameters of the information recommendation model by using the loss value, pre-training the information recommendation model, repeatedly inputting at least two pieces of sample data into the information recommendation model, and performing first data characteristic extraction and subsequent steps until a stop condition is reached to obtain initialization model parameters of the information recommendation model.
Further, model parameters of the information recommendation model are adjusted on the basis of the initialization model parameters of the information recommendation model by using the training data, and the trained information recommendation model is obtained.
Those skilled in the art will appreciate that the block diagram shown in fig. 1 is only one example in which embodiments of the present application may be implemented. The scope of applicability of the embodiments of the present application is not limited in any way by this framework.
In order to facilitate understanding of the present application, a method for training an information recommendation model provided in an embodiment of the present application is described below with reference to the accompanying drawings.
Referring to fig. 2, the figure is a flowchart of a training method of an information recommendation model according to an embodiment of the present application. As shown in fig. 2, the method may include S201-S205:
s201: inputting at least two pieces of sample data into an information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of sample data; the sample data includes user behavior data and recommendation object data.
The sample data includes user behavior data and recommended object data. The user behavior data comprises information data such as user gender, user identity information, user age and user address. The recommendation object data includes object data such as a category and a click rate of a recommendation object, and the recommendation object may be an advertisement, a commodity, a video, and the like.
The number of sample data input to the information recommendation model each time is at least two, for example, 256 sample data input to one group each time. Sample data of each-time input information recommendation model can be represented as x1,x2,...,xNAnd N is a positive integer greater than or equal to 2. Wherein x isiI ═ 1, 2.., N, for the ith sample data. When the sample data is input into the information recommendation model, data feature extraction operation is performed on the sample data, and the extracted features are expressed in a vector form and used for representing the sample data.
In order to prevent the information recommendation model from being over-fitted and enhance the generalization capability of the information recommendation model, the first characteristic data is acquired by using the information recommendation model in a data enhancement mode. The first characteristic data may be ziIs represented by ziFirst feature data representing the ith sample data.
In specific implementation, a data enhancement mode is adopted, at least two pieces of sample data are input into the information recommendation model, the first data feature extraction is performed, and implementation modes of obtaining the first feature data of the at least two pieces of sample data can be various, and the embodiment of the application is described in the following three optional modes:
in a first optional mode, after performing a first random masking operation on at least two pieces of sample data, inputting an information recommendation model to obtain first feature data of the at least two pieces of sample data.
The first random masking operation is to randomly select and mask some data in the sample data, and the masked data is filled with 0. The first random masking operation makes the sample data satisfy randomness to prevent the information recommendation model from being over-fitted.
In a second optional mode, a first random zero setting operation is performed on hidden node weights of the information recommendation model, and at least two pieces of sample data are input into the information recommendation model to obtain first feature data of the at least two pieces of sample data.
The first random zero setting operation is specifically to randomly select some weights in hidden node weights of the information recommendation model, and zero setting operation is performed on the randomly selected weights. As an example, the first random zero setting operation is a Dropout operation, that is, in the pre-training process of the information recommendation model, for the hidden node weight, it is temporarily discarded from the network according to a certain probability. The Dropout operation prevents the information recommendation model from being over-fitted by making the hidden node neurons unreliable.
In a third optional mode, a first random zero setting operation is performed on hidden node weights of the information recommendation model, and first random mask operation is performed on at least two pieces of sample data and then the sample data is input into the information recommendation model to obtain first feature data of the at least two pieces of sample data.
That is to say, in the third optional manner, not only the first random zero setting operation is performed on the hidden node weight of the information recommendation model, but also the first random mask operation is performed on at least two pieces of sample data, so that overfitting of the information recommendation model can be prevented, and the generalization capability of the information recommendation model is enhanced.
It can be understood that, in order to alleviate the problem of poor generalization performance of the information recommendation model caused by sample data imbalance, the embodiment of the application performs self-supervision pre-training on the information recommendation model. The self-supervision pre-training is a training process of label-free information and is performed before formal training of the information recommendation model. And training the information recommendation model based on the label information is needed during formal training. In the pre-training process, label information is abandoned first, and the pre-training purpose is to obtain the initialized model parameters of the information recommendation model irrelevant to the label. It should be noted that the contents of S201-S204 are processes for obtaining initialization model parameters. S205 is a process of training information recommendation model formally on the basis of initializing model parameters.
S202: and inputting at least two pieces of sample data into the information recommendation model, and performing second data characteristic extraction to obtain second characteristic data of the at least two pieces of sample data.
In order to perform the self-supervision pre-training on the information recommendation model to obtain the initialization model parameters unrelated to the label, a proper self-supervision loss function needs to be constructed.
Based on the method, in the step, at least two pieces of sample data are input into the information recommendation model, and second data feature extraction is carried out to obtain second feature data of the at least two pieces of sample data. The second characteristic data can be zi' to make an expression, zi' denotes second feature data of the ith sample data. IntoAnd constructing an auto-supervision loss function on the basis of the first characteristic data and the second characteristic data.
In some possible implementation manners, in order to prevent the information recommendation model from being over-fitted and enhance the generalization capability of the information recommendation model, the embodiment of the present application provides three specific implementation manners in which at least two pieces of sample data are input into the information recommendation model, and second data feature extraction is performed to obtain second feature data of the at least two pieces of sample data, including:
performing second random mask operation on at least two pieces of sample data, and inputting an information recommendation model to obtain second characteristic data of the at least two pieces of sample data;
or, performing a second random zero setting operation on the hidden node weight of the information recommendation model, and inputting at least two pieces of sample data into the information recommendation model to obtain second characteristic data of the at least two pieces of sample data;
or, performing a second random zero setting operation on the hidden node weight of the information recommendation model, performing a second random mask operation on at least two pieces of sample data, and inputting the sample data into the information recommendation model to obtain second characteristic data of the at least two pieces of sample data.
It is understood that the above three ways of acquiring the second feature data are similar to those in S201, and for brevity, detailed description is omitted here, and detailed information may refer to S201.
It should be noted that, in the embodiment of the present application, the first random masking operation is different from the second random masking operation, that is, data in sample data masked when the first random masking operation is performed is different from data in sample data masked when the second random masking operation is performed. And the first random zero setting operation is different from the second random zero setting operation, namely the hidden node with the weight set to zero when the first random zero setting operation is carried out is different from the hidden node with the weight set to zero when the second random zero setting operation is carried out. Therefore, based on the same sample data, the first characteristic data and the second characteristic data corresponding to the same sample data can be extracted, but the first characteristic data and the second characteristic data may be different.
It should be noted that, the embodiment of the present application does not limit the specific implementation order of S201 and S202. In one possible implementation, S202 may be performed first, and then S201 may be performed.
S203: and calculating a loss value according to the difference between the first characteristic data and the second characteristic data of the same sample data, and the difference between the first characteristic data and the second characteristic data of different sample data or the difference between the second characteristic data.
After the first characteristic data and the second characteristic data of at least two pieces of sample data are obtained, it can be known that each piece of sample data corresponds to one piece of first characteristic data and one piece of second characteristic data. In practical applications, it is required that the difference between the first feature data and the second feature data corresponding to the same sample data is as small as possible. The difference between the first feature data or the difference between the second feature data of different sample data is as large as possible. It is to be understood that the first feature data and the second feature data are both represented by vectors.
Therefore, an automatic supervision loss function is constructed and a loss value is calculated based on the difference between the first characteristic data and the second characteristic data of the same sample data and the difference between the first characteristic data and the second characteristic data of different sample data.
In some possible implementations, the present application provides two specific implementations of calculating the loss value according to the difference between the first feature data and the second feature data of the same sample data, and the difference between the first feature data of different sample data or the difference between the second feature data:
in a first optional manner, a first angle difference between the first feature data and the second feature data of each sample data in the feature vector space is calculated, a second angle difference between the first feature data of each two different sample data in the feature vector space is calculated, and the loss value is calculated according to each first angle difference, each second angle difference and the number of the sample data.
In this alternative, the auto-supervised loss function is:
Figure BDA0003336160370000061
wherein L isselfIs an auto-supervision loss function; { xiIs sample data x1,x2,...,xN(ii) a h is a first feature extraction function, zi=h(xi) (ii) a g is a second feature extraction function, z'i=g(xi);[N]Is 1,2,. cndot.n; n is the number of sample data; s (z)i,z'i) Is ziAnd z'iThe cosine value of (a) is used to represent a difference between first characteristic data and second characteristic data of the same sample data, i.e., a first angular difference. Tau is the annealing temperature; exp (s (z)i,z'i) τ) is s (z)i,z'i) And/tau is an exponential function of power. j is 1, 2.. ang.N, j is different from i, xjIs the jth sample data. s (z)i,zj) Is ziAnd zjThe cosine value of (a) is used to represent the cosine values of the first characteristic data of the ith sample data and the first characteristic data of the jth sample data, i.e. the second angle difference of the first characteristic data of two different sample data in the characteristic vector space. exp (s (z)i,zj) τ) is s (z)i,zj) And/tau is an exponential function of power.
In a second alternative, a first angle difference between the first feature data and the second feature data of each sample data in the feature vector space is calculated, a third angle difference between the second feature data of each two different sample data in the feature vector space is calculated, and the loss value is calculated according to each first angle difference, each third angle difference and the number of the sample data.
In this alternative, the auto-supervised loss function is:
Figure BDA0003336160370000071
wherein L isselfIs an auto-supervision loss function; { xiIs sample data x1,x2,...,xN(ii) a h is firstFeature extraction function, zi=h(xi) (ii) a g is a second feature extraction function, z'i=g(xi);[N]Is 1,2,. cndot.n; n is the number of sample data; s (z)i,z'i) Is ziAnd z'iThe cosine value of (a) is used to represent a difference between first characteristic data and second characteristic data of the same sample data, i.e., a first angular difference. Tau is the annealing temperature; exp (s (z)i,z'i) τ) is s (z)i,z'i) And/tau is an exponential function of power. j is 1, 2.. ang.N, j is different from i, xjIs the jth sample data. s (z'i,z'j) Is z'iAnd z'jThe cosine value of (3) is used to represent the cosine values of the second feature data of the ith sample data and the second feature data of the jth sample data, i.e. the third angle difference of the second feature data of two different sample data in the feature vector space. exp (s (z'i,z'j) τ) is s (z'i,z'j) And/tau is an exponential function of power.
In practical application, after the first characteristic data and the second characteristic data of each sample data are obtained, the loss value can be calculated by determining the self-supervision loss function.
S204: and adjusting model parameters of the information recommendation model by using the loss value, repeatedly inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain initialization model parameters of the information recommendation model.
In order to make the difference between the first feature data and the second feature data corresponding to the same sample data as small as possible, the difference between the first feature data and the second feature data of different sample data is as large as possible, and it is necessary to make the loss value as small as possible.
Thus, after the loss value is acquired, it is determined whether or not the stop condition is reached. The stopping condition may be that the loss value reaches a preset range, or the number of times of adjusting the model parameter reaches a threshold number. It can be understood that the preset range is a smaller range, and the preset range and the time threshold are not limited in the embodiment of the present application, and may be limited according to the requirements of the actual application scenario.
When the stop condition is not reached, the model parameters of the information recommendation model need to be adjusted. As an alternative example, the model parameters of the information recommendation model may be adjusted using a loss value and gradient descent method. After the model parameters are adjusted, inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until the loss value is reduced to a preset range or the number of times of adjusting the model parameters reaches a threshold value.
And when the stopping condition is reached, obtaining the initialization model parameters of the information recommendation model.
S205: and adjusting the model parameters of the information recommendation model on the basis of the initialization model parameters of the information recommendation model by using the training data to obtain the trained information recommendation model.
After the initialization model parameters of the information recommendation model are obtained, the self-supervision pre-training of the information recommendation model is completed. Based on the information recommendation model, the information recommendation model is trained by using the training data, model parameters are adjusted on the basis of initializing the model parameters, and finally the trained information recommendation model is obtained.
It should be noted that the training data includes not only the sample data, but also the label information corresponding to the sample data. For example, the sample data includes user behavior data and recommended object data. The user behavior data comprises data such as user gender, user identity information, user age and user address. When the recommendation object is an advertisement, the recommendation object data includes data such as detailed content of the recommendation advertisement, a category of the recommendation advertisement, and a click rate of the recommendation advertisement. The label information corresponding to the sample data is recommended or not recommended.
Based on the contents of S201-S205, an information recommendation model is automatically supervised and pre-trained based on sample data of unlabeled information. Namely, label information is not used, and initialization model parameters irrelevant to labels are obtained through learning a large amount of sample data. When the information recommendation model is formally trained, the obtained initialization model parameters enable the information recommendation model to more generalize and have more robustness on the feature representation of training data, and further the expressiveness and the accuracy of the trained information recommendation model are improved.
It should be noted that the information recommendation model in S201-S205 is a single tower model. As shown in fig. 3, fig. 3 is a schematic diagram of an information recommendation model provided in an embodiment of the present application. In fig. 3, the information recommendation model is a single tower model. The sample data is directly input into the information recommendation model, and first data characteristic extraction and second data characteristic extraction can be performed on the sample data to obtain first characteristic data and second characteristic data.
In addition, the information recommendation model can also adopt a double-tower model structure. As shown in fig. 4, fig. 4 is a schematic diagram of another information recommendation model provided in the embodiment of the present application. In fig. 4, the information recommendation model is a double-tower model, and is composed of a user data feature extraction submodel and a recommendation object feature extraction submodel, and feature extraction is performed on sample data by using the double-tower model.
Based on the dual-tower model structure of fig. 4, the embodiment of the present application provides a flowchart of another training method of the information recommendation model shown in fig. 5. As shown in fig. 5, the method includes S501-S508:
s501: and inputting the at least two pieces of user behavior data into a user data feature extraction submodel in the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of user behavior data.
Each piece of sample data includes user behavior data and recommendation object data. The information recommendation model comprises a user data feature extraction submodel and a recommendation object feature extraction submodel. The user data feature extraction submodel is used for inputting user behavior data and extracting features of the user behavior data. And the recommended object feature extraction sub-model is used for inputting recommended object data and extracting features of the recommended object data.
In specific implementation, as shown in fig. 4, at least two pieces of user behavior data are input into the user data feature extraction submodel, and first data feature extraction is performed to obtain first feature data of the at least two pieces of user behavior data.
The first feature data of the user behavior data is data obtained by extracting features of the user behavior data, and can be represented by a vector.
In some possible implementation manners, embodiments of the present application provide a specific implementation manner in which at least two pieces of user behavior data are input into a user data feature extraction submodel in an information recommendation model, and first data feature extraction is performed to obtain first feature data of the at least two pieces of user behavior data, which is specifically referred to as a1-A3 below.
S502: and inputting at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of recommended object data.
As shown in fig. 4, at least two pieces of recommendation object data in the sample data are input into the recommendation object feature extraction submodel in the information recommendation model, and first data feature extraction is performed to obtain first feature data of the at least two pieces of recommendation object data.
The first feature data of the recommendation target data is data obtained by extracting features of the recommendation target data, and is represented by a vector.
It is understood that the first feature data includes first feature data of user behavior data and first feature data of recommendation object data.
In some possible implementation manners, embodiments of the present application provide a specific implementation manner in which at least two pieces of recommended object data are input into a recommended object feature extraction submodel in an information recommendation model, and first data feature extraction is performed to obtain first feature data of the at least two pieces of recommended object data, which is specifically referred to as B1-B3 below.
It is understood that S501-S502 are a specific implementation manner of S201 when the information recommendation model is a double-tower model, that is, inputting at least two sample data into the information recommendation model, and performing a first data feature extraction to obtain first feature data of the at least two sample data, including: inputting at least two pieces of user behavior data into a user data feature extraction submodel in an information recommendation model, and performing first data feature extraction to obtain first feature data of at least two pieces of user behavior data; and inputting at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of recommended object data.
It should be noted that the embodiment of the present application does not limit the specific implementation order of S501 and S502. As an alternative example, S502 may be performed first, and then S501 may be performed.
S503: and inputting the at least two pieces of user behavior data into a user data feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of user behavior data.
Similarly, as shown in fig. 4, at least two pieces of recommendation object data in the sample data may also be input into the user data feature extraction submodel in the information recommendation model, and second data feature extraction is performed to obtain second feature data of the at least two pieces of user data.
And the second characteristic data of the user behavior data is data obtained by performing second data characteristic extraction on the user behavior data by using the user data characteristic extraction submodel and is represented by a vector.
In some possible implementations, embodiments of the present application provide a specific implementation that the at least two pieces of user behavior data are input into a user data feature extraction submodel in the information recommendation model, and a second data feature extraction is performed to obtain second feature data of the at least two pieces of user behavior data, which is specifically referred to as C1-C3 below.
S504: and inputting the at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of recommended object data.
Similarly, as shown in fig. 4, at least two pieces of recommendation object data in the sample data may also be input into the recommendation object feature extraction submodel in the information recommendation model, and second data feature extraction may be performed to obtain second feature data of the at least two pieces of recommendation object data.
The second feature data of the recommendation object data is data obtained by performing second data feature extraction on the recommendation object data by using the recommendation object feature extraction submodel, and is represented by a vector.
It is understood that the second feature data includes second feature data of the user behavior data and second feature data of the recommended object data.
In some possible implementations, embodiments of the present application provide a specific implementation that at least two pieces of recommended object data are input into a recommended object feature extraction submodel in an information recommendation model, and second data feature extraction is performed to obtain second feature data of the at least two pieces of recommended object data, which is specifically referred to as D1-D3 below.
It is understood that S503-S504 are a specific implementation manner of S202 when the information recommendation model is a double-tower model, that is, inputting at least two sample data into the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two sample data, including: inputting at least two pieces of user behavior data into a user data feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of at least two pieces of user behavior data; and inputting the at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of recommended object data.
The present embodiment does not limit the specific implementation order of S503 and S504. As an alternative example, S504 may be performed first, and then S503 may be performed. The specific implementation sequence of S501-S502 and S503-S504 is not limited in the embodiments of the present application. As an alternative example, S503-S504 may be performed first, followed by S501-S502.
S505: and calculating a first sub-loss value according to the difference between the first characteristic data and the second characteristic data of the same user behavior data and the difference between the first characteristic data or the second characteristic data of different user behavior data.
It will be appreciated that the first sub-loss value is used for the self-supervised pre-training of the user data feature extraction sub-model. The aim is to make the difference between the first characteristic data and the second characteristic data of the same user behavior data as small as possible, and the difference between the first characteristic data or the difference between the second characteristic data of different user behavior data as large as possible.
In some possible implementations, embodiments of the present application provide a specific implementation manner for calculating the first sub-loss value according to a difference between the first feature data and the second feature data of the same user behavior data, and a difference between the first feature data or the second feature data of different user behavior data, see, for example, E1-E2 below.
S506: and calculating a second sub-loss value according to the difference between the first characteristic data and the second characteristic data of the same recommendation object data, and the difference between the first characteristic data or the second characteristic data of different recommendation object data.
It will be appreciated that the second sub-loss value is used for the self-supervised pre-training of the recommended object feature extraction sub-model. The object is to make the difference between the first feature data and the second feature data of the same recommendation target data as small as possible, and the difference between the first feature data or the difference between the second feature data of different recommendation target data as large as possible.
In some possible implementations, embodiments of the present application provide a specific implementation manner for calculating the second sub-loss value according to a difference between the first feature data and the second feature data of the same recommended object data, and a difference between the first feature data and the second feature data of different recommended object data, which is described in detail in F1-F2 below.
It is understood that S505-S506 are a specific implementation of S203 when the information recommendation model is a double-tower model, that is, calculating the loss value according to a difference between the first feature data and the second feature data of the same sample data and a difference between the first feature data or the second feature data of different sample data, and includes: calculating a first sub-loss value according to the difference between the first characteristic data and the second characteristic data of the same user behavior data, and the difference between the first characteristic data or the second characteristic data of different user behavior data; and calculating a second sub-loss value according to the difference between the first characteristic data and the second characteristic data of the same recommendation object data, and the difference between the first characteristic data or the second characteristic data of different recommendation object data.
S507: and adjusting the model parameters of the user data feature extraction submodel in the information recommendation model by using the first sub-loss value, adjusting the model parameters of the recommendation object feature extraction submodel in the information recommendation model by using the second sub-loss value, repeating the step S501 and the subsequent steps until the stop conditions corresponding to the submodel are all reached, and obtaining the initialization model parameters of the user data feature extraction submodel in the information recommendation model and the initialization model parameters of the recommendation object feature extraction submodel in the information recommendation model.
And after the first sub-loss value is obtained, judging whether a stop condition corresponding to the user data feature extraction sub-model is reached. And after the second sub-loss value is obtained, judging whether a stopping condition corresponding to the recommended object feature extraction sub-model is reached. When one of the stop conditions is not met, the step S501 and the subsequent steps are repeated until the stop conditions corresponding to the submodels are met. Or only retraining the sub-models which do not reach the corresponding stop conditions until the corresponding stop conditions are reached.
And when both of the user data characteristic extraction submodel and the information recommendation model reach the corresponding stop conditions, acquiring the initialization model parameters of the user data characteristic extraction submodel in the information recommendation model and the initialization model parameters of the recommendation object characteristic extraction submodel in the information recommendation model.
The stopping condition corresponding to the user data feature extraction submodel and the stopping condition corresponding to the recommendation object feature extraction submodel can be the same or different, and can be limited according to actual conditions.
It is understood that the initialization model parameters of the information recommendation model include initialization model parameters of the user data feature extraction submodel and initialization model parameters of the recommendation object feature extraction submodel.
It should be noted that S507 is a specific implementation of S204 when the information recommendation model is a double-tower model. Namely, adjusting model parameters of an information recommendation model by using a loss value, repeatedly inputting at least two pieces of sample data into the information recommendation model, performing first data feature extraction and subsequent steps until a stop condition is reached, and obtaining initialization model parameters of the information recommendation model, wherein the method comprises the following steps:
and adjusting the model parameters of the user data feature extraction submodel in the information recommendation model by using the first sub-loss value, adjusting the model parameters of the recommendation object feature extraction submodel in the information recommendation model by using the second sub-loss value, repeatedly inputting at least two pieces of sample data into the information recommendation model, performing the first data feature extraction and the subsequent steps until a stop condition is reached, and obtaining the initialization model parameters of the user data feature extraction submodel in the information recommendation model and the initialization model parameters of the recommendation object feature extraction submodel in the information recommendation model.
It can be understood that, when the information recommendation model is a double-tower model, the steps of inputting at least two pieces of sample data into the information recommendation model, performing the first data feature extraction and the subsequent steps are repeatedly executed until a stop condition is reached, that is, the steps S501 and the subsequent steps are re-executed until the stop conditions corresponding to the sub-models are both reached.
S508: and adjusting the model parameters of the information recommendation model on the basis of the initialization model parameters of the information recommendation model by using the training data to obtain the trained information recommendation model.
After the initialization model parameters of the user data feature extraction submodel in the information recommendation model and the initialization model parameters of the recommended object feature extraction submodel in the information recommendation model are obtained, the self-supervision pre-training of the user data feature extraction submodel and the recommended object feature extraction submodel is completed. Based on the information recommendation model, the information recommendation model is trained by using the training data, model parameters are adjusted on the basis of initializing the model parameters, and finally the trained information recommendation model is obtained.
It should be noted that the training data includes not only the sample data, but also the label information corresponding to the sample data.
It should be noted that the specific technical details of the information recommendation model being the single tower model or the double tower model are similar, and for the specific technical details of the double tower model, see the contents of S201 to S205 described above.
Based on S501-S508, the self-supervised pre-training of the information recommendation model is performed based on sample data without label information. Namely, label information is not used, and initialization model parameters irrelevant to labels are obtained through learning a large amount of sample data. When the information recommendation model is formally trained, the obtained initialization model parameters enable the information recommendation model to more generalize and have more robustness on the feature representation of training data, and further the expressiveness and the accuracy of the trained information recommendation model are improved. Because the information recommendation model adopts a double-tower model structure, the trained information recommendation model is more friendly to users.
In order to prevent the user data feature extraction submodel from being over-fitted and enhance the generalization capability of the user data feature extraction submodel, the first feature data of the user behavior data is acquired by using the user data feature extraction submodel in a data enhancement mode.
Based on this, in some possible implementation manners, an embodiment of the present application provides a specific implementation manner in which, in S501, at least two pieces of user behavior data are input into a user data feature extraction submodel in an information recommendation model, and first data feature extraction is performed to obtain first feature data of the at least two pieces of user behavior data, where the specific implementation manner includes:
a1: and inputting the at least two pieces of user behavior data into a user data feature extraction submodel in the information recommendation model after the first random mask operation is carried out on the at least two pieces of user behavior data, so as to obtain first feature data of the at least two pieces of user behavior data.
The first random masking operation is specifically to randomly select and mask some of the user behavior data, the masked data being filled with 0 s. The first random masking operation makes the user behavior data satisfy randomness to prevent the user data feature extraction submodel from being over-fitted.
A2: and carrying out first random zero setting operation on hidden layer node weights of the user data feature extraction submodels in the information recommendation model, and inputting at least two pieces of user behavior data into the user data feature extraction submodels in the information recommendation model to obtain first feature data of at least two pieces of user behavior data.
The first random zero setting operation is specifically to randomly select some weights in the user data feature extraction sub-model hidden layer node weights and perform zero setting operation on the randomly selected weights. As an example, the first random zero setting operation is a Dropout operation, that is, in the pre-training process of the user data feature extraction submodel, the hidden node weight is temporarily discarded from the network according to a certain probability. The Dropout operation prevents the user data feature extraction submodel from overfitting by making the hidden node neurons unreliable.
A3: and carrying out first random zero setting operation on hidden layer node weights of the user data feature extraction submodels in the information recommendation model, carrying out first random mask operation on at least two pieces of user behavior data, and inputting the user data feature extraction submodels in the information recommendation model to obtain first feature data of at least two pieces of user behavior data.
In a3, not only the first random zeroing operation is performed on the hidden node weight of the user data feature extraction submodel, but also the first random masking operation is performed on at least two pieces of user behavior data, so that the over-fitting of the user data feature extraction submodel can be prevented, and the generalization capability of the user data feature extraction submodel is enhanced.
It is understood that a1-A3 is a specific implementation manner of performing first data feature extraction for three optional user data feature extraction submodels that input at least two pieces of user behavior data into an information recommendation model to obtain first feature data of at least two pieces of user behavior data, and one of the manners may be selected to implement S501. Based on the three optional specific implementation modes, the generalization capability of the user data feature extraction submodel can be improved.
In order to prevent the recommendation object feature extraction submodel from being over-fitted and enhance the generalization capability of the recommendation object feature extraction submodel, the first feature data of the user behavior data are acquired by using the recommendation object feature extraction submodel in a data enhancement mode.
Based on this, in some possible implementation manners, the embodiment of the present application provides a specific implementation manner in which in S502, at least two pieces of recommendation object data are input into a recommendation object feature extraction submodel in an information recommendation model, and first data feature extraction is performed to obtain first feature data of the at least two pieces of recommendation object data, including:
b1: and inputting the recommended object feature extraction submodel in the information recommendation model after the first random mask operation is carried out on at least two pieces of recommended object data to obtain first feature data of the at least two pieces of recommended object data.
The first random masking operation is specifically to randomly select and mask some of the recommendation object data, and the masked data is filled with 0. The first random masking operation makes the recommended object data satisfy randomness to prevent overfitting of the recommended object feature extraction submodel.
B2: and carrying out first random zero setting operation on hidden node weights of the recommended object feature extraction submodel in the information recommendation model, and inputting at least two pieces of recommended object data into the recommended object feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of recommended object data.
The first random zero setting operation is specifically to randomly select some weights in hidden layer node weights of the recommendation object feature extraction submodel, and perform zero setting operation on the randomly selected weights. As an example, the first random zero setting operation is a Dropout operation, that is, in the pre-training process of the recommendation object feature extraction submodel, for hidden node weights, they are temporarily discarded from the network according to a certain probability. The Dropout operation prevents the recommendation object feature extraction submodel from overfitting by making the hidden node neurons unreliable.
B3: and carrying out first random zero setting operation on hidden node weights of the recommended object feature extraction submodel in the information recommendation model, carrying out first random mask operation on at least two pieces of recommended object data, and inputting the recommended object feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of recommended object data.
In B3, not only the first random zero-setting operation is performed on the hidden node weight of the recommended object feature extraction submodel, but also the first random mask operation is performed on at least two pieces of recommended object data, which can prevent the recommended object feature extraction submodel from being over-fitted and enhance the generalization capability of the recommended object feature extraction submodel.
It is understood that B1-B3 are three optional specific implementation manners in which the at least two pieces of recommended object data are input into the recommended object feature extraction submodels in the information recommendation model, and the first data feature extraction is performed to obtain the first feature data of the at least two pieces of recommended object data, and one of the manners may be selected to implement S502. Based on the three optional specific implementation modes, the generalization capability of the recommendation object feature extraction submodel can be improved.
In order to prevent the user data feature extraction submodel from being over-fitted and enhance the generalization capability of the user data feature extraction submodel, the second feature data of the user behavior data is acquired by using the user data feature extraction submodel in a data enhancement mode.
Based on this, in some possible implementation manners, an embodiment of the present application provides a specific implementation manner in which, in S503, at least two pieces of user behavior data are input into a user data feature extraction submodel in an information recommendation model, and second data feature extraction is performed to obtain second feature data of the at least two pieces of user behavior data, and the specific implementation manner includes:
c1: and performing second random mask operation on the at least two pieces of user behavior data, and inputting the user data feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of user behavior data.
C2: and carrying out second random zero setting operation on the hidden node weight of the user data feature extraction submodel in the information recommendation model, and inputting at least two pieces of user behavior data into the user data feature extraction submodel in the information recommendation model to obtain second feature data of at least two pieces of user behavior data.
C3: and carrying out second random zero setting operation on hidden layer node weights of the user data feature extraction submodels in the information recommendation model, carrying out second random mask operation on at least two pieces of user behavior data, and inputting the user data feature extraction submodels in the information recommendation model to obtain first feature data of at least two pieces of user behavior data.
Since C1-C3 and A1-A3 are similar, detailed description is omitted here, and technical details can be found in A1-A3.
It is understood that C1-C3 is a specific implementation manner of performing second data feature extraction for three optional user data feature extraction submodels that input at least two pieces of user behavior data into the information recommendation model, and obtain second feature data of at least two pieces of user behavior data, and one of the manners may be selected to implement S503. Based on the three optional specific implementation modes, the generalization capability of the user data feature extraction submodel can be improved.
In order to prevent the recommendation object feature extraction submodel from being over-fitted and enhance the generalization capability of the recommendation object feature extraction submodel, the recommendation object feature extraction submodel is used for acquiring second feature data of the user behavior data in a data enhancement mode.
Based on this, in some possible implementation manners, the embodiment of the present application provides a specific implementation manner in which in S504, at least two pieces of recommendation object data are input into the recommendation object feature extraction submodel in the information recommendation model, and second data feature extraction is performed to obtain second feature data of the at least two pieces of recommendation object data, including:
d1: and inputting the recommended object feature extraction submodel in the information recommendation model after performing second random mask operation on the at least two pieces of recommended object data to obtain second feature data of the at least two pieces of recommended object data.
D2: and carrying out second random zero setting operation on hidden node weights of the recommended object feature extraction submodel in the information recommendation model, and inputting at least two pieces of recommended object data into the recommended object feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of recommended object data.
D3: and performing second random zero setting operation on hidden node weights of the recommended object feature extraction submodel in the information recommendation model, performing second random mask operation on at least two pieces of recommended object data, and inputting the recommended object feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of recommended object data.
Wherein the first random masking operation is different from the second random masking operation; the first random zero operation is different from the second random zero operation.
Since D1-D3 and B1-B3 are similar, detailed description is omitted here, and technical details can be found in B1-B3.
It is understood that D1-D3 are three specific implementation manners in which at least two pieces of recommended object data are input into the recommended object feature extraction submodel of the information recommendation model, and second data feature extraction is performed to obtain second feature data of the at least two pieces of recommended object data, and one of the manners may be selected to implement S504. Based on the three optional specific implementation modes, the generalization capability of the recommended object feature extraction submodel can be improved.
In some possible implementations, embodiments of the present application provide a specific implementation manner of calculating a first sub-loss value according to a difference between first feature data and second feature data of the same user behavior data, and a difference between first feature data of different user behavior data or a difference between second feature data, including:
e1: and calculating a fourth angle difference of the first characteristic data and the second characteristic data of each user behavior data in a characteristic vector space, calculating a fifth angle difference of the first characteristic data of each two different user behavior data in the characteristic vector space, and calculating a first sub-loss value according to each fourth angle difference, each fifth angle difference and the number of the user behavior data.
E2: and calculating a fourth angle difference of the first characteristic data and the second characteristic data of each user behavior data in a characteristic vector space, calculating a sixth angle difference of the second characteristic data of each two different user behavior data in the characteristic vector space, and calculating a first sub-loss value according to each fourth angle difference, each sixth angle difference and the number of the user behavior data.
It is understood that E1-E2 are two alternative embodiments for calculating the first sub-loss value according to the difference between the first characteristic data and the second characteristic data of the same user behavior data, and the difference between the first characteristic data or the difference between the second characteristic data of different user behavior data.
Before calculating the first sub-loss value, a first sub-loss function of the user data feature extraction sub-model needs to be constructed. Under E1, the first sub-loss function can be constructed with reference to the auto-supervised loss function (1), which is not described herein again. Under E2, the first sub-loss function may be constructed with reference to the auto-supervised loss function (2), which is not described herein again.
In some possible implementations, embodiments of the present application provide a specific implementation manner of calculating a second sub-loss value according to a difference between first feature data and second feature data of the same recommendation object data, and a difference between first feature data of different recommendation object data or a difference between second feature data, including:
f1: and calculating a seventh angle difference of the first characteristic data and the second characteristic data of each recommended object data in a characteristic vector space, calculating a eighth angle difference of the first characteristic data of each two different recommended object data in the characteristic vector space, and calculating a second sub-loss value according to each seventh angle difference, each eighth angle difference and the quantity of the recommended object data.
F2: and calculating a seventh angle difference of the first characteristic data and the second characteristic data of each piece of recommended object data in a characteristic vector space, calculating a ninth angle difference of the second characteristic data of each two different pieces of recommended object data in the characteristic vector space, and calculating a second sub-loss value according to each seventh angle difference, each ninth angle difference and the quantity of the pieces of recommended object data.
It is understood that F1-F2 are two alternative embodiments for calculating the second sub-loss value according to the difference between the first feature data and the second feature data of the same recommended object data, and the difference between the first feature data and the second feature data of different recommended object data.
Before calculating the second sub-loss value, a second sub-loss function of the recommended object feature extraction sub-model needs to be constructed. Under F1, the second sub-loss function may be constructed with reference to the auto-supervised loss function (1), which is not described herein again. Under E2, the second sub-loss function can be constructed with reference to the auto-supervised loss function (2), which is not described herein again.
Based on the training method of the information recommendation model provided by the method embodiment, the embodiment of the application also provides a training device of the information recommendation model, and the training device of the information recommendation model will be described with reference to the accompanying drawings.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a training apparatus for an information recommendation model according to an embodiment of the present application. As shown in fig. 6, the training apparatus of the information recommendation model includes:
a first feature extraction unit 601, configured to input at least two pieces of sample data into an information recommendation model, and perform first data feature extraction to obtain first feature data of the at least two pieces of sample data; the sample data comprises user behavior data and recommendation object data;
a second feature extraction unit 602, configured to input the at least two pieces of sample data into the information recommendation model, and perform second data feature extraction to obtain second feature data of the at least two pieces of sample data;
a calculating unit 603, configured to calculate a loss value according to a difference between first feature data and second feature data of the same sample data, and a difference between first feature data of different sample data or a difference between second feature data;
an executing unit 604, configured to adjust a model parameter of the information recommendation model by using the loss value, repeatedly execute the inputting of the at least two pieces of sample data into the information recommendation model, perform first data feature extraction and subsequent steps until a stop condition is reached, and obtain an initialization model parameter of the information recommendation model;
the adjusting unit 605 is configured to adjust the model parameters of the information recommendation model based on the initialization model parameters of the information recommendation model by using the training data, so as to obtain the trained information recommendation model.
In a possible implementation manner, the first feature extraction unit 601 includes:
the first input subunit is used for inputting the information recommendation model after performing a first random mask operation on at least two pieces of sample data to obtain first characteristic data of the at least two pieces of sample data;
alternatively, the first and second electrodes may be,
the second input subunit is used for carrying out first random zero setting operation on hidden layer node weights of the information recommendation model, inputting at least two pieces of sample data into the information recommendation model, and obtaining first characteristic data of the at least two pieces of sample data;
alternatively, the first and second electrodes may be,
the third input subunit is used for performing a first random zero setting operation on hidden node weights of the information recommendation model, performing a first random mask operation on at least two pieces of sample data, and inputting the at least two pieces of sample data into the information recommendation model to obtain first characteristic data of the at least two pieces of sample data;
the second feature extraction unit 602 includes:
the fourth input subunit is configured to input the information recommendation model after performing a second random masking operation on the at least two pieces of sample data, so as to obtain second feature data of the at least two pieces of sample data;
alternatively, the first and second electrodes may be,
a fifth input subunit, configured to perform a second random zeroing operation on hidden node weights of the information recommendation model, and input the at least two pieces of sample data into the information recommendation model to obtain second feature data of the at least two pieces of sample data;
alternatively, the first and second electrodes may be,
a sixth input subunit, configured to perform a second random zeroing operation on hidden node weights of the information recommendation model, perform a second random masking operation on the at least two pieces of sample data, and input the at least two pieces of sample data into the information recommendation model to obtain second feature data of the at least two pieces of sample data;
wherein the first random masking operation is different from the second random masking operation; the first random zero operation is different from the second random zero operation.
In a possible implementation manner, the computing unit 603 includes:
the first calculating subunit is configured to calculate a first angle difference between the first feature data and the second feature data of each sample data in a feature vector space, calculate a second angle difference between the first feature data of each two different sample data in the feature vector space, and calculate a loss value according to each first angle difference, each second angle difference, and the number of the sample data;
alternatively, the first and second electrodes may be,
and the second calculating subunit is used for calculating a first angle difference of the first characteristic data and the second characteristic data of each sample data in a characteristic vector space, calculating a third angle difference of the second characteristic data of each two different sample data in the characteristic vector space, and calculating a loss value according to each first angle difference, each third angle difference and the number of the sample data.
In a possible implementation manner, the first feature extraction unit 601 includes:
the first extraction sub-unit is used for inputting at least two pieces of user behavior data into a user data feature extraction sub-model in the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of user behavior data;
the second extraction subunit is used for inputting the at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of recommended object data;
the second feature extraction unit 602 includes:
the third extraction subunit is used for inputting the at least two pieces of user behavior data into a user data feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of user behavior data;
and the fourth extraction subunit is used for inputting the at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of recommended object data.
In one possible implementation manner, the first extraction subunit includes:
the first obtaining subunit is configured to input a user data feature extraction sub-model in the information recommendation model after performing a first random masking operation on at least two pieces of user behavior data, and obtain first feature data of the at least two pieces of user behavior data;
alternatively, the first and second electrodes may be,
the second obtaining subunit is used for carrying out first random zero setting operation on hidden node weights of the user data feature extraction submodel in the information recommendation model, inputting at least two pieces of user behavior data into the user data feature extraction submodel in the information recommendation model, and obtaining first feature data of the at least two pieces of user behavior data;
alternatively, the first and second electrodes may be,
the third obtaining subunit is used for carrying out first random zero setting operation on hidden node weights of the user data feature extraction submodels in the information recommendation model, inputting the user data feature extraction submodels in the information recommendation model after carrying out first random mask operation on at least two pieces of user behavior data, and obtaining first feature data of the at least two pieces of user behavior data;
the second extraction subunit includes:
the fourth obtaining subunit is configured to input the recommended object feature extraction sub-model in the information recommendation model after performing the first random masking operation on the at least two pieces of recommended object data, so as to obtain first feature data of the at least two pieces of recommended object data;
alternatively, the first and second electrodes may be,
the fifth obtaining subunit is configured to perform a first random zeroing operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, input at least two pieces of recommended object data into the recommended object feature extraction submodel in the information recommendation model, and obtain first feature data of the at least two pieces of recommended object data;
alternatively, the first and second electrodes may be,
the sixth obtaining subunit is configured to perform a first random zeroing operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, perform a first random masking operation on at least two pieces of recommended object data, and input the recommended object feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of recommended object data;
the third extraction subunit includes:
a seventh obtaining subunit, configured to perform a second random masking operation on the at least two pieces of user behavior data, and then input the user data feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of user behavior data;
or, the eighth obtaining subunit is configured to perform a second random zeroing operation on hidden node weights of the user data feature extraction submodel in the information recommendation model, input the at least two pieces of user behavior data into the user data feature extraction submodel in the information recommendation model, and obtain second feature data of the at least two pieces of user behavior data;
or, the ninth obtaining subunit is configured to perform a second random zeroing operation on hidden node weights of the user data feature extraction submodel in the information recommendation model, perform a second random masking operation on the at least two pieces of user behavior data, and input the at least two pieces of user behavior data into the user data feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of user behavior data;
the fourth extraction subunit includes:
a tenth obtaining subunit, configured to perform a second random masking operation on the at least two pieces of recommended object data, and then input the second random masking operation into a recommended object feature extraction sub-model in the information recommendation model, so as to obtain second feature data of the at least two pieces of recommended object data;
alternatively, the first and second electrodes may be,
an eleventh obtaining subunit, configured to perform a second random zero setting operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, input the at least two pieces of recommended object data into the recommended object feature extraction submodel in the information recommendation model, and obtain second feature data of the at least two pieces of recommended object data;
alternatively, the first and second electrodes may be,
a twelfth obtaining subunit, configured to perform a second random zero setting operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, perform a second random mask operation on the at least two pieces of recommended object data, and input the at least two pieces of recommended object feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of recommended object data;
wherein the first random masking operation is different from the second random masking operation; the first random zero operation is different from the second random zero operation.
In a possible implementation manner, the computing unit 603 includes:
the third calculation subunit is used for calculating a first sub-loss value according to the difference between the first characteristic data and the second characteristic data of the same user behavior data and the difference between the first characteristic data or the difference between the second characteristic data of different user behavior data;
and the fourth calculating subunit is configured to calculate a second sub-loss value according to a difference between the first feature data and the second feature data of the same recommendation object data, and a difference between the first feature data of different recommendation object data or a difference between the second feature data.
In one possible implementation, the third calculation subunit includes:
the fifth calculating subunit is configured to calculate a fourth angle difference between the first feature data and the second feature data of each user behavior data in a feature vector space, calculate a fifth angle difference between the first feature data of each two different user behavior data in the feature vector space, and calculate a first sub-loss value according to each fourth angle difference, each fifth angle difference, and the number of the user behavior data;
alternatively, the first and second electrodes may be,
a sixth calculating subunit, configured to calculate a fourth angle difference between the first feature data and the second feature data of each piece of user behavior data in a feature vector space, calculate a sixth angle difference between the second feature data of each two different pieces of user behavior data in the feature vector space, and calculate a first sub-loss value according to each fourth angle difference, each sixth angle difference, and the number of the user behavior data;
the fourth calculating subunit includes:
the seventh calculation subunit is configured to calculate a seventh angle difference between the first feature data and the second feature data of each piece of recommendation object data in a feature vector space, calculate an eighth angle difference between the first feature data of each two pieces of different recommendation object data in the feature vector space, and calculate a second sub-loss value according to each seventh angle difference, each eighth angle difference, and the number of pieces of recommendation object data;
alternatively, the first and second electrodes may be,
and the eighth calculating subunit is configured to calculate a seventh angle difference between the first feature data and the second feature data of each piece of recommendation object data in the feature vector space, calculate a ninth angle difference between the second feature data of each two different pieces of recommendation object data in the feature vector space, and calculate a second sub-loss value according to each seventh angle difference, each ninth angle difference, and the number of the recommendation object data.
In a possible implementation manner, the execution unit 604 is specifically configured to:
and adjusting the model parameters of the user data feature extraction submodel in the information recommendation model by using the first sub-loss value, adjusting the model parameters of the recommendation object feature extraction submodel in the information recommendation model by using the second sub-loss value, repeatedly executing the steps of inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain the initialization model parameters of the user data feature extraction submodel in the information recommendation model and the initialization model parameters of the recommendation object feature extraction submodel in the information recommendation model.
Based on the training method for the information recommendation model provided by the embodiment of the method, the application further provides an electronic device, which includes: one or more processors; a storage device, on which one or more programs are stored, which, when executed by the one or more processors, cause the one or more processors to implement the method for training an information recommendation model according to any of the embodiments.
Referring now to FIG. 7, shown is a schematic diagram of an electronic device 700 suitable for use in implementing embodiments of the present application. The terminal device in the embodiment of the present application may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a Digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Portable android device), a PMP (Portable multimedia Player), a car terminal (e.g., car navigation terminal), and the like, and a fixed terminal such as a Digital TV (television), a desktop computer, and the like. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, the electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage means 706 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 706 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 706, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of the embodiments of the present application.
The electronic device provided by the embodiment of the application and the training method of the information recommendation model provided by the embodiment belong to the same inventive concept, and technical details which are not described in detail in the embodiment can be referred to the embodiment, and the embodiment have the same beneficial effects.
Based on the method for training an information recommendation model provided in the foregoing method embodiments, an embodiment of the present application provides a computer readable medium, on which a computer program is stored, where the program is executed by a processor to implement the method for training an information recommendation model according to any one of the foregoing embodiments.
It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the method for training the information recommendation model.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. Where the name of a unit/module does not in some cases constitute a limitation on the unit itself, for example, a voice data collection module may also be described as a "data collection module".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present application, there is provided [ example one ] a training method of an information recommendation model, the method including:
inputting at least two pieces of sample data into an information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of sample data; the sample data comprises user behavior data and recommendation object data;
inputting the at least two pieces of sample data into the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of sample data;
calculating a loss value according to the difference between the first characteristic data and the second characteristic data of the same sample data, and the difference between the first characteristic data and the second characteristic data of different sample data or the difference between the second characteristic data;
adjusting model parameters of the information recommendation model by using the loss value, repeatedly executing the input of at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain initialization model parameters of the information recommendation model;
and adjusting the model parameters of the information recommendation model on the basis of the initialization model parameters of the information recommendation model by using training data to obtain the trained information recommendation model.
According to one or more embodiments of the present application, an [ example two ] provides a training method for an information recommendation model, where inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of sample data includes:
performing first random mask operation on at least two pieces of sample data, and inputting an information recommendation model to obtain first characteristic data of the at least two pieces of sample data;
or, performing a first random zero setting operation on hidden node weights of an information recommendation model, and inputting at least two pieces of sample data into the information recommendation model to obtain first characteristic data of the at least two pieces of sample data;
or, performing a first random zero setting operation on hidden node weights of an information recommendation model, performing a first random mask operation on at least two pieces of sample data, and inputting the at least two pieces of sample data into the information recommendation model to obtain first characteristic data of the at least two pieces of sample data;
inputting the at least two pieces of sample data into the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of sample data, including:
performing second random mask operation on the at least two pieces of sample data, and inputting the at least two pieces of sample data into the information recommendation model to obtain second characteristic data of the at least two pieces of sample data;
or, performing a second random zero setting operation on the hidden node weight of the information recommendation model, and inputting the at least two pieces of sample data into the information recommendation model to obtain second characteristic data of the at least two pieces of sample data;
or, performing a second random zero setting operation on the hidden node weight of the information recommendation model, performing a second random mask operation on the at least two pieces of sample data, and inputting the at least two pieces of sample data into the information recommendation model to obtain second characteristic data of the at least two pieces of sample data;
wherein the first random masking operation is different from the second random masking operation; the first random zero operation is different from the second random zero operation.
According to one or more embodiments of the present application, an information recommendation model training method is provided, where calculating a loss value according to a difference between first feature data and second feature data of the same sample data and a difference between the first feature data or the second feature data of different sample data includes:
calculating a first angle difference of first characteristic data and second characteristic data of each sample data in a characteristic vector space, calculating a second angle difference of the first characteristic data of each two different sample data in the characteristic vector space, and calculating a loss value according to each first angle difference, each second angle difference and the number of the sample data;
or, calculating a first angle difference between the first characteristic data and the second characteristic data of each sample data in a characteristic vector space, calculating a third angle difference between the second characteristic data of each two different sample data in the characteristic vector space, and calculating a loss value according to each first angle difference, each third angle difference and the number of the sample data.
According to one or more embodiments of the present application, an [ example four ] provides a training method for an information recommendation model, where inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of sample data includes:
inputting at least two pieces of user behavior data into a user data feature extraction submodel in an information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of user behavior data;
inputting at least two pieces of recommended object data into a recommended object feature extraction submodel in an information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of recommended object data;
inputting the at least two pieces of sample data into the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of sample data, including:
inputting the at least two pieces of user behavior data into a user data feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of user behavior data;
and inputting the at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of recommended object data.
According to one or more embodiments of the present application, in example five, there is provided a training method for an information recommendation model, where at least two pieces of user behavior data are input to a user data feature extraction submodel in the information recommendation model, and first data feature extraction is performed to obtain first feature data of the at least two pieces of user behavior data, including:
performing first random mask operation on at least two pieces of user behavior data, and inputting a user data feature extraction sub-model in an information recommendation model to obtain first feature data of the at least two pieces of user behavior data;
or, carrying out a first random zero setting operation on hidden node weights of a user data feature extraction submodel in an information recommendation model, and inputting at least two pieces of user behavior data into the user data feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of user behavior data;
or, carrying out a first random zero setting operation on hidden node weights of a user data feature extraction submodel in an information recommendation model, carrying out a first random mask operation on at least two pieces of user behavior data, and inputting the user data feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of user behavior data;
the method for inputting at least two pieces of recommended object data into a recommended object feature extraction submodel in an information recommendation model to perform first data feature extraction to obtain first feature data of the at least two pieces of recommended object data includes:
performing first random masking operation on at least two pieces of recommended object data, and inputting a recommended object feature extraction sub-model in an information recommendation model to obtain first feature data of the at least two pieces of recommended object data;
or, carrying out a first random zero setting operation on hidden node weights of a recommended object feature extraction submodel in an information recommendation model, and inputting at least two pieces of recommended object data into the recommended object feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of recommended object data;
or, performing a first random zero setting operation on hidden node weights of a recommended object feature extraction submodel in an information recommendation model, performing a first random mask operation on at least two pieces of recommended object data, and inputting the recommended object feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of recommended object data;
the step of inputting the at least two pieces of user behavior data into a user data feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of user behavior data includes:
performing second random mask operation on the at least two pieces of user behavior data, and inputting the user data feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of user behavior data;
or, performing a second random zero setting operation on hidden node weights of the user data feature extraction submodel in the information recommendation model, and inputting the at least two pieces of user behavior data into the user data feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of user behavior data;
or, performing a second random zero setting operation on hidden node weights of the user data feature extraction submodels in the information recommendation model, performing a second random mask operation on the at least two pieces of user behavior data, and inputting the user data feature extraction submodels in the information recommendation model to obtain first feature data of the at least two pieces of user behavior data;
the step of inputting the at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of recommended object data includes:
performing second random masking operation on the at least two pieces of recommended object data, and inputting the recommended object feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of recommended object data;
or, performing a second random zero setting operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, and inputting the at least two pieces of recommended object data into the recommended object feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of recommended object data;
or, performing a second random zero setting operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, performing a second random mask operation on the at least two pieces of recommended object data, and inputting the recommended object feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of recommended object data;
wherein the first random masking operation is different from the second random masking operation; the first random zero operation is different from the second random zero operation.
According to one or more embodiments of the present application, there is provided an information recommendation model training method, calculating a loss value according to a difference between first feature data and second feature data of the same sample data and a difference between the first feature data or the second feature data of different sample data, including:
calculating a first sub-loss value according to the difference between the first characteristic data and the second characteristic data of the same user behavior data, and the difference between the first characteristic data or the second characteristic data of different user behavior data;
and calculating a second sub-loss value according to the difference between the first characteristic data and the second characteristic data of the same recommendation object data, and the difference between the first characteristic data or the second characteristic data of different recommendation object data.
According to one or more embodiments of the present application, example seven provides a training method of an information recommendation model, the calculating a first sub-loss value according to a difference between first feature data and second feature data of the same user behavior data, and a difference between the first feature data or a difference between the second feature data of different user behavior data, including:
calculating a fourth angle difference of the first characteristic data and the second characteristic data of each user behavior data in a characteristic vector space, calculating a fifth angle difference of the first characteristic data of each two different user behavior data in the characteristic vector space, and calculating a first sub-loss value according to each fourth angle difference, each fifth angle difference and the number of the user behavior data;
or calculating a fourth angle difference of the first characteristic data and the second characteristic data of each user behavior data in a characteristic vector space, calculating a sixth angle difference of the second characteristic data of each two different user behavior data in the characteristic vector space, and calculating a first sub-loss value according to each fourth angle difference, each sixth angle difference and the number of the user behavior data;
the calculating a second sub-loss value according to a difference between the first feature data and the second feature data of the same recommendation object data, and a difference between the first feature data of different recommendation object data or a difference between the second feature data includes:
calculating a seventh angle difference of the first characteristic data and the second characteristic data of each recommended object data in a characteristic vector space, calculating an eighth angle difference of the first characteristic data of each two different recommended object data in the characteristic vector space, and calculating a second sub-loss value according to each seventh angle difference, each eighth angle difference and the quantity of the recommended object data;
or, calculating a seventh angle difference of the first feature data and the second feature data of each piece of recommendation object data in a feature vector space, calculating a ninth angle difference of the second feature data of each two different pieces of recommendation object data in the feature vector space, and calculating a second sub-loss value according to each seventh angle difference, each ninth angle difference and the number of the recommendation object data.
According to one or more embodiments of the present application, in an example eight, there is provided a training method for an information recommendation model, where the method includes adjusting model parameters of the information recommendation model using the loss value, repeatedly executing the steps of inputting at least two pieces of sample data into the information recommendation model, performing first data feature extraction, and performing subsequent steps until a stop condition is reached, and obtaining initialization model parameters of the information recommendation model, including:
and adjusting the model parameters of the user data feature extraction submodel in the information recommendation model by using the first sub-loss value, adjusting the model parameters of the recommendation object feature extraction submodel in the information recommendation model by using the second sub-loss value, repeatedly executing the steps of inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain the initialization model parameters of the user data feature extraction submodel in the information recommendation model and the initialization model parameters of the recommendation object feature extraction submodel in the information recommendation model.
According to one or more embodiments of the present application, [ example nine ] there is provided an information recommendation model training apparatus, the apparatus including:
the first feature extraction unit is used for inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of sample data; the sample data comprises user behavior data and recommendation object data;
the second feature extraction unit is used for inputting the at least two pieces of sample data into the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of sample data;
the calculation unit is used for calculating a loss value according to the difference between the first characteristic data and the second characteristic data of the same sample data, and the difference between the first characteristic data or the second characteristic data of different sample data;
the execution unit is used for adjusting the model parameters of the information recommendation model by using the loss value, repeatedly executing the step of inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain the initialization model parameters of the information recommendation model;
and the adjusting unit is used for adjusting the model parameters of the information recommendation model on the basis of the initialization model parameters of the information recommendation model by using the training data to obtain the trained information recommendation model.
According to one or more embodiments of the present application, [ example ten ] there is provided a training apparatus of an information recommendation model, the first feature extraction unit 601 including:
the first input subunit is used for inputting the information recommendation model after performing a first random mask operation on at least two pieces of sample data to obtain first characteristic data of the at least two pieces of sample data;
alternatively, the first and second electrodes may be,
the second input subunit is used for carrying out first random zero setting operation on hidden layer node weights of the information recommendation model, inputting at least two pieces of sample data into the information recommendation model, and obtaining first characteristic data of the at least two pieces of sample data;
alternatively, the first and second electrodes may be,
the third input subunit is used for performing a first random zero setting operation on hidden node weights of the information recommendation model, performing a first random mask operation on at least two pieces of sample data, and inputting the at least two pieces of sample data into the information recommendation model to obtain first characteristic data of the at least two pieces of sample data;
the second feature extraction unit 602 includes:
the fourth input subunit is configured to input the information recommendation model after performing a second random masking operation on the at least two pieces of sample data, so as to obtain second feature data of the at least two pieces of sample data;
alternatively, the first and second electrodes may be,
a fifth input subunit, configured to perform a second random zeroing operation on hidden node weights of the information recommendation model, and input the at least two pieces of sample data into the information recommendation model to obtain second feature data of the at least two pieces of sample data;
alternatively, the first and second electrodes may be,
a sixth input subunit, configured to perform a second random zeroing operation on hidden node weights of the information recommendation model, perform a second random masking operation on the at least two pieces of sample data, and input the at least two pieces of sample data into the information recommendation model to obtain second feature data of the at least two pieces of sample data;
wherein the first random masking operation is different from the second random masking operation; the first random zero operation is different from the second random zero operation.
According to one or more embodiments of the present application, [ example eleven ] there is provided a training apparatus of an information recommendation model, the calculation unit 603 including:
the first calculating subunit is configured to calculate a first angle difference between the first feature data and the second feature data of each sample data in a feature vector space, calculate a second angle difference between the first feature data of each two different sample data in the feature vector space, and calculate a loss value according to each first angle difference, each second angle difference, and the number of the sample data;
alternatively, the first and second electrodes may be,
and the second calculating subunit is used for calculating a first angle difference of the first characteristic data and the second characteristic data of each sample data in a characteristic vector space, calculating a third angle difference of the second characteristic data of each two different sample data in the characteristic vector space, and calculating a loss value according to each first angle difference, each third angle difference and the number of the sample data.
According to one or more embodiments of the present application, in [ example twelve ], there is provided a training apparatus of an information recommendation model, the first feature extraction unit 601 including:
the first extraction sub-unit is used for inputting at least two pieces of user behavior data into a user data feature extraction sub-model in the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of user behavior data;
the second extraction subunit is used for inputting the at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of recommended object data;
the second feature extraction unit 602 includes:
the third extraction subunit is used for inputting the at least two pieces of user behavior data into a user data feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of user behavior data;
and the fourth extraction subunit is used for inputting the at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of recommended object data.
According to one or more embodiments of the present application, [ example thirteen ] there is provided a training apparatus of an information recommendation model, the first extraction subunit including:
the first obtaining subunit is configured to input a user data feature extraction sub-model in the information recommendation model after performing a first random masking operation on at least two pieces of user behavior data, and obtain first feature data of the at least two pieces of user behavior data;
alternatively, the first and second electrodes may be,
the second obtaining subunit is used for carrying out first random zero setting operation on hidden node weights of the user data feature extraction submodel in the information recommendation model, inputting at least two pieces of user behavior data into the user data feature extraction submodel in the information recommendation model, and obtaining first feature data of the at least two pieces of user behavior data;
alternatively, the first and second electrodes may be,
the third obtaining subunit is used for carrying out first random zero setting operation on hidden node weights of the user data feature extraction submodels in the information recommendation model, inputting the user data feature extraction submodels in the information recommendation model after carrying out first random mask operation on at least two pieces of user behavior data, and obtaining first feature data of the at least two pieces of user behavior data;
the second extraction subunit includes:
the fourth obtaining subunit is configured to input the recommended object feature extraction sub-model in the information recommendation model after performing the first random masking operation on the at least two pieces of recommended object data, so as to obtain first feature data of the at least two pieces of recommended object data;
alternatively, the first and second electrodes may be,
the fifth obtaining subunit is configured to perform a first random zeroing operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, input at least two pieces of recommended object data into the recommended object feature extraction submodel in the information recommendation model, and obtain first feature data of the at least two pieces of recommended object data;
alternatively, the first and second electrodes may be,
the sixth obtaining subunit is configured to perform a first random zeroing operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, perform a first random masking operation on at least two pieces of recommended object data, and input the recommended object feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of recommended object data;
the third extraction subunit includes:
a seventh obtaining subunit, configured to perform a second random masking operation on the at least two pieces of user behavior data, and then input the user data feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of user behavior data;
or, the eighth obtaining subunit is configured to perform a second random zeroing operation on hidden node weights of the user data feature extraction submodel in the information recommendation model, input the at least two pieces of user behavior data into the user data feature extraction submodel in the information recommendation model, and obtain second feature data of the at least two pieces of user behavior data;
or, the ninth obtaining subunit is configured to perform a second random zeroing operation on hidden node weights of the user data feature extraction submodel in the information recommendation model, perform a second random masking operation on the at least two pieces of user behavior data, and input the at least two pieces of user behavior data into the user data feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of user behavior data;
the fourth extraction subunit includes:
a tenth obtaining subunit, configured to perform a second random masking operation on the at least two pieces of recommended object data, and then input the second random masking operation into a recommended object feature extraction sub-model in the information recommendation model, so as to obtain second feature data of the at least two pieces of recommended object data;
alternatively, the first and second electrodes may be,
an eleventh obtaining subunit, configured to perform a second random zero setting operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, input the at least two pieces of recommended object data into the recommended object feature extraction submodel in the information recommendation model, and obtain second feature data of the at least two pieces of recommended object data;
alternatively, the first and second electrodes may be,
a twelfth obtaining subunit, configured to perform a second random zero setting operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, perform a second random mask operation on the at least two pieces of recommended object data, and input the at least two pieces of recommended object feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of recommended object data;
wherein the first random masking operation is different from the second random masking operation; the first random zero operation is different from the second random zero operation.
According to one or more embodiments of the present application, an information recommendation model training apparatus is provided [ example fourteen ], where the computing unit 603 includes:
the third calculation subunit is used for calculating a first sub-loss value according to the difference between the first characteristic data and the second characteristic data of the same user behavior data and the difference between the first characteristic data or the difference between the second characteristic data of different user behavior data;
and the fourth calculating subunit is configured to calculate a second sub-loss value according to a difference between the first feature data and the second feature data of the same recommendation object data, and a difference between the first feature data of different recommendation object data or a difference between the second feature data.
According to one or more embodiments of the present application, [ example fifteen ] there is provided a training apparatus of an information recommendation model, the third calculation subunit including:
the fifth calculating subunit is configured to calculate a fourth angle difference between the first feature data and the second feature data of each user behavior data in a feature vector space, calculate a fifth angle difference between the first feature data of each two different user behavior data in the feature vector space, and calculate a first sub-loss value according to each fourth angle difference, each fifth angle difference, and the number of the user behavior data;
alternatively, the first and second electrodes may be,
a sixth calculating subunit, configured to calculate a fourth angle difference between the first feature data and the second feature data of each piece of user behavior data in a feature vector space, calculate a sixth angle difference between the second feature data of each two different pieces of user behavior data in the feature vector space, and calculate a first sub-loss value according to each fourth angle difference, each sixth angle difference, and the number of the user behavior data;
the fourth calculating subunit includes:
the seventh calculation subunit is configured to calculate a seventh angle difference between the first feature data and the second feature data of each piece of recommendation object data in a feature vector space, calculate an eighth angle difference between the first feature data of each two pieces of different recommendation object data in the feature vector space, and calculate a second sub-loss value according to each seventh angle difference, each eighth angle difference, and the number of pieces of recommendation object data;
alternatively, the first and second electrodes may be,
and the eighth calculating subunit is configured to calculate a seventh angle difference between the first feature data and the second feature data of each piece of recommendation object data in the feature vector space, calculate a ninth angle difference between the second feature data of each two different pieces of recommendation object data in the feature vector space, and calculate a second sub-loss value according to each seventh angle difference, each ninth angle difference, and the number of the recommendation object data.
According to one or more embodiments of the present application, in an example sixteenth, there is provided an apparatus for training an information recommendation model, where the executing unit 604 is specifically configured to:
and adjusting the model parameters of the user data feature extraction submodel in the information recommendation model by using the first sub-loss value, adjusting the model parameters of the recommendation object feature extraction submodel in the information recommendation model by using the second sub-loss value, repeatedly executing the steps of inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain the initialization model parameters of the user data feature extraction submodel in the information recommendation model and the initialization model parameters of the recommendation object feature extraction submodel in the information recommendation model.
According to one or more embodiments of the present application, [ example seventeen ] there is provided an electronic device comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement a method of training an information recommendation model as in any of the examples above.
According to one or more embodiments of the present application, example eighteen provides a computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements a training method of an information recommendation model according to any of the examples above.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the disclosure. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the application. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (11)

1. A training method of an information recommendation model is characterized by comprising the following steps:
inputting at least two pieces of sample data into an information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of sample data; the sample data comprises user behavior data and recommendation object data;
inputting the at least two pieces of sample data into the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of sample data;
calculating a loss value according to the difference between the first characteristic data and the second characteristic data of the same sample data, and the difference between the first characteristic data and the second characteristic data of different sample data or the difference between the second characteristic data;
adjusting model parameters of the information recommendation model by using the loss value, repeatedly executing the input of at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain initialization model parameters of the information recommendation model;
and adjusting the model parameters of the information recommendation model on the basis of the initialization model parameters of the information recommendation model by using training data to obtain the trained information recommendation model.
2. The method of claim 1, wherein the inputting at least two pieces of sample data into the information recommendation model, performing first data feature extraction, and obtaining first feature data of the at least two pieces of sample data comprises:
performing first random mask operation on at least two pieces of sample data, and inputting an information recommendation model to obtain first characteristic data of the at least two pieces of sample data;
or, performing a first random zero setting operation on hidden node weights of an information recommendation model, and inputting at least two pieces of sample data into the information recommendation model to obtain first characteristic data of the at least two pieces of sample data;
or, performing a first random zero setting operation on hidden node weights of an information recommendation model, performing a first random mask operation on at least two pieces of sample data, and inputting the at least two pieces of sample data into the information recommendation model to obtain first characteristic data of the at least two pieces of sample data;
inputting the at least two pieces of sample data into the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of sample data, including:
performing second random mask operation on the at least two pieces of sample data, and inputting the at least two pieces of sample data into the information recommendation model to obtain second characteristic data of the at least two pieces of sample data;
or, performing a second random zero setting operation on the hidden node weight of the information recommendation model, and inputting the at least two pieces of sample data into the information recommendation model to obtain second characteristic data of the at least two pieces of sample data;
or, performing a second random zero setting operation on the hidden node weight of the information recommendation model, performing a second random mask operation on the at least two pieces of sample data, and inputting the at least two pieces of sample data into the information recommendation model to obtain second characteristic data of the at least two pieces of sample data;
wherein the first random masking operation is different from the second random masking operation; the first random zero operation is different from the second random zero operation.
3. The method according to claim 1, wherein calculating the loss value according to a difference between the first feature data and the second feature data of the same sample data, and a difference between the first feature data and the second feature data of different sample data, comprises:
calculating a first angle difference of first characteristic data and second characteristic data of each sample data in a characteristic vector space, calculating a second angle difference of the first characteristic data of each two different sample data in the characteristic vector space, and calculating a loss value according to each first angle difference, each second angle difference and the number of the sample data;
or, calculating a first angle difference between the first characteristic data and the second characteristic data of each sample data in a characteristic vector space, calculating a third angle difference between the second characteristic data of each two different sample data in the characteristic vector space, and calculating a loss value according to each first angle difference, each third angle difference and the number of the sample data.
4. The method of claim 1, wherein the inputting at least two pieces of sample data into the information recommendation model, performing first data feature extraction, and obtaining first feature data of the at least two pieces of sample data comprises:
inputting at least two pieces of user behavior data into a user data feature extraction submodel in an information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of user behavior data;
inputting at least two pieces of recommended object data into a recommended object feature extraction submodel in an information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of recommended object data;
inputting the at least two pieces of sample data into the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of sample data, including:
inputting the at least two pieces of user behavior data into a user data feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of user behavior data;
and inputting the at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of recommended object data.
5. The method of claim 4, wherein the inputting of the at least two pieces of user behavior data into a user data feature extraction submodel in the information recommendation model and the first data feature extraction to obtain the first feature data of the at least two pieces of user behavior data comprises:
performing first random mask operation on at least two pieces of user behavior data, and inputting a user data feature extraction sub-model in an information recommendation model to obtain first feature data of the at least two pieces of user behavior data;
or, carrying out a first random zero setting operation on hidden node weights of a user data feature extraction submodel in an information recommendation model, and inputting at least two pieces of user behavior data into the user data feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of user behavior data;
or, carrying out a first random zero setting operation on hidden node weights of a user data feature extraction submodel in an information recommendation model, carrying out a first random mask operation on at least two pieces of user behavior data, and inputting the user data feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of user behavior data;
the method for inputting at least two pieces of recommended object data into a recommended object feature extraction submodel in an information recommendation model to perform first data feature extraction to obtain first feature data of the at least two pieces of recommended object data includes:
performing first random masking operation on at least two pieces of recommended object data, and inputting a recommended object feature extraction sub-model in an information recommendation model to obtain first feature data of the at least two pieces of recommended object data;
or, carrying out a first random zero setting operation on hidden node weights of a recommended object feature extraction submodel in an information recommendation model, and inputting at least two pieces of recommended object data into the recommended object feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of recommended object data;
or, performing a first random zero setting operation on hidden node weights of a recommended object feature extraction submodel in an information recommendation model, performing a first random mask operation on at least two pieces of recommended object data, and inputting the recommended object feature extraction submodel in the information recommendation model to obtain first feature data of the at least two pieces of recommended object data;
the step of inputting the at least two pieces of user behavior data into a user data feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of user behavior data includes:
performing second random mask operation on the at least two pieces of user behavior data, and inputting the user data feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of user behavior data;
or, performing a second random zero setting operation on hidden node weights of the user data feature extraction submodel in the information recommendation model, and inputting the at least two pieces of user behavior data into the user data feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of user behavior data;
or, performing a second random zero setting operation on hidden node weights of the user data feature extraction submodels in the information recommendation model, performing a second random mask operation on the at least two pieces of user behavior data, and inputting the user data feature extraction submodels in the information recommendation model to obtain first feature data of the at least two pieces of user behavior data;
the step of inputting the at least two pieces of recommended object data into a recommended object feature extraction submodel in the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of recommended object data includes:
performing second random masking operation on the at least two pieces of recommended object data, and inputting the recommended object feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of recommended object data;
or, performing a second random zero setting operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, and inputting the at least two pieces of recommended object data into the recommended object feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of recommended object data;
or, performing a second random zero setting operation on hidden node weights of a recommended object feature extraction submodel in the information recommendation model, performing a second random mask operation on the at least two pieces of recommended object data, and inputting the recommended object feature extraction submodel in the information recommendation model to obtain second feature data of the at least two pieces of recommended object data;
wherein the first random masking operation is different from the second random masking operation; the first random zero operation is different from the second random zero operation.
6. The method according to claim 4, wherein calculating the loss value according to a difference between the first feature data and the second feature data of the same sample data, and a difference between the first feature data and the second feature data of different sample data, comprises:
calculating a first sub-loss value according to the difference between the first characteristic data and the second characteristic data of the same user behavior data, and the difference between the first characteristic data or the second characteristic data of different user behavior data;
and calculating a second sub-loss value according to the difference between the first characteristic data and the second characteristic data of the same recommendation object data, and the difference between the first characteristic data or the second characteristic data of different recommendation object data.
7. The method of claim 6, wherein calculating the first sub-penalty value based on a difference between the first feature data and the second feature data of the same user behavior data and a difference between the first feature data or the second feature data of different user behavior data comprises:
calculating a fourth angle difference of the first characteristic data and the second characteristic data of each user behavior data in a characteristic vector space, calculating a fifth angle difference of the first characteristic data of each two different user behavior data in the characteristic vector space, and calculating a first sub-loss value according to each fourth angle difference, each fifth angle difference and the number of the user behavior data;
or calculating a fourth angle difference of the first characteristic data and the second characteristic data of each user behavior data in a characteristic vector space, calculating a sixth angle difference of the second characteristic data of each two different user behavior data in the characteristic vector space, and calculating a first sub-loss value according to each fourth angle difference, each sixth angle difference and the number of the user behavior data;
the calculating a second sub-loss value according to a difference between the first feature data and the second feature data of the same recommendation object data, and a difference between the first feature data of different recommendation object data or a difference between the second feature data includes:
calculating a seventh angle difference of the first characteristic data and the second characteristic data of each recommended object data in a characteristic vector space, calculating an eighth angle difference of the first characteristic data of each two different recommended object data in the characteristic vector space, and calculating a second sub-loss value according to each seventh angle difference, each eighth angle difference and the quantity of the recommended object data;
or, calculating a seventh angle difference of the first feature data and the second feature data of each piece of recommendation object data in a feature vector space, calculating a ninth angle difference of the second feature data of each two different pieces of recommendation object data in the feature vector space, and calculating a second sub-loss value according to each seventh angle difference, each ninth angle difference and the number of the recommendation object data.
8. The method according to claim 6, wherein the adjusting the model parameters of the information recommendation model by using the loss value, repeatedly performing the inputting of at least two sample data into the information recommendation model, performing the first data feature extraction and the subsequent steps until a stop condition is reached, and obtaining the initialization model parameters of the information recommendation model comprises:
and adjusting the model parameters of the user data feature extraction submodel in the information recommendation model by using the first sub-loss value, adjusting the model parameters of the recommendation object feature extraction submodel in the information recommendation model by using the second sub-loss value, repeatedly executing the steps of inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain the initialization model parameters of the user data feature extraction submodel in the information recommendation model and the initialization model parameters of the recommendation object feature extraction submodel in the information recommendation model.
9. An apparatus for training an information recommendation model, the apparatus comprising:
the first feature extraction unit is used for inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction to obtain first feature data of the at least two pieces of sample data; the sample data comprises user behavior data and recommendation object data;
the second feature extraction unit is used for inputting the at least two pieces of sample data into the information recommendation model, and performing second data feature extraction to obtain second feature data of the at least two pieces of sample data;
the calculation unit is used for calculating a loss value according to the difference between the first characteristic data and the second characteristic data of the same sample data, and the difference between the first characteristic data or the second characteristic data of different sample data;
the execution unit is used for adjusting the model parameters of the information recommendation model by using the loss value, repeatedly executing the step of inputting at least two pieces of sample data into the information recommendation model, and performing first data feature extraction and subsequent steps until a stop condition is reached to obtain the initialization model parameters of the information recommendation model;
and the adjusting unit is used for adjusting the model parameters of the information recommendation model on the basis of the initialization model parameters of the information recommendation model by using the training data to obtain the trained information recommendation model.
10. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement a method of training an information recommendation model as recited in any of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, wherein the program, when being executed by a processor, is adapted to carry out a method of training an information recommendation model according to any one of claims 1-8.
CN202111294582.5A 2021-11-03 2021-11-03 Training method, device and equipment of information recommendation model Pending CN114021010A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111294582.5A CN114021010A (en) 2021-11-03 2021-11-03 Training method, device and equipment of information recommendation model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111294582.5A CN114021010A (en) 2021-11-03 2021-11-03 Training method, device and equipment of information recommendation model

Publications (1)

Publication Number Publication Date
CN114021010A true CN114021010A (en) 2022-02-08

Family

ID=80060207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111294582.5A Pending CN114021010A (en) 2021-11-03 2021-11-03 Training method, device and equipment of information recommendation model

Country Status (1)

Country Link
CN (1) CN114021010A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117708599A (en) * 2024-02-04 2024-03-15 荣耀终端有限公司 Ground material identification method, network training method and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117708599A (en) * 2024-02-04 2024-03-15 荣耀终端有限公司 Ground material identification method, network training method and electronic equipment

Similar Documents

Publication Publication Date Title
CN110688528A (en) Method, apparatus, electronic device, and medium for generating classification information of video
CN111831855B (en) Method, apparatus, electronic device, and medium for matching videos
CN112650841A (en) Information processing method and device and electronic equipment
CN113505206B (en) Information processing method and device based on natural language reasoning and electronic equipment
CN115456167B (en) Lightweight model training method, image processing device and electronic equipment
CN112712801A (en) Voice wake-up method and device, electronic equipment and storage medium
CN115908640A (en) Method and device for generating image, readable medium and electronic equipment
CN113222813A (en) Image super-resolution reconstruction method and device, electronic equipment and storage medium
CN114240506A (en) Modeling method of multi-task model, promotion content processing method and related device
CN114021010A (en) Training method, device and equipment of information recommendation model
CN113051933A (en) Model training method, text semantic similarity determination method, device and equipment
CN112241761B (en) Model training method and device and electronic equipment
CN111967584A (en) Method, device, electronic equipment and computer storage medium for generating countermeasure sample
CN114625876B (en) Method for generating author characteristic model, method and device for processing author information
CN116258911A (en) Training method, device, equipment and storage medium for image classification model
CN113837808B (en) Promotion information pushing method, device, equipment, medium and product
CN113361621B (en) Method and device for training model
CN116168267A (en) Training method, device, equipment and medium for multi-task neural network model
CN111680754B (en) Image classification method, device, electronic equipment and computer readable storage medium
CN114926234A (en) Article information pushing method and device, electronic equipment and computer readable medium
CN111310794B (en) Target object classification method and device and electronic equipment
CN114492400A (en) Title entity recognition model training method, title entity recognition method and device
CN115688042A (en) Model fusion method, device, equipment and storage medium
CN114792086A (en) Information extraction method, device, equipment and medium supporting text cross coverage
CN112381184A (en) Image detection method, image detection device, electronic equipment and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination