A method and device for model training

By determining the weights of training samples and adjusting the prediction model parameters, valuable training samples are screened, which solves the inaccuracy problem of the prediction model in unmanned driving equipment and improves the prediction effect.

CN114120273BActive Publication Date: 2025-09-09BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111334977.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-11
Publication Date
2025-09-09
Estimated Expiration
2041-11-11

AI Technical Summary

Technical Problem

The existing prediction models for unmanned driving equipment have problems with large noise and data redundancy in the training samples, resulting in inaccurate prediction models.

Method used

By determining the weights of the training samples and adjusting the parameters of the prediction model according to the deviation between the predicted results and the actual results, valuable training samples are screened out for model training.

Benefits of technology

The accuracy of the prediction model is improved, the impact of noise samples on model training is reduced, and the prediction effect is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114120273B_ABST
    Figure CN114120273B_ABST
Patent Text Reader

Abstract

This specification discloses a method and device for model training, which relates to the field of unmanned driving. A sample set is obtained, and for each training sample in the sample set, the training sample is input into a prediction model to be trained to obtain a prediction result for the training sample, and based on the prediction result of the training sample and the actual result of the training sample, the weight of the training sample for the prediction model is determined as the weight corresponding to the training sample. According to the weight corresponding to the training sample, the loss value of the training sample for the prediction model is determined, and according to the loss value, the parameter adjustment gradient of the training sample for the prediction model is determined. According to the parameter adjustment gradient, the parameters included in the prediction model are adjusted to complete the training of the prediction model, wherein, if the weight corresponding to the training sample is larger, the parameter adjustment gradient corresponding to the training sample is larger, thereby improving the prediction effect of the trained prediction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of unmanned driving, and in particular to a method and device for model training. Background Art

[0002] In unmanned driving technology, unmanned driving equipment usually needs to predict the trajectory of surrounding obstacles in the next period of time based on the trajectory of the surrounding obstacles in a period of time, and thus select subsequent driving strategies based on the predicted future trajectory of the surrounding obstacles.

[0003] In the existing technology, it is usually necessary to use a trained prediction model to predict the driving trajectory of surrounding obstacles, so a large number of training samples are needed to train the prediction model. However, among the large number of training samples, there are often training samples that are not so valuable to the prediction model. For example, there are samples with high obstacle trajectory noise in the training samples, and a large number of samples with data redundancy (for example, the direction of the obstacle trajectory is relatively repetitive), which may cause the trained prediction model to have certain inaccuracies.

[0004] Therefore, how to make the trained prediction model more accurate in trajectory prediction is an urgent problem to be solved. Summary of the Invention

[0005] This specification provides a model training method and device to partially solve the above-mentioned problems existing in the prior art.

[0006] This manual adopts the following technical solutions:

[0007] This manual provides a model training method, including:

[0008] Get a sample set;

[0009] For each training sample in the sample set, the training sample is input into the prediction model to be trained to obtain a prediction result for the training sample;

[0010] Determining a weight of the training sample for the prediction model based on the prediction result of the training sample and the actual result of the training sample, as the weight corresponding to the training sample;

[0011] Determine, based on the weight corresponding to the training sample, a loss value of the training sample for the prediction model, and determine, based on the loss value, a parameter adjustment gradient for the training sample for the prediction model, wherein the greater the weight corresponding to the training sample, the greater the parameter adjustment gradient;

[0012] According to the parameter adjustment gradient, the parameters included in the prediction model are adjusted to complete the training of the prediction model.

[0013] Optionally, determining a weight of the training sample for the prediction model based on the prediction result of the training sample and the actual result of the training sample as the weight corresponding to the training sample specifically includes:

[0014] Determining the deviation between the predicted result of the training sample and the actual result of the training sample;

[0015] The weight corresponding to the training sample is determined based on the deviation, the preset maximum deviation and the minimum deviation, wherein the relationship between the deviation and the weight satisfies: between the maximum deviation and the minimum deviation, there is a maximum value of the weight, and at the maximum deviation and the minimum deviation, the weight takes a minimum value.

[0016] Optionally, obtaining a sample set includes:

[0017] Get the sample set required for the current round of training;

[0018] For each training sample in the sample set, the training sample is input into the prediction model to be trained to obtain a prediction result for the training sample, specifically including:

[0019] For each training sample in the sample set, input the training sample into the prediction model to be trained in the current round to obtain a prediction result for the training sample;

[0020] Determining the weight of the training sample for the prediction model based on the prediction result of the training sample and the actual result of the training sample as the weight corresponding to the training sample, specifically including:

[0021] Determining, based on the prediction result of the training sample and the actual result of the training sample, a weight of the training sample for the prediction model in the current round of training, as the weight corresponding to the training sample in the current round;

[0022] Determining a loss value of the training sample for the prediction model based on the weight corresponding to the training sample in the current round, and determining a parameter adjustment gradient of the training sample for the prediction model based on the loss value, specifically including:

[0023] Determining, based on the weight corresponding to the training sample in the current round, a loss value of the training sample for the prediction model in the current round of training, and determining, based on the loss value, a parameter adjustment gradient of the training sample for the prediction model in the current round of training;

[0024] According to the parameter adjustment gradient, the parameters included in the prediction model are adjusted, specifically including:

[0025] According to the parameter adjustment gradient, the parameters included in the prediction model are adjusted in the current round to obtain an adjusted prediction model.

[0026] Optionally, the method further includes:

[0027] The adjusted prediction model is used as the prediction model to be trained in the next round;

[0028] According to the weight corresponding to each training sample contained in the sample set in the current round, training samples for use in the next round of training are screened out from the sample set, and based on the screened training samples, a sample set is constructed for training the prediction model to be trained in the next round in the next round of training.

[0029] Optionally, determining, based on the prediction result of the training sample and the actual result of the training sample, a weight of the training sample for the prediction model in the current round of training as the weight corresponding to the training sample in the current round, specifically includes:

[0030] Determining the deviation between the predicted result of the training sample and the actual result of the training sample;

[0031] Determine, based on the deviation, the determined maximum deviation corresponding to the current round, and the determined minimum deviation corresponding to the current round, a weight corresponding to the training sample in the current round, wherein the relationship between the deviation and the weight satisfies: a maximum value of the weight exists between the maximum deviation corresponding to the current round and the minimum deviation corresponding to the current round, and a minimum value of the weight exists at the maximum deviation corresponding to the current round and the minimum deviation corresponding to the current round;

[0032] Optionally, determining the maximum deviation corresponding to the current round and the minimum deviation corresponding to the current round specifically includes:

[0033] Determine the maximum deviation corresponding to the current round based on the round number corresponding to the current round and the maximum deviation corresponding to the previous round, and determine the minimum deviation corresponding to the current round based on the round number corresponding to the current round and the minimum deviation corresponding to the previous round, wherein

[0034] The minimum deviation corresponding to the previous round is smaller than the minimum deviation corresponding to the current round, and the maximum deviation corresponding to the previous round is larger than the maximum deviation corresponding to the current round.

[0035] Optionally, the prediction model is used to predict the trajectory of the target object around the unmanned driving device, the training sample includes the historical trajectory of the target object around the unmanned driving device, and the prediction result is the trajectory of the target object in the future period predicted based on the historical trajectory of the target object.

[0036] This specification provides a model training device, including:

[0037] Acquisition module, used to obtain sample sets;

[0038] A prediction module is used to input each training sample in the sample set into the prediction model to be trained to obtain a prediction result for the training sample;

[0039] A weight determination module is used to determine the weight of the training sample for the prediction model based on the prediction result of the training sample and the actual result of the training sample, as the weight corresponding to the training sample;

[0040] A loss determination module is configured to determine a loss value of the training sample for the prediction model based on the weight corresponding to the training sample, and determine a parameter adjustment gradient for the training sample for the prediction model based on the loss value, wherein the greater the weight corresponding to the training sample, the greater the parameter adjustment gradient;

[0041] The training module is used to adjust the parameters included in the prediction model according to the parameter adjustment gradient to complete the training of the prediction model.

[0042] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned model training method.

[0043] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned model training method when executing the program.

[0044] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0045] It can be seen from the above method that a sample set can be obtained, and for each training sample in the sample set, the training sample is input into the prediction model to be trained to obtain a prediction result for the training sample, and based on the prediction result of the training sample and the actual result of the training sample, the weight of the training sample for the prediction model is determined as the weight corresponding to the training sample, and based on the weight corresponding to the training sample, the loss value of the training sample for the prediction model is determined, and based on the loss value, the parameter adjustment gradient of the training sample for the prediction model is determined, and based on the parameter adjustment gradient, the parameters contained in the prediction model are adjusted to complete the training of the prediction model, wherein the greater the weight corresponding to the training sample, the greater the parameter adjustment gradient corresponding to the training sample.

[0046] From the above content, it can be seen that this method can determine the weight of the training sample for the training of the prediction model based on the prediction results of the training sample and the actual results of the training sample, and can determine the loss value for the prediction model based on the weight, and determine the parameter adjustment gradient. The larger the parameter adjustment gradient, the greater the weight of the training sample. In this way, if the weight of the training sample is higher, the greater the impact on the model, the lower the weight of the training sample, the smaller the impact on the model. By determining the weight of the training sample, the training sample with less value for model training can have a smaller weight, thereby having less impact on the prediction model, thereby improving the prediction effect of the trained prediction model. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The exemplary embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation of this specification. In the drawings:

[0048] Figure 1 A flowchart of a model training method in this specification;

[0049] Figure 2 A schematic diagram of the complete process of training a prediction model in this specification;

[0050] Figure 3 A schematic diagram of a model training device provided in this manual;

[0051] Figure 4 The corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION

[0052] To make the objectives, technical solutions, and advantages of this specification more clear, the following will clearly and completely describe the technical solutions of this specification in conjunction with the specific embodiments of this specification and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this specification.

[0053] The technical solutions provided by the embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0054] Figure 1 This is a flow chart of a model training method in this specification, which specifically includes the following steps:

[0055] S101: Obtain a sample set.

[0056] S102: For each training sample in the sample set, input the training sample into the prediction model to be trained to obtain a prediction result for the training sample.

[0057] In practical applications, prediction can be applied in a variety of scenarios. For example, autonomous vehicles can predict the trajectory of surrounding objects to determine their next driving strategy. Accurately predicting the trajectory of surrounding objects can, to a certain extent, ensure the safety of autonomous vehicles. Another example is predicting click-through rates in recommendation scenarios.

[0058] Regardless of the type of prediction task, it is usually necessary to use a prediction model to make predictions. Therefore, it is extremely important to train the prediction model reasonably so that the prediction model can accurately predict the required prediction results.

[0059] Based on this, the server can obtain a sample set, and for each training sample in the sample set, input the training sample into the prediction model to be trained to obtain the prediction result for the training sample, and determine the weight of the training sample for the prediction model based on the prediction result of the training sample and the actual result of the training sample, as the weight corresponding to the training sample.

[0060] There are various ways to determine the weight of the training sample for the prediction model. For example, the deviation between the predicted result of the training sample and the actual result of the training sample can be determined, and the weight corresponding to the training sample can be determined based on the deviation, a preset maximum deviation, and a preset minimum deviation. The relationship between the deviation between the predicted result and the actual result of the training sample and the weight satisfies the following: the weight reaches a maximum value between the preset maximum deviation and the preset minimum deviation, and the weight reaches a minimum value at the preset maximum and minimum deviations.

[0061] That is to say, the maximum deviation and the minimum deviation can be preset. Within the deviation range between the maximum deviation and the minimum deviation, there is a maximum value of the weight. If the deviation between the predicted result and the actual result of a training sample (hereinafter referred to as the deviation corresponding to the training sample) is closer to the maximum deviation or the minimum deviation within the maximum deviation and the minimum deviation, the weight corresponding to the training sample will be smaller. When the deviation corresponding to the training sample is at the maximum deviation and the minimum deviation, or the deviation corresponding to the training sample is larger than the maximum deviation, or smaller than the minimum deviation, the weight corresponding to the training sample can take the minimum value.

[0062] In this specification, the weights corresponding to the training samples determined in the above manner can be obtained by optimizing a preset objective function during the model training phase, namely:

[0063]

[0064] In the above objective function, v i is the weight corresponding to the i-th training sample, f w (x i ) is the prediction result output by the prediction model for the i-th training sample, y i is the actual result (i.e., label) corresponding to the i-th training sample, so in the above objective function (f w (x i )-y i ) is the deviation between the predicted result and the actual result, λ1 is the minimum deviation mentioned above, λ2 is the maximum deviation mentioned above, The self-pacing term is added to determine the weight of the training sample. First, the model parameters are fixed to determine the weight:

[0065]

[0066] First simplify the above objective function to obtain:

[0067]

[0068] Where l is f w (x i )-y i , taking the derivative of the above formula, we can get:

[0069] h′(v)=λ1λ2v+λ1λ2+l 2 -(λ1+λ2)l

[0070] By differentiating the above formula to 0, the relationship between v, λ1, λ2, and l can be determined, namely:

[0071]

[0072] Since the weight should not be negative, when the deviation is within the range of λ1 and λ2, the relationship between the weight and the deviation satisfies the above formula, and when the deviation is outside the range of λ1 and λ2, the weight can be set to 0, that is:

[0073]

[0074] The above formula can express the relationship between weight and training sample, that is, when the deviation is within the range of λ1 and λ2, the weight is When the deviation is outside the range of λ1 and λ2, the weight is 0.

[0075] S104: Determine the loss value of the training sample for the prediction model based on the weight corresponding to the training sample, and determine the parameter adjustment gradient of the training sample for the prediction model based on the loss value, wherein the larger the weight corresponding to the training sample, the larger the parameter adjustment gradient.

[0076] S105: According to the parameter adjustment gradient, the parameters included in the prediction model are adjusted to complete the training of the prediction model.

[0077] After determining the weight of the training sample, the loss value of the training sample for the prediction model can be determined based on the weight corresponding to the training sample, and the parameter adjustment gradient of the training sample for the prediction model can be determined based on the loss value. Then, according to the parameter adjustment gradient, the parameters contained in the prediction model are adjusted to complete the training of the prediction model. The larger the weight corresponding to the training sample, the larger the parameter adjustment gradient.

[0078] That is to say, if the weight of a training sample is larger, when the prediction model is adjusted through the training sample, the parameter adjustment gradient calculated through the training sample is larger, and the amplitude of adjustment of the prediction model parameters will also be larger, and the training sample will play a greater role in the training of the prediction model. The smaller the weight of the training sample is, when the prediction model is adjusted through the training sample, the parameter adjustment gradient calculated through the training sample is smaller, and the amplitude of adjustment of the prediction model parameters will also be smaller, and the training sample will play a smaller role in the training of the prediction model.

[0079] That is to say, the weight corresponding to a training sample determines the influence of the training sample in the training of the prediction model. When the weight corresponding to the training sample is larger, the influence of the training sample in the training of the prediction model will also be greater, and when the weight corresponding to the training sample is smaller, the influence of the training sample in the training of the prediction model will also be smaller.

[0080] Among them, the objective function when training the prediction model can be as follows:

[0081]

[0082] By performing gradient descent, we can obtain:

[0083] w←w-αΔw

[0084]

[0085] It can be seen that the parameter adjustment gradient in the above formula is positively correlated with the weight corresponding to the training sample.

[0086] As mentioned above, the deviation between the predicted result and the actual result corresponding to the training sample and the weight of the training sample can satisfy the following conditions: for the maximum deviation and the minimum deviation, when the deviation is within the range of the maximum deviation and the minimum deviation, the more central the deviation is, the greater the weight of the training sample, and the closer the deviation is to the maximum deviation, or the closer it is to the minimum deviation, the smaller the weight of the training sample, and if the deviation is at the maximum deviation, or exceeds the maximum deviation, or the deviation is at the minimum deviation, or exceeds the minimum deviation, the weight of the training sample can be 0.

[0087] This is because if the deviation (the difference between the predicted result and the actual result) corresponding to the training sample is small, then the prediction model has already learned well from such training sample. This training sample is of little value to the prediction model. However, if the deviation corresponding to the training sample is large, it may be because the training sample itself contains a lot of noise (for example, the historical trajectory contained in the training sample contains noise), and such training sample is also of little value to the prediction model.

[0088] However, simply excluding training samples with particularly large or small deviations will still cause certain problems. In the scenario of trajectory prediction, there is a high probability that there will be a certain amount of noise in the historical trajectory of the training sample. The existing noise is not necessarily particularly large, nor is it necessarily completely absent. For multiple training samples, the noise contained in the historical trajectory of each training sample may be different, ranging from very little to a lot. Therefore, the training value of each training sample to the prediction model may be different. Therefore, in this specification, there is a maximum value of the weight within the range of maximum deviation and minimum deviation. When the deviation corresponding to a training sample is within the range of maximum deviation and minimum deviation, the closer the deviation is to the maximum deviation or the closer to the minimum deviation, the lower the weight of the training sample.

[0089] In this specification, the above-mentioned prediction model can be iteratively trained, so the prediction model can be trained in multiple rounds. Therefore, in the Nth round, the sample set required for the current round of training can be obtained, and for each training sample in the sample set, the training sample is input into the prediction model that needs to be trained in the current round to obtain the prediction result for the training sample, and based on the prediction result of the training sample and the actual result of the training sample, the weight of the training sample for the prediction model in the current round of training is determined as the weight corresponding to the training sample in the current round.

[0090] Then, based on the weight corresponding to the training sample in the current round, the loss value of the training sample for the prediction model in the current round of training is determined, and based on the loss value, the parameter adjustment gradient of the training sample for the prediction model in the current round of training is determined, and then based on the parameter adjustment gradient, the parameters included in the prediction model are adjusted in the current round to obtain the adjusted prediction model.

[0091] That is to say, in each round, the weights corresponding to the training samples can be calculated, and then the prediction model can be trained using the weights of the training samples to obtain the adjusted prediction model for this round. After this round of training is completed, the next round of training is required. Therefore, in the next round of training, the weights of the training samples need to be determined, and the adjusted prediction model needs to be trained using the determined weights.

[0092] That is to say, the adjusted prediction model of the current round can be used as the prediction model that needs to be trained in the next round. In addition, according to the weight corresponding to each training sample contained in the sample set in the current round, the training samples for use in the next round of training can be screened out from the sample set, and based on the screened training samples, a sample set for training the prediction model that needs to be trained in the next round can be constructed in the next round of training.

[0093] That is to say, as the number of training rounds increases, the number of training samples in the sample set used to train the prediction model can be gradually reduced. That is to say, samples with higher weights in the sample set can be screened out, and the screened samples can be added to the sample set used for training in the next round. Of course, for the prediction model that needs to be trained in the next round, it is necessary to first determine the weight of each training sample in the sample set used for this round of training, and then conduct training based on the determined weight corresponding to each training sample.

[0094] It should be noted that when determining the weight corresponding to a training sample in the current round, it is necessary to determine the deviation between the predicted result of the training sample and the actual result of the training sample, and determine the weight corresponding to the training sample in the current round based on the deviation, the maximum deviation corresponding to the current round, and the minimum deviation corresponding to the current round. The relationship between the deviation and the weight satisfies: there is a maximum value of the weight between the maximum deviation corresponding to the current round and the minimum deviation corresponding to the current round, and the weight takes the minimum value at the maximum deviation corresponding to the current round and the minimum deviation corresponding to the current round.

[0095] That is to say, in each round of training, since the prediction model has completed a training in the previous round, and the corresponding maximum deviation and minimum deviation in each round can be re-determined, the weights need to be recalculated in each round of training.

[0096] In each round, the weight of the current round can be determined. The maximum deviation corresponding to the current round can be determined based on the round number corresponding to the current round and the maximum deviation corresponding to the previous round. Also, the minimum deviation corresponding to the current round can be determined based on the round number corresponding to the current round and the minimum deviation corresponding to the previous round, wherein the minimum deviation corresponding to the previous round is smaller than the minimum deviation corresponding to the current round, and the maximum deviation corresponding to the previous round is larger than the maximum deviation corresponding to the current round.

[0097] That is to say, as the number of training rounds increases, the maximum deviation and the minimum deviation can be adjusted, the maximum deviation can become smaller and smaller, and the minimum deviation can become larger and larger.

[0098] Of course, the prediction model can be trained at first as an initialized prediction model, and then the weights of the training samples can be determined in each round of training. The following figure provides a complete description of the training process of the prediction model.

[0099] Figure 2 This is a schematic diagram of the complete process of training a prediction model in this specification.

[0100] from Figure 2It can be seen that the prediction model can be initialized first, that is, the prediction model is first trained to a certain extent as mentioned above, so that the prediction model has a certain prediction ability, and then the prediction model is iteratively trained. In each round of iteration, the maximum deviation and minimum deviation of the current round are determined, and then the weight corresponding to each training sample is determined based on the maximum deviation and minimum deviation corresponding to the current round. Based on the weight corresponding to each training sample, the prediction model is trained. If the weight of the training sample is 0 (or the weight is the smallest), the training sample will not play a role in model training. The greater the weight of the training sample, the greater the effect on model training. Then, the training samples to be used in the next round can be determined according to the weight corresponding to the training sample, and then the next round of training can be carried out. In the next round of training, the weight of the training sample also needs to be determined, and the prediction model parameters are adjusted according to the weight of the training sample until the preset training conditions are met and the training of the prediction model can be terminated.

[0101] There may be multiple preset training conditions mentioned above. For example, if a large number of training rounds have been completed, the training of the prediction model may be terminated. For another example, if the optimization of the objective function has reached a certain level, the training of the prediction model may be terminated.

[0102] The unmanned driving devices mentioned above can refer to autonomous vehicles, drones, automatic delivery equipment, and other devices capable of autonomous driving. Based on this, the model training method provided in this specification can be used to train a trajectory prediction model for predicting the trajectory of objects around unmanned driving devices. The unmanned driving devices can be specifically applied to areas where unmanned delivery is performed, such as in business scenarios where unmanned driving devices are used for express delivery, logistics, and food delivery.

[0103] It can be seen from the above method that the prediction results of the training samples and the actual results of the training samples can be used to determine the weight of the training samples for the training of the prediction model. According to the weight, the loss value for the prediction model can be determined, and the parameter adjustment gradient can be determined. The larger the parameter adjustment gradient, the greater the weight of the training sample. In this way, if the weight of the training sample is higher, the greater the impact on the model, the lower the weight of the training sample, the smaller the impact on the model. By determining the weight of the training sample, the training sample with less value for model training can have a smaller weight, thereby having less impact on the prediction model, thereby improving the effect of the trained prediction model.

[0104] Moreover, the above-mentioned weights can be determined by the maximum deviation, the minimum deviation and the deviation corresponding to the training sample. In this way, if the deviation corresponding to the training sample is close to the maximum deviation or the minimum deviation within the range of the maximum deviation and the minimum deviation (the noise contained in the training sample is large, or the actual result corresponding to the training sample has been well predicted by the prediction model), then the weight of the training sample is lower; if the deviation corresponding to the training sample is within the range of the maximum deviation and the minimum deviation, and is far away from the maximum deviation or the minimum deviation (the noise contained in the training sample is not so large, and the actual result corresponding to the training sample is not well predicted by the prediction model), then the weight of the training sample is higher.

[0105] The above is a method for model training provided in one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding model training device, such as Figure 3 shown.

[0106] Figure 3 A schematic diagram of a model training device provided in this manual, specifically including:

[0107] Acquisition module 301, used to acquire a sample set;

[0108] The prediction module 302 is configured to input each training sample in the sample set into a prediction model to be trained to obtain a prediction result for the training sample;

[0109] A weight determination module 303 is configured to determine the weight of the training sample for the prediction model based on the prediction result of the training sample and the actual result of the training sample, as the weight corresponding to the training sample;

[0110] A loss determination module 304 is configured to determine a loss value of the training sample for the prediction model based on the weight corresponding to the training sample, and determine a parameter adjustment gradient for the training sample for the prediction model based on the loss value, wherein the greater the weight corresponding to the training sample, the greater the parameter adjustment gradient;

[0111] The training module 305 is used to adjust the parameters included in the prediction model according to the parameter adjustment gradient to complete the training of the prediction model.

[0112] Optionally, the weight determination module 303 is specifically used to determine the deviation between the predicted result of the training sample and the actual result of the training sample; determine the weight corresponding to the training sample based on the deviation, a preset maximum deviation and a minimum deviation, wherein the relationship between the deviation and the weight satisfies: between the maximum deviation and the minimum deviation, there is a maximum value of the weight, and at the maximum deviation and the minimum deviation, the weight takes a minimum value.

[0113] Optionally, the acquisition module 301 is specifically configured to acquire a sample set required for the current round of training;

[0114] The prediction module 302 is specifically configured to input each training sample in the sample set into the prediction model to be trained in the current round to obtain a prediction result for the training sample;

[0115] The weight determination module 303 is specifically configured to determine, based on the prediction result of the training sample and the actual result of the training sample, the weight of the training sample for the prediction model in the current round of training, as the weight corresponding to the training sample in the current round;

[0116] The loss determination module 304 is specifically configured to determine, based on the weight corresponding to the training sample in the current round, a loss value of the training sample for the prediction model in the current round of training, and determine, based on the loss value, a parameter adjustment gradient of the training sample for the prediction model in the current round of training;

[0117] The training module 305 is specifically used to adjust the parameters included in the prediction model in the current round according to the parameter adjustment gradient to obtain an adjusted prediction model.

[0118] Optionally, the device further comprises:

[0119] The screening module 306 is used to use the adjusted prediction model as the prediction model to be trained in the next round; based on the weight corresponding to each training sample contained in the sample set in the current round, the training samples for use in the next round of training are screened out from the sample set, and based on the screened training samples, a sample set is constructed in the next round of training to train the prediction model to be trained in the next round.

[0120] Optionally, the weight determination module 303 is specifically used to determine the deviation between the predicted result of the training sample and the actual result of the training sample; based on the deviation, the maximum deviation corresponding to the current round and the minimum deviation corresponding to the current round, determine the weight of the training sample corresponding to the current round, wherein the relationship between the deviation and the weight satisfies: between the maximum deviation corresponding to the current round and the minimum deviation corresponding to the current round, there is a maximum value of the weight, and at the maximum deviation corresponding to the current round and the minimum deviation corresponding to the current round, the weight takes a minimum value.

[0121] Optionally, the weight determination module 303 is specifically used to determine the maximum deviation corresponding to the current round based on the round number corresponding to the current round and the maximum deviation corresponding to the previous round, and to determine the minimum deviation corresponding to the current round based on the round number corresponding to the current round and the minimum deviation corresponding to the previous round, wherein the minimum deviation corresponding to the previous round is smaller than the minimum deviation corresponding to the current round, and the maximum deviation corresponding to the previous round is larger than the maximum deviation corresponding to the current round.

[0122] Optionally, the prediction model is used to predict the trajectory of the target object around the unmanned driving device, the training sample includes the historical trajectory of the target object around the unmanned driving device, and the prediction result is the trajectory of the target object in the future period predicted based on the historical trajectory of the target object.

[0123] This specification also provides a computer-readable storage medium, which stores a computer program that can be used to execute the above Figure 1 Provides the model training method.

[0124] This manual also provides Figure 4 The schematic structure diagram of the electronic device shown in FIG. Figure 4 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The model training method described above. Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0125] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures like diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD through their own programming, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages ​​and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.

[0126] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.

[0127] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0128] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0129] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0130] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0131] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0133] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0134] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0135] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0136] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0137] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Thus, this specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0138] This specification may be described in the general context of computer-executable instructions, such as program modules, executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media, including storage devices.

[0139] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

[0140] The foregoing is merely an example of the present invention and is not intended to limit the present invention. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be included within the scope of the claims of the present invention.

Claims

1. A model training method, characterized in that: include: Get a sample set; For each training sample in the sample set, the training sample is input into the prediction model to be trained to obtain a prediction result for the training sample; Determining a weight of the training sample for the prediction model based on the prediction result of the training sample and the actual result of the training sample, as the weight corresponding to the training sample; Determine, based on the weight corresponding to the training sample, a loss value of the training sample for the prediction model, and determine, based on the loss value, a parameter adjustment gradient for the training sample for the prediction model, wherein the greater the weight corresponding to the training sample, the greater the parameter adjustment gradient; Adjusting the parameters included in the prediction model according to the parameter adjustment gradient to complete the training of the prediction model; The prediction model is used to predict the trajectory of the target object around the unmanned driving device, and the training sample includes the historical trajectory of the target object around the unmanned driving device. According to the prediction result of the training sample and the actual result of the training sample, the weight of the training sample for the prediction model is determined as the weight corresponding to the training sample, specifically including: Determining the deviation between the predicted result of the training sample and the actual result of the training sample; The weight corresponding to the training sample is determined based on the deviation, the preset maximum deviation and the minimum deviation, wherein the relationship between the deviation and the weight satisfies: between the maximum deviation and the minimum deviation, there is a maximum value of the weight, and at the maximum deviation and the minimum deviation, the weight takes a minimum value.

2. The method according to claim 1, wherein Obtain a sample set, including: Get the sample set required for the current round of training; For each training sample in the sample set, the training sample is input into the prediction model to be trained to obtain a prediction result for the training sample, specifically including: For each training sample in the sample set, input the training sample into the prediction model to be trained in the current round to obtain a prediction result for the training sample; Determining the weight of the training sample for the prediction model based on the prediction result of the training sample and the actual result of the training sample as the weight corresponding to the training sample, specifically including: Determining, based on the prediction result of the training sample and the actual result of the training sample, a weight of the training sample for the prediction model in the current round of training, as the weight corresponding to the training sample in the current round; Determining a loss value of the training sample for the prediction model based on the weight corresponding to the training sample in the current round, and determining a parameter adjustment gradient of the training sample for the prediction model based on the loss value, specifically including: Determining, based on the weight corresponding to the training sample in the current round, a loss value of the training sample for the prediction model in the current round of training, and determining, based on the loss value, a parameter adjustment gradient of the training sample for the prediction model in the current round of training; According to the parameter adjustment gradient, the parameters included in the prediction model are adjusted, specifically including: According to the parameter adjustment gradient, the parameters included in the prediction model are adjusted in the current round to obtain an adjusted prediction model.

3. The method according to claim 2, wherein The method further comprises: The adjusted prediction model is used as the prediction model to be trained in the next round; According to the weight corresponding to each training sample contained in the sample set in the current round, training samples for use in the next round of training are screened out from the sample set, and based on the screened training samples, a sample set is constructed for training the prediction model to be trained in the next round in the next round of training.

4. The method according to claim 2, wherein Determining, based on the prediction result of the training sample and the actual result of the training sample, a weight of the training sample for the prediction model in the current round of training as the weight corresponding to the training sample in the current round, specifically includes: Determining the deviation between the predicted result of the training sample and the actual result of the training sample; Based on the deviation, the determined maximum deviation corresponding to the current round, and the minimum deviation corresponding to the current round, the weight of the training sample corresponding to the current round is determined, wherein the relationship between the deviation and the weight satisfies: between the maximum deviation corresponding to the current round and the minimum deviation corresponding to the current round, there is a maximum value of the weight, and at the maximum deviation corresponding to the current round and the minimum deviation corresponding to the current round, the weight takes a minimum value.

5. The method according to claim 4, wherein Determining the maximum deviation corresponding to the current round and the minimum deviation corresponding to the current round specifically includes: The maximum deviation corresponding to the current round is determined based on the round number corresponding to the current round and the maximum deviation corresponding to the previous round, and the minimum deviation corresponding to the current round is determined based on the round number corresponding to the current round and the minimum deviation corresponding to the previous round, wherein the minimum deviation corresponding to the previous round is smaller than the minimum deviation corresponding to the current round, and the maximum deviation corresponding to the previous round is larger than the maximum deviation corresponding to the current round.

6. The method according to any one of claims 1 to 5, wherein: The prediction model is used to predict the trajectory of the target object around the unmanned driving device. The training samples include the historical trajectory of the target object around the unmanned driving device. The prediction result is the trajectory of the target object in the future period predicted based on the historical trajectory of the target object.

7. A model training device, characterized in that: include: Acquisition module, used to obtain sample sets; a prediction module configured to input each training sample in the sample set into a prediction model to be trained to obtain a prediction result for the training sample, wherein the prediction model is used to predict the trajectory of a target object around the unmanned driving device, and the training sample includes a historical trajectory of the target object around the unmanned driving device; A weight determination module is configured to determine, based on the prediction result of the training sample and the actual result of the training sample, the weight of the training sample for the prediction model, as the weight corresponding to the training sample. Specifically, the module includes: Determining the deviation between the predicted result of the training sample and the actual result of the training sample; Determine a weight corresponding to the training sample according to the deviation, a preset maximum deviation, and a minimum deviation, wherein the relationship between the deviation and the weight satisfies: between the maximum deviation and the minimum deviation, there is a maximum value of the weight, and at the maximum deviation and the minimum deviation, the weight takes a minimum value; A loss determination module is configured to determine a loss value of the training sample for the prediction model based on the weight corresponding to the training sample, and determine a parameter adjustment gradient for the training sample for the prediction model based on the loss value, wherein the greater the weight corresponding to the training sample, the greater the parameter adjustment gradient; The training module is used to adjust the parameters included in the prediction model according to the parameter adjustment gradient to complete the training of the prediction model.

8. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and device for controlling unmanned equipment

    CN111522245A

  • Multi-task model training method and device and electronic equipment

    CN112561077A