CN112446507A - Recommendation model training method and device, terminal device and storage medium - Google Patents
Recommendation model training method and device, terminal device and storage medium Download PDFInfo
- Publication number
- CN112446507A CN112446507A CN202011382255.0A CN202011382255A CN112446507A CN 112446507 A CN112446507 A CN 112446507A CN 202011382255 A CN202011382255 A CN 202011382255A CN 112446507 A CN112446507 A CN 112446507A
- Authority
- CN
- China
- Prior art keywords
- training
- model
- target recommendation
- recommendation model
- parameters
- 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.)
- Granted
Links
- 238000012549 training Methods 0.000 title claims abstract description 419
- 238000000034 method Methods 0.000 title claims abstract description 41
- 230000002776 aggregation Effects 0.000 claims abstract description 57
- 238000004220 aggregation Methods 0.000 claims abstract description 57
- 238000001514 detection method Methods 0.000 claims abstract description 37
- 238000012216 screening Methods 0.000 claims abstract description 30
- 238000004590 computer program Methods 0.000 claims description 15
- 238000012360 testing method Methods 0.000 claims description 11
- 238000013473 artificial intelligence Methods 0.000 abstract description 5
- 238000005516 engineering process Methods 0.000 abstract description 2
- 230000000694 effects Effects 0.000 description 7
- 230000004044 response Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000006116 polymerization reaction Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000012552 review Methods 0.000 description 3
- 238000010276 construction Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
- G06N20/20—Ensemble learning
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Artificial Intelligence (AREA)
- Filters That Use Time-Delay Elements (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application is suitable for the technical field of artificial intelligence, and provides a recommendation model training method, a recommendation model training device, terminal equipment and a storage medium, wherein the method comprises the following steps: inquiring a target recommendation model according to the model training instruction; inquiring the training participated objects according to the model training labels, carrying out state detection on the training participated objects, and screening the training participated objects according to the state detection result; sending the target recommendation model to a training participant for model training, performing parameter aggregation on model parameters after model training in the training participant to obtain aggregation parameters, and updating the parameters of the target recommendation model according to the aggregation parameters; and if the target recommendation model after the parameter update meets the convergence condition, outputting the target recommendation model after the parameter update. According to the method and the device, object screening is performed through the state detection result of the training participated object, so that the training participated object in a busy state is removed, and the accuracy of training of the target recommendation model is improved. In addition, the application also relates to a block chain technology.
Description
Technical Field
The application relates to the field of artificial intelligence, in particular to a recommendation model training method and device, terminal equipment and a storage medium.
Background
In recent years, "artificial intelligence" has become a high-frequency word of media and social contact, and particularly in the field of education, many parents are attracted to the eyes as soon as an artificial intelligence education robot appears, and the artificial intelligence education robot can freely talk with children anytime and anywhere and even can perform barrier-free translation of Chinese and English bilingual. The scale of the existing artificial intelligent education robot equipment reaches millions, and in the face of sudden increase of user quantity, the education robot in the current stage has many defects, such as the problems of stealing of user information, slow information receiving, question answering, operation failure and the like, so that the experience degree of the user is reduced, and in addition, the education system of the modern society increasingly focuses on the quality education of students and focuses more on the comprehensive development and the personalized development of the students, so that when facing the students with different hobbies and characters, how to carry out rapid training of the model by the artificial intelligent education robot in a safe and reliable mode is an urgent problem to be solved. Accordingly, federal learning techniques have come to work.
The method has the advantages that the privacy of each user can be effectively guaranteed while the recommended model training is carried out in the federal learning process, but in the existing federal learning use process, the recommended model is subjected to federal training based on preset training participators, and when the preset training participators are in a busy state, the model training and the feedback of model parameters cannot be effectively carried out, so that the federal training efficiency of the recommended model is low.
Disclosure of Invention
In view of this, embodiments of the present application provide a recommendation model training method and apparatus, a terminal device, and a storage medium, so as to solve the problem that in the process of federate training of a recommendation model in the prior art, due to the fact that a preset training participant is in a busy state, model training and model parameter feedback cannot be effectively performed, and federate training efficiency of the recommendation model is low.
A first aspect of an embodiment of the present application provides a recommendation model training method, including:
receiving a model training instruction, and inquiring a target recommendation model according to the model training instruction;
inquiring a training participator according to a model training label in the model training instruction, carrying out state detection on the inquired training participator, and screening the training participator according to a state detection result, wherein the model training label is used for representing the type of the target recommendation model;
sending the target recommendation model to the screened training participators for model training, and respectively obtaining model parameters in the screened training participators;
performing parameter aggregation on the obtained model parameters to obtain aggregation parameters, and performing parameter updating on the target recommendation model according to the aggregation parameters;
and if the target recommendation model after the parameter update meets the convergence condition, outputting the target recommendation model after the parameter update.
Further, the querying a training participant according to a model training label in the model training instruction, performing state detection on the queried training participant, and screening the training participant according to a state detection result includes:
performing object query according to a model training label in the model training instruction to obtain the training participating objects, and respectively obtaining the use states of the training participating objects, wherein the use states comprise idle time and idle memory corresponding to the training participating objects;
and obtaining a preset model training condition in the model training instruction, and screening the training participators according to the model training condition and the use states of the training participators, wherein the model training condition is used for judging whether the use states of the training participators can participate in the training of the target recommendation model.
Further, the screening the training participants according to the model training conditions and the usage statuses of the training participants includes:
and if the idle time of the training participated object is less than the preset time in the model training condition, or the idle memory of the training participated object is less than the preset memory in the model training condition, deleting the training participated object.
Further, the sending the target recommendation model to the screened training participation objects for model training, and respectively obtaining model parameters of the screened training participation objects after training the target recommendation model includes:
acquiring initial parameters of the target recommendation model, and respectively sending the initial parameters to the screened training participation objects;
respectively indicating the training participants to construct local models according to the initial parameters, and respectively indicating the training participants to perform model training on the local models until the local models are converged;
and if the local model is converged, obtaining the model parameters of the converged local model.
Further, after the parameter updating is performed on the target recommendation model according to the aggregation parameter, the method further includes:
inquiring a training participator according to the updated model training label of the target recommendation model, carrying out state detection on the inquired training participator, and screening the training participator according to a state detection result;
sending the updated target recommendation model to the screened training participators for model training, and respectively obtaining model parameters in the screened training participators;
and performing parameter aggregation on the obtained model parameters to obtain aggregation parameters, performing parameter updating on the updated target recommendation model according to the aggregation parameters until the target recommendation model after parameter updating meets the convergence condition, and outputting the target recommendation model after parameter updating.
Further, the querying a target recommendation model according to the model training instruction includes:
acquiring user information in the model training instruction, wherein the user information comprises user examination scores or user course information;
calculating matching scores between the user information and different preset recommendation categories, wherein the matching scores are used for representing the matching degree between the user information and the preset recommendation categories;
and performing model query according to the preset recommendation category corresponding to the maximum matching score to obtain the target recommendation model.
Further, the performing parameter update on the target recommendation model according to the aggregation parameter includes:
updating the network weight in the target recommendation model according to the aggregation parameter, and performing model test on the target recommendation model after the weight is updated according to preset test set data to obtain a model loss value;
and if the model loss value is smaller than a loss threshold value, judging that the target recommendation model after weight updating meets the convergence condition.
A second aspect of an embodiment of the present application provides a recommendation model training apparatus, including:
the model query unit is used for receiving a model training instruction and querying a target recommendation model according to the model training instruction;
the object screening unit is used for querying a training participation object according to a model training label in the model training instruction, performing state detection on the queried training participation object, and screening the training participation object according to a state detection result, wherein the model training label is used for representing the type of the target recommendation model;
the model parameter acquisition unit is used for sending the target recommendation model to the screened training participation objects for model training and respectively acquiring model parameters of the screened training participation objects after training the target recommendation model;
the parameter aggregation unit is used for carrying out parameter aggregation on the obtained model parameters to obtain aggregation parameters, and carrying out parameter updating on the target recommendation model according to the aggregation parameters;
and the model output unit is used for outputting the target recommendation model after the parameters are updated if the target recommendation model after the parameters are updated meets the convergence condition.
A third aspect of the embodiments of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the terminal device, where the processor implements the steps of the recommendation model training method provided by the first aspect when executing the computer program.
A fourth aspect of the embodiments of the present application provides a storage medium, which stores a computer program that, when executed by a processor, implements the steps of the recommendation model training method provided by the first aspect.
The recommendation model training method, the recommendation model training device, the terminal equipment and the storage medium have the following beneficial effects: because the model training labels are used for representing the types of the target recommendation models, training participators matched with the types of the target recommendation models can be effectively inquired by inquiring the training participators according to the model training labels in the model training instructions, so that the accuracy of the training participators in training the target recommendation models is improved, the training participators in busy states can be effectively removed by detecting the states of the inquired training participators and screening the training participators according to the state detection results, the phenomenon of low federal training efficiency of the target recommendation models caused by the fact that the training participators in busy states cannot effectively perform model training and model parameter feedback is prevented, the obtained model parameters are aggregated to obtain aggregated parameters, and the model parameters after model training in different training participators can be effectively aggregated into parameter information, and further, the parameters of the target recommendation model are convenient to update.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart illustrating an implementation of a recommendation model training method according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating an implementation of a recommendation model training method according to another embodiment of the present application;
FIG. 3 is a flowchart illustrating an implementation of a method for training a recommendation model according to another embodiment of the present application;
fig. 4 is a block diagram illustrating a structure of a recommendation model training apparatus according to an embodiment of the present disclosure;
fig. 5 is a block diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The recommendation model training method according to the embodiment of the present application may be executed by a control device or a terminal (hereinafter referred to as a "mobile terminal").
Referring to fig. 1, fig. 1 shows a flowchart of an implementation of a recommendation model training method provided in an embodiment of the present application, including:
and step S10, receiving a model training instruction, and inquiring a target recommendation model according to the model training instruction.
The model training instruction stores model identifications, the model identifications stored in the model training instruction are matched with a model query table to obtain the target recommendation model, and the model query table stores corresponding relations between different model identifications and corresponding target recommendation models.
Optionally, in this step, the querying a target recommendation model according to the model training instruction includes:
the method comprises the steps of obtaining user information in a model training instruction, wherein the user information comprises user examination scores or user course information, the user examination scores comprise the examination scores of a user in a specified time, the examination types in the examination scores can be set according to requirements, for example, the user examination scores comprise math scores, Chinese scores, English scores or historical scores and the like in end-of-term examinations of the user, the user course information comprises learning time corresponding to different types of courses of the user in the specified time, and for example, the user course information comprises learning time corresponding to the Chinese courses, learning time corresponding to data courses or learning time corresponding to English courses and the like in the learning period of the user.
Specifically, in this step, by obtaining an information tag of the user information and respectively matching the obtained information tag with information tags of different preset recommendation categories, matching scores between the user information and the different preset recommendation categories are obtained, and the preset recommendation categories can be set according to requirements, where the preset recommendation categories in this embodiment include a learning plan recommendation category, a tutor class report category, and a review material purchase category.
Performing model query according to the preset recommendation category corresponding to the maximum matching score to obtain the target recommendation model, wherein a parameter query table is pre-stored in the embodiment, and the parameter query table stores corresponding relations between different preset recommendation categories and corresponding model parameters, so that the target recommendation model is obtained by matching the preset recommendation category corresponding to the maximum matching score with the parameter query table and performing model construction according to the queried model parameters, in the embodiment, when the preset recommendation category corresponding to the maximum matching score is a learning plan recommendation category, the correspondingly constructed target recommendation model is used for recommending a learning plan to the user, and when the preset recommendation category corresponding to the maximum matching score is a coaching report category, the correspondingly constructed target recommendation model is used for recommending the coaching report to the user, and when the preset recommendation category corresponding to the maximum matching score is the review material purchase category, correspondingly constructing the obtained target recommendation model for recommending the review material purchase to the user.
And step S20, inquiring training participatory objects according to the model training labels in the model training instruction, carrying out state detection on the inquired training participatory objects, and screening the training participatory objects according to the state detection result.
The model training labels are used for representing the types of the target recommendation models, training participation objects can be effectively inquired according to the model training labels in the model training instructions, the training participation objects matched with the types of the target recommendation models can be effectively inquired, and the accuracy of the training participation objects in training the target recommendation models is further improved.
Optionally, in this step, the state detection effect on the training participant is achieved by detecting the use state, the remaining memory, or the idle time of the training participant, and the training participant is screened according to the state detection result to remove the training participant in a busy state, so as to improve the subsequent training efficiency on the target recommendation model.
For example, when it is detected that the training participating object is executing the model training task, the remaining memory is less than the preset memory or the idle time is less than the preset time, it is determined that the training participating object is in a busy state, and the training participating object in the busy state is deleted, so that the phenomenon of low federal training efficiency of the target recommendation model caused by the fact that the training participating object in the busy state cannot effectively perform model training and model parameter feedback is prevented.
Step S30, sending the target recommendation model to the screened training participation objects for model training, and respectively obtaining model parameters of the screened training participation objects after training the target recommendation model.
The target recommendation model is sent to the screened training participators for model training, so that different training participators perform model training on the same target recommendation model based on own data, the effect of federal learning is achieved, and leakage of data on the training participators is prevented.
Specifically, in this step, model parameters after the screened training participators train the target recommendation model are respectively obtained, so as to obtain model parameters after different training participators perform model training on the target recommendation model based on their own data.
For example, in this step, the training participants after screening include training participant a1Training the participating subject a2And training the participating subjects a3Training of the participating object a1Training the participating subject a2And training the participating subjects a3Model parameters obtained after model training of the target detection model are respectively model parameters b1Model parameter b2And model parameters b3。
Optionally, in this step, the sending the target recommendation model to the filtered training participation objects for model training, and respectively obtaining model parameters of the filtered training participation objects after training the target recommendation model includes:
and acquiring initial parameters of the target recommendation model, and respectively sending the initial parameters to the screened training participated objects, wherein the accuracy of the local model construction on the subsequent training participated objects is effectively improved by respectively sending the initial parameters to the screened training participated objects.
And respectively instructing the training participators to construct local models according to the initial parameters, and respectively instructing the training participators to perform model training on the local models until the local models are converged, wherein the local models in different training participators are the same as the initial parameters of the target recommendation model, and the model parameters of the local models constructed among different training participators are the same, so that different training participators are ensured to perform model training on the same local models respectively, and because the local models are the same as the initial parameters of the target recommendation model, the training participators are respectively instructed to perform model training on the local models, so that model parameters of different training participators after training the target recommendation model can be obtained.
And if the local model is converged, obtaining the model parameters of the converged local model.
And step S40, performing parameter aggregation on the obtained model parameters to obtain aggregation parameters, and performing parameter updating on the target recommendation model according to the aggregation parameters.
Optionally, in this step, parameter aggregation of the model parameters may be performed in a manner of averaging or median, and parameter updating is performed on the target recommendation model according to the aggregation parameters, so that model training is performed on the target recommendation model based on data in different training participants, a federal training effect on the target recommendation model is achieved, and leakage of data of the training participants is prevented.
Optionally, in this step, the performing parameter update on the target recommendation model according to the aggregation parameter includes:
updating the network weight in the target recommendation model according to the aggregation parameters, performing model test on the target recommendation model after the weight is updated according to preset test set data to obtain a model loss value, wherein, by performing parameter replacement on the network weight in the target recommendation model according to the aggregation parameter, so as to achieve the effect of updating the target recommendation model, and test the accuracy of the target recommendation model after the parameters are updated by performing model test on the target recommendation model after the weights are updated according to the preset test set data, the model loss value is the error between the recommendation result output by the target recommendation model after the parameters are updated and the standard result, and when the model loss value is larger, the accuracy of the target recommendation model after the parameter updating is low, and when the loss value of the model is smaller, the accuracy of the target recommendation model after the parameter updating is high.
If the model loss value is smaller than the loss threshold value, it is determined that the target recommendation model after the weight update meets the convergence condition, where the loss threshold value may be set according to a requirement, and the loss threshold value is used to detect whether the target recommendation model after the parameter update converges, that is, when the model loss value is smaller than the loss threshold value, it is determined that the target recommendation model corresponding to the model loss value converges.
And step S50, if the target recommendation model after parameter updating meets the convergence condition, outputting the target recommendation model after parameter updating.
In the embodiment, because the model training labels are used for representing the types of the target recommendation models, the training participated objects matched with the types of the target recommendation models can be effectively inquired by inquiring the training participated objects according to the model training labels in the model training instructions, so that the accuracy of the training participated objects for the target recommendation models is improved, the training participated objects in busy states can be effectively removed by carrying out state detection on the inquired training participated objects and screening the training participated objects according to the state detection results, the phenomenon that the federal training efficiency of the target recommendation models is low because the training participated objects in busy states cannot effectively carry out model training and model parameter feedback is prevented, the obtained model parameters are aggregated to obtain the aggregated parameters, and the model parameters after model training in different training participated objects can be effectively aggregated into the parameter information, and further, the parameters of the target recommendation model are convenient to update.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of a recommendation model training method according to another embodiment of the present application. The recommended model training method provided in this embodiment is further detailed in step S30 in the embodiment corresponding to fig. 1, and includes:
and step S31, performing object query according to the model training labels in the model training instruction to obtain the training participating objects, and respectively acquiring the use states of the training participating objects.
When the corresponding training participation object is inquired, state inquiry instructions are respectively sent to different training participation objects, and response information of the training participation object to the state inquiry instructions is received.
In this step, the response time is obtained according to the time of receiving the response information, the idle time and the idle memory stored in the response information are obtained, and the use state of the corresponding training participation object is obtained based on the response time, the idle time and the idle memory.
And step S32, obtaining model training conditions preset in the model training instruction, and screening the training participators according to the model training conditions and the using states of the training participators.
The model training condition preset in the model training instruction can be set according to user requirements, and the model training condition is used for judging whether the use state of a training participant can participate in the training of the target recommendation model.
Specifically, in this step, the screening the training participants according to the model training conditions and the usage statuses of the training participants includes:
and if the idle time of the training participated object is less than the preset time in the model training condition, or the idle memory of the training participated object is less than the preset memory in the model training condition, deleting the training participated object.
Optionally, in this step, if the response time of the training participant is greater than a response threshold, the training participant is deleted.
In the embodiment, object query is performed according to the model training labels to obtain the training participation objects matched with the target recommendation model, accuracy of training of the target recommendation model is improved, the use states of the training participation objects are respectively obtained, the training participation objects are screened according to the model training conditions and the use states of the training participation objects, the training participation objects in a busy state can be effectively removed, and the phenomenon that federate training efficiency of the target recommendation model is low due to the fact that the training participation objects are in the busy state and model training and model parameter feedback cannot be effectively performed is avoided.
Referring to fig. 3, fig. 3 is a flowchart illustrating an implementation of a recommendation model training method according to another embodiment of the present application. After step S40 in fig. 1, the method for training a recommendation model provided in this embodiment further includes:
step S60, inquiring training participator according to the updated model training label of the target recommendation model, carrying out state detection on the inquired training participator, and screening the training participator according to the state detection result.
The training participation objects are inquired according to the model training labels of the updated target recommendation model so as to inquire the corresponding training participation objects again, and the accuracy of the training of the updated target recommendation model is improved.
In the step, the inquired training participator is subjected to state detection, and the training participator is screened according to a state detection result, so that the condition that the updated target recommendation model cannot be effectively subjected to model training and model parameter feedback because the training participator is in a busy state is prevented.
Step S70, the updated target recommendation model is sent to the screened training participation objects for model training, and model parameters in the screened training participation objects are respectively obtained.
The updated target recommendation model is sent to the screened training participator for model training, so that the screened training participator is instructed to respectively perform model training on the updated target recommendation model again based on self data, and the federal training effect of the updated target recommendation model is achieved.
In the step, model parameters obtained by training the updated target recommendation model by the training participator based on self data are obtained by respectively obtaining model parameters after model training in the screened training participator.
Step S80, performing parameter aggregation on the obtained model parameters to obtain aggregation parameters, performing parameter updating on the updated target recommendation model according to the aggregation parameters, and outputting the target recommendation model after parameter updating until the target recommendation model after parameter updating meets the convergence condition.
The method comprises the steps of obtaining a polymerization parameter by performing parameter polymerization on an obtained model parameter, and updating the parameter of an updated target recommendation model according to the polymerization parameter so as to achieve the effect of iteratively updating the target recommendation model.
In this embodiment, the training participators are queried according to the model training labels of the updated target recommendation model to query the corresponding training participators again, so that the accuracy of training the updated target recommendation model is improved, model parameters after model training in the screened training participators are obtained respectively to obtain model parameters obtained by the training participators training the updated target recommendation model based on self data, aggregation parameters are obtained by performing parameter aggregation on the obtained model parameters, and the updated target recommendation model is subjected to parameter update according to the aggregation parameters, so that the effect of iteratively updating the target recommendation model is achieved.
In all embodiments of the application, the parameter update is performed on the target recommendation model based on the aggregation parameter to obtain the parameter-updated target recommendation model, and specifically, the parameter-updated target recommendation model is obtained by performing the parameter update on the target recommendation model by using the aggregation parameter. Uploading the target recommendation model with the updated parameters to the block chain can ensure the safety and the just transparency of the target recommendation model to the user. The user equipment can download the parameter-updated target recommendation model from the blockchain so as to verify whether the parameter-updated target recommendation model is tampered. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Referring to fig. 4, fig. 4 is a block diagram illustrating a recommended model training apparatus 100 according to an embodiment of the present disclosure. In this embodiment, each unit included in the recommendation model training apparatus 100 is configured to execute each step in the embodiment corresponding to fig. 1 and fig. 2. Please refer to fig. 1, fig. 2, and fig. 3, and the corresponding embodiments of fig. 1, fig. 2, and fig. 3. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 4, the recommended model training apparatus 100 includes: a model query unit 10, an object screening unit 11, a model parameter obtaining unit 12 and a parameter aggregation unit 13, wherein:
and the model query unit 10 is configured to receive a model training instruction and query the target recommendation model according to the model training instruction.
Wherein, the model querying unit 10 is further configured to: acquiring user information in the model training instruction, wherein the user information comprises user examination scores or user course information;
calculating matching scores between the user information and different preset recommendation categories, wherein the matching scores are used for representing the matching degree between the user information and the preset recommendation categories;
and performing model query according to the preset recommendation category corresponding to the maximum matching score to obtain the target recommendation model.
And the object screening unit 11 is configured to query a training participant according to a model training label in the model training instruction, perform state detection on the queried training participant, and screen the training participant according to a state detection result, where the model training label is used to represent the type of the target recommendation model.
Wherein, the object screening unit 11 is further configured to: performing object query according to a model training label in the model training instruction to obtain the training participating objects, and respectively obtaining the use states of the training participating objects, wherein the use states comprise idle time and idle memory corresponding to the training participating objects;
and obtaining a preset model training condition in the model training instruction, and screening the training participators according to the model training condition and the use states of the training participators, wherein the model training condition is used for judging whether the use states of the training participators can participate in the training of the target recommendation model.
Optionally, the object screening unit 11 is further configured to: and if the idle time of the training participated object is less than the preset time in the model training condition, or the idle memory of the training participated object is less than the preset memory in the model training condition, deleting the training participated object.
And the model parameter obtaining unit 12 is configured to send the target recommendation model to the screened training participants for model training, and obtain model parameters of the screened training participants for the training of the target recommendation model respectively.
Wherein, the model parameter obtaining unit 12 is further configured to: acquiring initial parameters of the target recommendation model, and respectively sending the initial parameters to the screened training participation objects;
respectively indicating the training participants to construct local models according to the initial parameters, and respectively indicating the training participants to perform model training on the local models until the local models are converged;
and if the local model is converged, obtaining the model parameters of the converged local model.
And the parameter aggregation unit 13 is configured to perform parameter aggregation on the obtained model parameters to obtain aggregation parameters, and perform parameter update on the target recommendation model according to the aggregation parameters.
Wherein the parameter aggregation unit 13 is further configured to: inquiring a training participator according to the updated model training label of the target recommendation model, carrying out state detection on the inquired training participator, and screening the training participator according to a state detection result;
sending the updated target recommendation model to the screened training participators for model training, and respectively obtaining model parameters in the screened training participators;
and performing parameter aggregation on the obtained model parameters to obtain aggregation parameters, performing parameter updating on the updated target recommendation model according to the aggregation parameters until the target recommendation model after parameter updating meets the convergence condition, and outputting the target recommendation model after parameter updating.
Optionally, the parameter aggregation unit 13 is further configured to: updating the network weight in the target recommendation model according to the aggregation parameter, and performing model test on the target recommendation model after the weight is updated according to preset test set data to obtain a model loss value;
and if the model loss value is smaller than a loss threshold value, judging that the target recommendation model after weight updating meets the convergence condition.
And the model output unit 14 is configured to output the target recommendation model after the parameter update if the target recommendation model after the parameter update meets the convergence condition.
In the embodiment, because the model training labels are used for representing the types of the target recommendation models, the training participated objects matched with the types of the target recommendation models can be effectively inquired by inquiring the training participated objects according to the model training labels in the model training instructions, so that the accuracy of the training participated objects for the target recommendation models is improved, the training participated objects in busy states can be effectively removed by carrying out state detection on the inquired training participated objects and screening the training participated objects according to the state detection results, the phenomenon that the federal training efficiency of the target recommendation models is low because the training participated objects in busy states cannot effectively carry out model training and model parameter feedback is prevented, the obtained model parameters are aggregated to obtain the aggregated parameters, and the model parameters after model training in different training participated objects can be effectively aggregated into the parameter information, and further, the parameters of the target recommendation model are convenient to update.
Fig. 5 is a block diagram of a terminal device 2 according to another embodiment of the present application. As shown in fig. 5, the terminal device 2 of this embodiment includes: a processor 20, a memory 21 and a computer program 22, such as a program recommending a model training method, stored in said memory 21 and executable on said processor 20. The processor 20, when executing the computer program 23, implements the steps in the above embodiments of the recommended model training method, such as S10 to S50 shown in fig. 1, or S31 to S32 shown in fig. 2, or S60 to S80 shown in fig. 3. Alternatively, when the processor 20 executes the computer program 22, the functions of the units in the embodiment corresponding to fig. 4, for example, the functions of the units 10 to 13 shown in fig. 4, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 5, which is not repeated herein.
Illustratively, the computer program 22 may be divided into one or more units, which are stored in the memory 21 and executed by the processor 20 to accomplish the present application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 22 in the terminal device 2. For example, the computer program 22 may be divided into a model query unit 10, an object filtering unit 11, a model parameter obtaining unit 12, and a parameter aggregation unit 13, each of which functions as described above.
The terminal device may include, but is not limited to, a processor 20, a memory 21. It will be appreciated by those skilled in the art that fig. 5 is merely an example of a terminal device 2 and does not constitute a limitation of the terminal device 2 and may include more or less components than those shown, or some components may be combined, or different components, for example the terminal device may also include input output devices, network access devices, buses, etc.
The Processor 20 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 21 may be an internal storage unit of the terminal device 2, such as a hard disk or a memory of the terminal device 2. The memory 21 may also be an external storage device of the terminal device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 2. Further, the memory 21 may also include both an internal storage unit and an external storage device of the terminal device 2. The memory 21 is used for storing the computer program and other programs and data required by the terminal device. The memory 21 may also be used to temporarily store data that has been output or is to be output.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (10)
1. A method for training a recommendation model, comprising:
receiving a model training instruction, and inquiring a target recommendation model according to the model training instruction;
inquiring a training participator according to a model training label in the model training instruction, carrying out state detection on the inquired training participator, and screening the training participator according to a state detection result, wherein the model training label is used for representing the type of the target recommendation model;
sending the target recommendation model to the screened training participators for model training, and respectively obtaining model parameters of the screened training participators after training the target recommendation model;
performing parameter aggregation on the obtained model parameters to obtain aggregation parameters, and performing parameter updating on the target recommendation model according to the aggregation parameters;
and if the target recommendation model after the parameter update meets the convergence condition, outputting the target recommendation model after the parameter update.
2. The method for training a recommendation model according to claim 1, wherein the querying training participation objects according to the model training labels in the model training instructions, performing state detection on the queried training participation objects, and screening the training participation objects according to the state detection result comprises:
performing object query according to a model training label in the model training instruction to obtain the training participating objects, and respectively obtaining the use states of the training participating objects, wherein the use states comprise idle time and idle memory corresponding to the training participating objects;
and obtaining a preset model training condition in the model training instruction, and screening the training participators according to the model training condition and the use states of the training participators, wherein the model training condition is used for judging whether the use states of the training participators can participate in the training of the target recommendation model.
3. The recommendation model training method according to claim 2, wherein the screening of the training participants according to the model training conditions and the usage statuses of the training participants comprises:
and if the idle time of the training participated object is less than the preset time in the model training condition, or the idle memory of the training participated object is less than the preset memory in the model training condition, deleting the training participated object.
4. The recommendation model training method according to claim 1, wherein the sending the target recommendation model to the screened training participants for model training and respectively obtaining model parameters of the screened training participants after training the target recommendation model comprises:
acquiring initial parameters of the target recommendation model, and respectively sending the initial parameters to the screened training participation objects;
respectively indicating the training participants to construct local models according to the initial parameters, and respectively indicating the training participants to perform model training on the local models until the local models are converged;
and if the local model is converged, obtaining the model parameters of the converged local model.
5. The recommendation model training method according to claim 1, wherein after the parameter updating of the target recommendation model according to the aggregation parameter, the method further comprises:
inquiring the training participation objects according to the updated model training labels of the target recommendation model, carrying out state detection on the inquired training participation objects, and screening the training participation objects according to the state detection result;
sending the updated target recommendation model to the screened training participators for model training, and respectively obtaining model parameters in the screened training participators;
and performing parameter aggregation on the obtained model parameters to obtain aggregation parameters, performing parameter updating on the updated target recommendation model according to the aggregation parameters until the target recommendation model after parameter updating meets the convergence condition, and outputting the target recommendation model after parameter updating.
6. The recommendation model training method of claim 1, wherein said querying a target recommendation model according to the model training instructions comprises:
acquiring user information in the model training instruction, wherein the user information comprises user examination scores or user course information;
calculating matching scores between the user information and different preset recommendation categories, wherein the matching scores are used for representing the matching degree between the user information and the preset recommendation categories;
and performing model query according to the preset recommendation category corresponding to the maximum matching score to obtain the target recommendation model.
7. The recommendation model training method according to claim 1, wherein the performing parameter update on the target recommendation model according to the aggregation parameter comprises:
updating the network weight in the target recommendation model according to the aggregation parameter, and performing model test on the target recommendation model after the weight is updated according to preset test set data to obtain a model loss value;
and if the model loss value is smaller than a loss threshold value, judging that the target recommendation model after weight updating meets the convergence condition.
8. A recommendation model training apparatus, comprising:
the model query unit is used for receiving a model training instruction and querying a target recommendation model according to the model training instruction;
the object screening unit is used for querying a training participation object according to a model training label in the model training instruction, performing state detection on the queried training participation object, and screening the training participation object according to a state detection result, wherein the model training label is used for representing the type of the target recommendation model;
the model parameter acquisition unit is used for sending the target recommendation model to the screened training participation objects for model training and respectively acquiring model parameters of the screened training participation objects after training the target recommendation model;
the parameter aggregation unit is used for carrying out parameter aggregation on the obtained model parameters to obtain aggregation parameters, and carrying out parameter updating on the target recommendation model according to the aggregation parameters;
and the model output unit is used for outputting the target recommendation model after the parameters are updated if the target recommendation model after the parameters are updated meets the convergence condition.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A storage medium storing a computer program, characterized in that the computer program realizes the steps of the method according to any one of claims 1 to 7 when executed by a processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011382255.0A CN112446507B (en) | 2020-12-01 | 2020-12-01 | Recommendation model training method and device, terminal equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011382255.0A CN112446507B (en) | 2020-12-01 | 2020-12-01 | Recommendation model training method and device, terminal equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112446507A true CN112446507A (en) | 2021-03-05 |
CN112446507B CN112446507B (en) | 2024-07-26 |
Family
ID=74739732
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011382255.0A Active CN112446507B (en) | 2020-12-01 | 2020-12-01 | Recommendation model training method and device, terminal equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112446507B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113761350A (en) * | 2021-03-08 | 2021-12-07 | 北京京东振世信息技术有限公司 | Data recommendation method, related device and data recommendation system |
CN114500642A (en) * | 2022-02-25 | 2022-05-13 | 百度在线网络技术(北京)有限公司 | Model application method and device and electronic equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111027714A (en) * | 2019-12-11 | 2020-04-17 | 腾讯科技(深圳)有限公司 | Artificial intelligence-based object recommendation model training method, recommendation method and device |
CN111612168A (en) * | 2020-06-30 | 2020-09-01 | 腾讯科技(深圳)有限公司 | Management method and related device for machine learning task |
CN111754000A (en) * | 2020-06-24 | 2020-10-09 | 清华大学 | Quality-aware edge intelligent federal learning method and system |
-
2020
- 2020-12-01 CN CN202011382255.0A patent/CN112446507B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111027714A (en) * | 2019-12-11 | 2020-04-17 | 腾讯科技(深圳)有限公司 | Artificial intelligence-based object recommendation model training method, recommendation method and device |
CN111754000A (en) * | 2020-06-24 | 2020-10-09 | 清华大学 | Quality-aware edge intelligent federal learning method and system |
CN111612168A (en) * | 2020-06-30 | 2020-09-01 | 腾讯科技(深圳)有限公司 | Management method and related device for machine learning task |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113761350A (en) * | 2021-03-08 | 2021-12-07 | 北京京东振世信息技术有限公司 | Data recommendation method, related device and data recommendation system |
CN113761350B (en) * | 2021-03-08 | 2024-09-20 | 北京京东振世信息技术有限公司 | Data recommendation method, related device and data recommendation system |
CN114500642A (en) * | 2022-02-25 | 2022-05-13 | 百度在线网络技术(北京)有限公司 | Model application method and device and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN112446507B (en) | 2024-07-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112132277A (en) | Federal learning model training method and device, terminal equipment and storage medium | |
KR20200135892A (en) | Method, apparatus and computer program for providing personalized educational curriculum and contents through user learning ability | |
CN108959331B (en) | Method, apparatus and computer program for using a device learning framework | |
CN108345593A (en) | Question bank system-based teaching lecture generation method and device | |
US11410568B2 (en) | Dynamic evaluation of event participants using a smart context-based quiz system | |
CN110286938B (en) | Method and apparatus for outputting evaluation information for user | |
CN112446507A (en) | Recommendation model training method and device, terminal device and storage medium | |
CN110472087A (en) | A kind of facial expression image recommended method, device, equipment and medium | |
CN110706140A (en) | Classroom interactive learning method, device, system and computer readable storage medium | |
CN110990707A (en) | Learning content pushing method, system, equipment and storage medium | |
CN112101231A (en) | Learning behavior monitoring method, terminal, small program and server | |
CN110727782A (en) | Question and answer corpus generation method and system | |
CN115270923A (en) | Scene-based visual intelligent decision method and system | |
CN110427277B (en) | Data verification method, device, equipment and storage medium | |
CN108039081B (en) | Robot teaching evaluation method and device | |
CN115828022B (en) | Data identification method, federal training model, device and equipment | |
CN116483948B (en) | Cloud computing-based SaaS operation and maintenance management method, system, device and storage medium | |
CN118042232A (en) | Knowledge point-based video playing method and device and electronic equipment | |
CN112115703A (en) | Article evaluation method and device | |
CN110516128A (en) | Information configuring methods, equipment, storage medium and device | |
CN112528790B (en) | Teaching management method, device and server based on behavior recognition | |
CN115034688A (en) | Teacher teaching evaluation analysis system and method | |
WO2017215248A1 (en) | Method, system and device for selecting target user | |
CN112528221A (en) | Knowledge and capability binary tracking method based on continuous matrix decomposition | |
CN112565663B (en) | Demand question reply method and device, terminal equipment and storage 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |