Model parameter recommendation method and device, and user preference identification method and device
By dividing the value space for sampling and merging/splitting, and recommending initial model parameters, the problem of the large influence of initial values in model fitting is solved, thereby improving the success rate and stability of model fitting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-16
- Publication Date
- 2026-03-24
AI Technical Summary
During the model fitting process, the setting of the initial values of the model parameters has too great an impact, resulting in inconsistent model results and making it difficult to find the global optimal solution, thus increasing the risk of model fitting failure.
By determining the range of model parameters, dividing the model into multiple value spaces, sampling is performed to obtain initial parameters. After model training, the value spaces are merged or split, and initial model parameters are recommended to improve the fitting success rate.
By effectively obtaining the local optimum space corresponding to the model, the success rate of model fitting is improved, and the randomness and failure risk of model training are reduced.
Smart Images

Figure CN117312843B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of artificial intelligence and big data analysis, and particularly relates to a model parameter recommendation method, device and equipment. BACKGROUND
[0002] In many real work scenarios, using various big data models (such as linear regression models, deep neural network models, etc.) to process data has become the most common analysis method, wherein model fitting or model training needs to set an initial value for a model parameter, change the parameter value of the model parameter based on the initial value as a starting point, and calculate the gradient descent amplitude of the corresponding objective function with the change of the model parameter, so as to determine the change direction of the parameter value of the model parameter according to the gradient descent amplitude.
[0003] However, the fitting process of the model is greatly affected by the setting of the initial value of the model parameter, and different settings of the initial value of the model parameter will lead to different parameter structures to which the model converges finally, that is, the setting of the initial value of the model parameter affects the pros and cons of the model result. How to determine or set the initial value of the model parameter to improve the model fitting success rate is very important. SUMMARY
[0004] The present disclosure provides a model parameter recommendation method and device, and a user preference identification method and device.
[0005] According to a first aspect of an embodiment of the present disclosure, a model parameter recommendation method is provided, and the method comprises:
[0006] determining a plurality of value spaces according to the value range of the model parameter;
[0007] sampling each of the value spaces to obtain a first initial parameter in each of the value spaces;
[0008] performing first model training on the first initial parameters in each of the value spaces as model parameters, so as to adjust the model parameters of the model to first target parameters after training;
[0009] merging and / or splitting the value spaces according to at least one of the value spaces to which the first target parameters belong and the value spaces to which the first initial parameters before corresponding training belong, so as to obtain at least one target space;
[0010] recommending an initial model parameter for second model training of the model according to the at least one target space.
[0011] According to a second aspect of an embodiment of the present disclosure, a user preference identification method is provided, and the method comprises:
[0012] The initial model parameter of the model to be trained is recommended by using the model parameter recommendation method disclosed in the embodiment of the first aspect;
[0013] Based on the recommended initial model parameter, model training is performed by using a plurality of user samples, so as to minimize the difference between the predicted intention output by the model and the purchase intention annotated by the corresponding user sample;
[0014] The trained model is used for user preference recognition.
[0015] According to a third aspect of the embodiments of the present disclosure, a model parameter recommendation device is provided, and the device comprises:
[0016] A determination module is configured to determine a plurality of value spaces according to a value range of a model parameter;
[0017] A sampling module is configured to sample each of the value spaces to obtain a first initial parameter in each of the value spaces;
[0018] A training module is configured to perform first model training by taking the first initial parameter in each of the value spaces as a model parameter, so as to adjust the model parameter of the model to a first target parameter after training;
[0019] A processing module is configured to perform merging and / or splitting of the value spaces according to at least one target space to which the first target parameter belongs and a value space to which a corresponding first initial parameter before training belongs, so as to obtain at least one target space;
[0020] A recommendation module is configured to recommend an initial model parameter for second model training of the model according to the at least one target space.
[0021] According to a fourth aspect of the embodiments of the present disclosure, a user preference recognition device is provided, and the device comprises:
[0022] A determination module is configured to determine a plurality of value spaces according to a value range of a model parameter of a recognition model;
[0023] A sampling module is configured to sample each of the value spaces to obtain a first initial parameter in each of the value spaces;
[0024] A first training module is configured to perform first model training by taking the first initial parameter in each of the value spaces as a model parameter, so as to adjust the model parameter of the model to a first target parameter after training; in the first model training, the recognition model inputs a training sample containing a user parameter, and performs classification to output a predicted user preference;
[0025] The processing module is configured to perform merging and / or splitting of value spaces according to at least one first target parameter and a value space to which a first initial parameter before training corresponds, to obtain at least one target space;
[0026] The recommendation module is configured to recommend an initial model parameter according to the at least one target space.
[0027] The second training module is configured to perform second model training based on the recommended initial model parameter and a plurality of user samples, to minimize a difference between a predicted preference output by the model and a user preference annotated by a corresponding user sample.
[0028] The prediction module is configured to perform user preference identification by using the trained model.
[0029] According to a fifth aspect of embodiments of the present disclosure, an electronic device is provided, including a processor and a memory connected with the processor in communication; the memory stores computer-executable instructions; and the processor executes the computer-executable instructions stored in the memory to implement the method for recommending model parameters disclosed in the first aspect of the present disclosure or the method for identifying user preferences disclosed in the second aspect of the present disclosure.
[0030] According to a sixth aspect of embodiments of the present disclosure, a computer-readable medium is provided, and the computer-readable medium stores computer-executable instructions; when the computer-executable instructions are executed by a processor, the computer-executable instructions are used to implement the method for recommending model parameters disclosed in the first aspect of the present disclosure or the method for identifying user preferences disclosed in the second aspect of the present disclosure.
[0031] According to a seventh aspect of embodiments of the present disclosure, a computer program product is provided, and the computer program product includes a computer program; when the computer program is executed by a processor, the computer program implements the method for recommending model parameters disclosed in the first aspect of the present disclosure or the method for identifying user preferences disclosed in the second aspect of the present disclosure.
[0032] The technical solutions provided by the embodiments of the present disclosure at least have the following beneficial effects:
[0033] By determining multiple value spaces based on the range of model parameters, sampling is performed in each value space to obtain the first initial parameters within each value space. The first initial parameters in each value space are then used as model parameters for the first model training, adjusting the model parameters to the first target parameters after training. The value spaces are merged and / or split according to the value space to which at least one first target parameter belongs, and the value space to which the corresponding first initial parameter belongs before training, to obtain at least one target space. Based on at least one target space, initial model parameters are recommended for the second model training. Therefore, merging and / or splitting the value spaces to which the first initial parameters belong before model training and the value spaces to which the corresponding first target parameters belong after model training can effectively obtain the target space (i.e., the local optimum space) corresponding to the model. This allows for the recommendation of initial model parameters based on each target space, i.e., recommending initial model parameters from target spaces where the global optimum of the model parameters is more likely to occur, which can improve the success rate of subsequent model fitting.
[0034] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0035] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0036] Figure 1 This is a flowchart illustrating the method for recommending model parameters as shown in the first embodiment of this disclosure;
[0037] Figure 2 A schematic diagram illustrating the multiple value spaces provided in this disclosure;
[0038] Figure 3 This is a flowchart illustrating the method for recommending model parameters as shown in the second embodiment of this disclosure;
[0039] Figure 4 The value space K to which the first initial parameters provided in this disclosure belong before training;
[0040] Figure 5 This is a flowchart illustrating the method for recommending model parameters as shown in the third embodiment of this disclosure;
[0041] Figure 6 This is a flowchart illustrating the method for recommending model parameters as shown in the fourth embodiment of this disclosure;
[0042] Figure 7 This is a flowchart illustrating the user preference recognition method shown in the fifth embodiment of this disclosure;
[0043] Figure 8 This is a schematic diagram of the structure of the device for recommending model parameters shown in the sixth embodiment of this disclosure;
[0044] Figure 9 This is a schematic diagram of the user preference recognition device shown in the seventh embodiment of this disclosure;
[0045] Figure 10 This is a schematic diagram of the structure of an electronic device shown in an exemplary embodiment of the present disclosure.
[0046] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0048] It should be noted that the acquisition, storage, use, and processing of data in this disclosed technical solution all comply with the relevant provisions of national laws and regulations.
[0049] Throughout the model fitting process, it is necessary to set initial values for the model parameters. Starting from these initial values, the parameter values of the model parameters are continuously changed, and the corresponding changes in the objective function value are calculated. When the objective function reaches an extreme point, the change in the function value stops, and the parameter values of the model parameters at this point can be taken as the most worthwhile or optimal parameter values to select.
[0050] However, in model science research, the drawbacks of model fitting methods are very obvious, mainly in the following three aspects:
[0051] First, the model fitting process can only find local optimal estimates of the parameters;
[0052] Second, the model's fitting performance is greatly affected by the initial values of the model parameters. Inappropriate initial values can cause the model's fitting parameters to fail to converge, leading to model construction failure.
[0053] Third, during the model fitting process, it is impossible to provide effective analysis on the selection of initial values for model parameters of similar problems and similar models, nor can it summarize the optimal initial value range of model parameters for different problems. This results in the random selection of initial values for model parameters in any model fitting, which greatly increases the risk of the task and lacks a self-growth mechanism for the model.
[0054] To address the aforementioned issues, this disclosure proposes a method and apparatus for recommending model parameters, and a method and apparatus for identifying user preferences.
[0055] The following describes, with reference to the accompanying drawings, a method and apparatus for recommending model parameters and a method and apparatus for recognizing user preferences, embodiments of the present disclosure.
[0056] Figure 1 This is a flowchart illustrating the method for recommending model parameters as shown in the first embodiment of this disclosure.
[0057] This disclosure illustrates by exemplifying the model parameter recommendation method configured in a model parameter recommendation device. This model parameter recommendation device can be applied to any electronic device so that the electronic device can perform the model parameter recommendation function.
[0058] Among them, electronic devices can be any device with computing capabilities, such as personal computers, mobile terminals, servers, etc. Mobile terminals can be hardware devices with various operating systems, touch screens and / or displays, such as in-vehicle devices, mobile phones, tablets, personal digital assistants, wearable devices, etc.
[0059] like Figure 1 As shown, the method for recommending the model parameters may include the following steps S101-S105.
[0060] Step S101: Determine multiple value spaces based on the range of values for the model parameters.
[0061] In this embodiment of the disclosure, the model parameters may include various parameters of the model, such as parameters θ1, θ2, ..., θ... n Then the model parameters can be labeled as θ = (θ1, θ2, ..., θ... n The model can be a linear regression model or a time series model in statistical models, or it can be an XGboost (Extreme Gradient Boosting) model, a logistic regression model, a deep neural network model, or an artificial intelligence model. This disclosure does not impose any restrictions on this.
[0062] The model may have, but is not limited to, one parameter, and this disclosure does not impose any restrictions on this.
[0063] In this embodiment of the disclosure, the model parameters may have a corresponding range of values.
[0064] In this embodiment of the disclosure, multiple value spaces can be determined based on the range of values for the model parameters.
[0065] One possible approach is to divide the range of values for the model parameters according to the dimension corresponding to each parameter in the model parameters, so as to obtain multiple value spaces.
[0066] As an example, suppose the model has parameters θ1 and θ2, with model parameters θ = (θ1, θ2), θ1 having a range of values of (-∞, +∞), and θ2 having a range of values of (-∞, +∞). The range of values for the model parameters with two parameters θ1 and θ2 is (-∞, +∞) × (-∞, +∞). The range of values for the model parameters can be divided according to the dimensions corresponding to each parameter, that is, by dividing the range of values corresponding to θ1 and θ2 separately. This yields multiple value spaces enclosed by dividing lines, for example, the value space could be:
[0067] (-∞, -1000)×(1000, +∞)(-1000, -900)×(1000, +∞)…(1000, +∞)×(1000, +∞)(-∞, -1000)×(900, 1000)(-1000, -900)×(900, 1000)…(1000, +∞)×(900, 1000)
[0068] …………
[0069] (-∞, -1000)×(-∞, -1000)(-1000, -900)×(-∞, -1000)…(1000, +∞)×(-∞, -1000)
[0070] like Figure 2 As shown, Figure 2 This is a schematic diagram of the multiple value spaces provided in this disclosure.
[0071] It should be noted that the above example of the value space when the model has two parameters, i.e., the model parameters are two-dimensional, is only illustrative. In practical applications, when the model parameters are two-dimensional, the value space can also be other values, which can be set as needed. This disclosure does not impose any restrictions on this.
[0072] Step S102: Sample each value space to obtain the first initial parameter in each value space.
[0073] In this embodiment of the disclosure, for any one of the multiple value spaces, the value space can be sampled to obtain the first initial parameter in the corresponding value space, that is, the first initial parameter of the model in the corresponding value space.
[0074] As one possible implementation, for each value space, a uniformly distributed random number generator can be used to generate the first initial parameters in each value space.
[0075] It should be noted that a uniformly distributed random number generator can generate the first initial parameters in each value space based on the assumption of uniform distribution (such as setting that the probability density at any point in the value space is completely consistent).
[0076] Using the example above, for the value space (-1000, -900) × (900, 1000), we can set the probability density at any point in the value space (-1000, -900) × (900, 1000) to be ρ:
[0077]
[0078] Where ρ is the reciprocal of the area of the region (-1000, -900) × (900, 1000) in the value space.
[0079] Based on the above probability density, the random number generated by a uniformly distributed random number generator can be, for example, (-950, 920). This random number (-950, 920) can be used as the first initial parameter within the value space (-1000, -900) × (900, 1000). For a value space containing positive and negative infinity, a uniformly distributed random number generator with an infinite interval range in statistics can be used to generate the first initial parameter for the aforementioned value space in a similar manner.
[0080] It should be noted that the number of initial parameters in each value space can be one or more, and this disclosure does not impose any restrictions on this.
[0081] Step S103: The first initial parameters in each value space are used as model parameters to train the first model, so as to adjust the model parameters to the first target parameters after training.
[0082] In this embodiment of the disclosure, the first initial parameters in each value space can be used as model parameters for the first model training, so as to adjust the model parameters of the model to the first target parameters after training.
[0083] It should be noted that each initial parameter can have a corresponding target parameter.
[0084] Step S104: Merge and / or split the value spaces according to the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training, so as to obtain at least one target space.
[0085] It should be noted that the number of target spaces can be, but is not limited to, one, and this disclosure does not impose any restrictions on this.
[0086] In this embodiment of the disclosure, the value spaces can be merged and / or split according to the value space to which at least one first target parameter belongs, and the value space to which the corresponding first initial parameter belongs before training, that is, the value space to which the first initial parameter corresponding to any first target parameter belongs, so as to obtain at least one target space.
[0087] One possible implementation is to merge and / or split the value spaces based on the value spaces of each initial parameter and the corresponding value spaces of the first target parameter after training, thereby obtaining at least one target space. This allows for the integration of value spaces, facilitating the selection of optimal model parameters within the integrated target space and improving model fitting success rate.
[0088] Step S105: Based on at least one target space, recommend initial model parameters for training the second model.
[0089] In this embodiment of the disclosure, initial model parameters for training a second model can be recommended based on at least one target space.
[0090] Understandably, the target space can be the space where local optimal model parameters appear. Initial model parameters can be determined from at least one target space after merging / splitting, and initial model parameters can be recommended to the user for second model training. That is, the initial model parameters are recommended from each target space where the global optimum of the model parameters is more likely to appear, which can improve the model fitting success rate in the second model training process.
[0091] The model parameter recommendation method of this disclosure involves determining multiple value spaces based on the value range of the model parameters; sampling each value space to obtain first initial parameters within that value space; using the first initial parameters in each value space as model parameters for first model training to adjust the model parameters to the first target parameters after training; merging and / or splitting the value spaces based on the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training to obtain at least one target space; and recommending initial model parameters for second model training based on at least one target space. Therefore, merging and / or splitting the value spaces to which the first initial parameters belong before model training and the value spaces to which the corresponding first target parameters belong after model training can effectively obtain the target space (i.e., the local optimum space) corresponding to the model. This allows for the recommendation of initial model parameters based on each target space, i.e., recommending initial model parameters from each target space where the global optimum of the model parameters is more likely to occur, thereby improving the success rate of subsequent model fitting.
[0092] In any embodiment of this disclosure, to clearly illustrate how the value spaces are merged and / or split according to the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training belongs, in one possible implementation of this disclosure, the value space to which the first target parameter belongs can be merged with the value space to which the corresponding first initial parameter belongs before training to obtain at least one target space. The above process will be described in detail below with reference to examples.
[0093] Figure 3 This is a flowchart illustrating the method for recommending model parameters as shown in the second embodiment of this disclosure.
[0094] like Figure 3 As shown, the method for recommending the model parameters may include the following steps S301-S306.
[0095] Step S301: Determine multiple value spaces based on the range of values for the model parameters.
[0096] Step S302: Sample each value space to obtain the first initial parameter in each value space.
[0097] Step S303: The first initial parameters in each value space are used as model parameters to train the first model, so as to adjust the model parameters to the first target parameters after training.
[0098] The explanation of steps S301 to S303 can be found in the relevant descriptions in any embodiment of this disclosure, and will not be repeated here.
[0099] Step S304: For any first target parameter, count the number of initial parameters contained in the value space of the first initial parameter before training.
[0100] It is understandable that there may be multiple first initial parameters in the value space to which each first initial parameter belongs. Therefore, in this disclosure, the number of initial parameters can be used to count the number of first initial parameters in each value space.
[0101] In this embodiment of the disclosure, for any first target parameter, the number of initial parameters included in the value space of the first initial parameter before training can be counted.
[0102] As an example, for the first target parameter θ1, the first initial parameter before training corresponding to the first target parameter θ1 is β3. The number of initial parameters contained in the value space of the first initial parameter β3 can be counted.
[0103] Step S305: If the number of initial parameters is not greater than the number threshold, merge the value space of the first target parameter with the value space of the first initial parameter before training, and use the merged value space as the target space.
[0104] In the embodiments of this disclosure, the number threshold can be preset, such as 1, 2, etc., and this disclosure does not limit it.
[0105] It is understandable that when the number of initial parameters is not greater than a threshold, it indicates that the division of the value space is sufficiently fine. Therefore, in this disclosure, when the number of initial parameters is not greater than the threshold, the value space of the first target parameter can be merged with the value space of the first initial parameter before training, and the merged value space can be used as the target space.
[0106] As an example, suppose the model parameters include θ1 and θ2, where θ1 has a range of values of (-∞, +∞) and θ2 has a range of values of (-∞, +∞). The range of the model parameters for this model with two parameters θ1 and θ2 is (-∞, +∞) × (-∞, +∞). Assume a uniformly distributed random value generator generates random numbers (-950, 920) in the value space (-1000, -900) × (900, 1000). Then, using (-950, 920) (i.e., θ1 = -950, θ2 = 920) as the first initial parameters in this value space for the first model training, and assuming the model parameters are adjusted to the first target after training... The parameters are (-970, 850) (i.e., θ1 = -970, θ2 = 850). The first target parameter is the optimal parameter value of the model fit, that is, the optimal solution falls within the value space (-1000, -900) × (800, 900). When the number of initial parameters is not greater than the number threshold, the value space (-1000, -900) × (800, 900) to which the first target parameter belongs can be merged with the value space (-1000, -900) × (900, 1000) to which the first initial parameter belongs before training belongs. The merged value space (-1000, -900) × (800, 1000) can be used as the target space.
[0107] In one possible implementation of this disclosure, when the number of initial parameters is greater than a threshold, the value space of the first initial parameter before training can be split to obtain a subspace that matches (or is the same as) the number of initial parameters; and the subspace of the first initial parameter before training can be merged with the value space of the first target parameter.
[0108] It is understandable that when the number of initial parameters included in the value control of the first initial parameter before the corresponding training is greater than the number threshold, it indicates that the splitting or division of the value space is not fine enough, and the corresponding value space can be divided.
[0109] In this embodiment of the disclosure, when the number of initial parameters exceeds a threshold, the value space of the first initial parameter before training can be split to obtain subspaces that match (or are the same as) the number of initial parameters. It should be noted that after splitting the value space of the first initial parameter before training, each subspace can contain a corresponding first initial parameter.
[0110] As an example, suppose the value space of the first initial parameter before training is (-1000, -900) × (900, 1000), and the first initial parameters contained in this value space are first initial parameter a and first initial parameter b, that is, the value space contains 2 initial parameters. When the number threshold is 1, the number of initial parameters contained in this space is greater than the number threshold. That is, the number of first initial parameters in the value space (-1000, -900) × (900, 1000) of the first initial parameter before training is greater than the number threshold. Then, the value space (-1000, -900) × (900, 1000) can be split to obtain the value space (-1000, -900) × (900, 1000) with the initial parameter b. A subspace with two matching (or identical) parameters is defined as a subspace of the value space (-1000, -900) × (900, 1000) divided into two subspaces, where each subspace contains a corresponding first initial parameter. For example, the value space (-1000, -900) × (900, 1000) can be divided into subspaces (-1000, -950) × (900, 1000) and subspace (-950, -900) × (900, 1000), where the first initial parameter 'a' exists in subspace (-1000, -950) × (900, 1000) and the first initial parameter 'b' exists in subspace (-950, -900) × (900, 1000). Therefore, the subspace to which the first initial parameter belongs before training belongs can be merged with the value space to which the first target parameter belongs, and the merged value space can be used as the target space.
[0111] To clearly illustrate how the value space of the first initial parameter before training is split to obtain a subspace matching the number of initial parameters, in one possible implementation of this disclosure, the perpendicular bisector of the line connecting adjacent first initial parameters can be used as a dividing line; based on the dividing line, the value space of the first initial parameter before training is split to obtain a subspace matching the number of first initial parameters.
[0112] As an example, Figure 4 The first initial parameter provided in this disclosure belongs to a value space K, which contains the first initial parameter x = (x1, x2) and the first initial parameter y = (y1, y2). The perpendicular bisector L of the line connecting the two first initial parameters can be used as a dividing line. The value space K to which the first initial parameter belongs can be split according to the dividing line to obtain subspaces matching the number of first initial parameters, namely subspace K1 and subspace K2.
[0113] Therefore, based on the perpendicular bisector of each of the first initial parameters in the value space, the corresponding value space can be split, and each subspace can be effectively obtained.
[0114] Therefore, in this disclosure, after obtaining a subspace that matches (or is the same as) the number of initial parameters, the subspace to which the first initial parameter belongs before training can be merged with the value space to which the first target parameter belongs.
[0115] Therefore, when the number of initial parameters is no greater than the threshold, dividing the corresponding value space first and then merging the value spaces can effectively obtain each target space. This allows for precise spatial segmentation and integration of the model parameter value range according to the coverage of the local optimum. This ensures that any point in the target space can converge to the optimal parameter solution in the target space during model training or model fitting, and that the target space and the optimal parameter solution in the target space have a one-to-one correspondence, which can improve the success rate of subsequent model fitting.
[0116] Step S306: Based on at least one target space, recommend initial model parameters for training the second model.
[0117] The explanation of step S306 can be found in the relevant description in any embodiment of this disclosure, and will not be repeated here.
[0118] The method for recommending model parameters in this embodiment involves, for any first target parameter, counting the number of initial parameters contained in the value space of the corresponding first initial parameter before training; if the number of initial parameters is not greater than a threshold, merging the value space of the first target parameter with the value space of the corresponding first initial parameter before training, and using the merged value space as the target space. Therefore, when the number of initial parameters is not greater than the threshold, simply merging the value spaces can effectively obtain each target space.
[0119] To clearly illustrate how, in any embodiment of this disclosure, the value spaces are merged and / or split based on the value space of at least one first target parameter and the value space of the corresponding first initial parameter before training to obtain at least one target space, in one possible implementation of this disclosure, the first target parameter can be filtered to obtain filtered and retained first target parameters, and the value spaces of the filtered and retained first target parameters and the value spaces of the corresponding first initial parameters before training can be merged and / or split to obtain at least one target space. The above process will be described in detail below with reference to examples.
[0120] Figure 5This is a flowchart illustrating the method for recommending model parameters as shown in the third embodiment of this disclosure.
[0121] like Figure 5 As shown, the method for recommending the model parameters may include the following steps S501-S507.
[0122] Step S501: Determine multiple value spaces based on the range of values for the model parameters.
[0123] Step S502: Sample each value space to obtain the first initial parameter in each value space.
[0124] Step S503: The first initial parameters in each value space are used as model parameters to train the first model, so as to adjust the model parameters to the first target parameters after training.
[0125] The explanation of steps S501 to S503 can be found in the relevant description in any embodiment of this disclosure, and will not be repeated here.
[0126] Step S504: For any first target parameter, input the first training sample into the model using the first target parameter, so as to determine the first function value of the target function based on the first output of the model and the first expectation of the first training sample.
[0127] It should be noted that the objective function can be a function determined based on the model, the model's input, and the model's parameters. For example, assuming the model is M, the model's input is X, and the model's parameters are θ, then the objective function can be denoted as B(M, X, θ).
[0128] In this embodiment of the disclosure, the first function value of the objective function can be used to indicate the difference between the first output and the first expectation. The first output can be obtained by inputting the first training samples into a model using the first objective parameters, and the first expectation can be obtained by statistical analysis of the first training samples.
[0129] It is understandable that the first function value of the objective function can be positively correlated with the difference between the first output and the first expectation; that is, the greater the difference between the first output and the first expectation, the larger the first function value of the objective function, and the smaller the difference between the first output and the first expectation, the smaller the first function value of the objective function. Alternatively, the first function value of the objective function can be negatively correlated with the difference between the first output and the first expectation; that is, the greater the difference between the first output and the first expectation, the smaller the first function value of the objective function, and the smaller the difference between the first output and the first expectation, the larger the first function value of the objective function. This disclosure does not impose any restrictions on the correlation between the first function value of the objective function and the difference between the first output and the first expectation.
[0130] In this embodiment of the disclosure, for any first target parameter, a first training sample can be input into a model using the first target parameter, so that the first function value of the target function can be determined based on the first output of the model and the first expectation of the first training sample.
[0131] Step S505: Filter each first target parameter according to the first function value corresponding to each first target parameter.
[0132] In this embodiment of the disclosure, each first target parameter can be filtered according to the first function value corresponding to each first target parameter.
[0133] As an example, when the first function value of the objective function indicates that the difference between the first output and the first expectation is less than or equal to a set threshold (e.g., 0.0001), it indicates that the model fits well. In this case, the first objective parameter used by the model can be the optimal parameter and can be retained. On the other hand, when the first function value of the objective function indicates that the difference between the first output and the first expectation is greater than the set threshold (e.g., 0.0001), it indicates that the model fits poorly and the first objective parameter can be discarded.
[0134] Step S506: For the first target parameter that has been selected and retained, the value space is merged and / or split according to its value space and the value space of the first initial parameter before training, so as to obtain at least one target space.
[0135] In this embodiment of the disclosure, for the first target parameter to be selected and retained, the value space can be merged and / or split according to the value space to which the first target parameter to be selected and retained belongs, and the value space to which the first initial parameter before training belongs, so as to obtain at least one target space.
[0136] Step S507: Based on at least one target space, recommend initial model parameters for training the second model.
[0137] The explanation of step S507 can be found in the relevant description in any embodiment of this disclosure, and will not be repeated here.
[0138] The model parameter recommendation method of this disclosure involves inputting a first training sample into a model using the first target parameter for any given first target parameter. Based on the model's first output and the first expectation of the first training sample, a first function value of the target function is determined, whereby the first function value indicates the difference between the first output and the first expectation. Each first target parameter is then filtered according to its corresponding first function value. For the filtered and retained first target parameters, their value spaces are merged and / or split according to their respective value spaces and the value spaces of the corresponding initial parameters before training, to obtain at least one target space. This allows for the filtering of each first target parameter, and further, the merging and / or splitting of value spaces only occurs within the value spaces of the filtered and retained first target parameters and the value spaces of the corresponding initial parameters before training. This effectively obtains each target space more accurately.
[0139] To clearly illustrate how initial model parameters for second model training are recommended based on at least one target space in any of the above embodiments of this disclosure, this disclosure also proposes a method for recommending model parameters.
[0140] Figure 6 This is a flowchart illustrating the method for recommending model parameters as shown in the fourth embodiment of this disclosure.
[0141] like Figure 6 As shown, the method for recommending the model parameters may include the following steps S601-S608.
[0142] Step S601: Determine multiple value spaces based on the range of values for the model parameters.
[0143] Step S602: Sample each value space to obtain the first initial parameter in each value space.
[0144] Step S603: The first initial parameters in each value space are used as model parameters to train the first model, so as to adjust the model parameters to the first target parameters after training.
[0145] Step S604: Merge and / or split the value spaces according to the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training, so as to obtain at least one target space.
[0146] The explanation of steps S601 to S604 can be found in the relevant description in any embodiment of this disclosure, and will not be repeated here.
[0147] Step S605: Obtain multiple training sample sets.
[0148] It should be noted that multiple training sample sets can be different sample sets from the same type of scenario (such as marketing campaigns for financial institutions' business products).
[0149] As an example, multiple training sample sets can be different sample sets in the marketing campaign scenarios of financial institutions' (such as banks) business products (such as wealth management products).
[0150] It should be noted that the above examples of scenarios to which multiple training sample sets belong are merely illustrative. In practical applications, multiple training sample sets can also be sample sets in other scenarios. This disclosure does not limit the scenarios to which multiple training sample sets belong.
[0151] In this embodiment of the disclosure, multiple training sample sets can be obtained.
[0152] Step S606: For any set of training samples, determine the corresponding global optimal space from at least one target space.
[0153] The global optimal space can be the space of values of the model parameters when the objective function of the model is maximized by training the model with a set of training samples to adjust the model parameters.
[0154] The extreme values can be minimum (or extreme value), maximum (or extreme value), etc., and this disclosure does not impose any restrictions on them.
[0155] In this embodiment of the disclosure, for any training sample set, the corresponding global optimal space can be determined from at least one target space, that is, the corresponding global optimal space can be determined from at least one local optimal space.
[0156] As one possible implementation, for any set of training samples, a second initial parameter can be obtained by sampling each target space, and the second initial parameter in each target space can be used as the model parameter to train a third model based on the gradient descent algorithm using the set of training samples. Finally, based on the value of the objective function after model training, a global optimal space that makes the objective function take the maximum or minimum value can be determined from multiple target spaces.
[0157] In other words, for any set of training samples, the second initial parameters can be obtained by sampling each local optimum space. The second initial parameters in each local optimum space can be used as model parameters to train a third model based on the gradient descent algorithm using the set of training samples. The gradient descent algorithm is an algorithm that finds the extreme point where the gradient is 0 according to the gradient descent principle. Finally, based on the value of the objective function after model training, the global optimum space that makes the objective function take the maximum or minimum value can be determined from multiple local optimum spaces. For example, the local optimum space before training that makes the objective function take the minimum value after model training can be selected as the global optimum space.
[0158] It should be noted that the above only describes determining the global optimum space from the perspective of finding the minimum of the objective function. Understandably, there are cases where the objective function needs to be maximized. In such cases, the problem of maximizing the objective function can be transformed into finding the minimum. For example, adding a negative sign before the objective function yields a newly constructed objective function, thus transforming the problem of maximizing the objective function into finding the minimum of the newly constructed objective function.
[0159] Step S607: Based on the global optimal spaces corresponding to multiple training sample sets, calculate the probability that each target space is the global optimal space.
[0160] In this embodiment of the disclosure, the probability of each target space being the global optimal space can be statistically obtained based on the global optimal spaces corresponding to multiple training sample sets.
[0161] As an example, one can count the number of times each target space is the global optimal space based on the global optimal spaces corresponding to multiple training sample sets; thus, based on the number of times any target space is the global optimal space and the number of training sample sets, the probability of any target space being the global optimal space can be determined.
[0162] For example, if the training sample set contains 100 samples, and the target spaces include G1, G2, G3, and G4, and the target space G1 is the global optimum 12 times, the target space G2 is the global optimum 28 times, the target space G3 is the global optimum 50 times, and the target space G4 is the global optimum 10 times, then the probability that the target space G1 is the global optimum is 3 / 25, the probability that the target space G2 is the global optimum is 7 / 25, the probability that the target space G3 is the global optimum is 1 / 2, and the probability that the target space G4 is the global optimum is 1 / 10.
[0163] Step S608: Based on the probability that each target space is the global optimal space, recommend initial model parameters for training the second model.
[0164] As an example, based on the probability that each target space is the global optimal space, the target space with the highest probability can be selected from each target space, and the initial model parameters for training the second model can be recommended from the target space corresponding to the highest probability.
[0165] As one possible implementation, a heatmap can be displayed based on the probability that each target space is the global optimal space; the heatmap can then be used to recommend selecting initial model parameters from the target space with the highest probability.
[0166] It should be noted that each target space can be assigned a color based on its probability of being the global optimum, thus generating a heatmap. For example, a target space with a probability of 0-10% can be set to white; a target space with a probability of 10%-30% can be set to yellow; a target space with a probability of 30%-50% can be set to green; a target space with a probability of 50%-70% can be set to orange; a target space with a probability of 70%-90% can be set to red; and a target space with a probability of 90%-100% can be set to a red-black color scheme.
[0167] It should be noted that the above examples of setting colors for each target space are merely illustrative. In practical applications, colors can be set for each target space as needed, and this disclosure does not impose any restrictions on this.
[0168] Therefore, the display method can help users understand the regions where the optimal solution of the model parameters frequently occurs, which can help users select the initial model parameters from the region with the highest heat intensity and improve the success rate of model fitting.
[0169] The model parameter recommendation method of this disclosure involves acquiring multiple training sample sets; for any training sample set, determining a corresponding global optimal space from at least one target space, wherein the global optimal space is the value space of the model parameters when the objective function of the model is maximized by training the model with the training sample sets to adjust the model parameters; statistically calculating the probability that each target space is the global optimal space based on the global optimal spaces corresponding to the multiple training sample sets; and recommending initial model parameters for second model training based on the probability that each target space is the global optimal space. Thus, it is possible to recommend initial model parameters based on the probability that each target space is the global optimal space, i.e., based on the probability that the optimal solution of the model parameters appears in each target space, thereby improving the success rate of the model in subsequent fitting.
[0170] The above are examples of methods for recommending model parameters. The following are examples of methods for recommending model parameters using the present disclosure.
[0171] Figure 7 This is a flowchart illustrating the user preference recognition method shown in the fifth embodiment of this disclosure.
[0172] like Figure 7 As shown, the user preference identification method may include the following steps S701-S707.
[0173] Step S701: Determine multiple value spaces based on the value range of the model parameters of the recognition model.
[0174] In this embodiment of the disclosure, the recognition model can be used to identify user preferences, and the recognition model can have corresponding model parameters.
[0175] It is understandable that the model parameters of the recognition model can have a corresponding range of values.
[0176] In this embodiment of the disclosure, multiple value spaces can be determined based on the range of values of the model parameters of the identification model.
[0177] For example, the range of values for model parameters can be divided according to the dimension corresponding to each parameter in the model parameters to obtain multiple value spaces. It should be noted that this disclosure does not restrict the method of dividing the range of values for model parameters; it can be divided according to actual needs.
[0178] Step S702: Sample each value space to obtain the first initial parameter in each value space.
[0179] In this embodiment of the disclosure, for any one of the multiple value spaces, the value space can be sampled to obtain the first initial parameter in the corresponding value space, that is, the first initial parameter of the recognition model in the corresponding value space.
[0180] It should be noted that the number of initial parameters in each value space can be one or more, and this disclosure does not impose any restrictions on this.
[0181] Step S703: The first initial parameters in each value space are used as model parameters to train the first model, so as to adjust the model parameters to the first target parameters after training.
[0182] In the first model training, the recognition model can also take in training samples containing user parameters, classify them, and output predicted user preferences.
[0183] User parameters can be used to indicate user preferences.
[0184] In this embodiment of the disclosure, the first initial parameters in each value space can be used as model parameters for the first model training, so as to adjust the model parameters of the model to the first target parameters after training.
[0185] It should be noted that each initial parameter can have a corresponding target parameter.
[0186] Step S704: Merge and / or split the value spaces according to the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training, so as to obtain at least one target space.
[0187] In this embodiment of the disclosure, the value spaces can be merged and / or split according to the value space to which at least one first target parameter belongs, and the value space to which the corresponding first initial parameter belongs before training, that is, the value space to which the first initial parameter corresponding to any first target parameter belongs, so as to obtain at least one target space.
[0188] It should be noted that the number of target spaces can be, but is not limited to, one, and this disclosure does not impose any restrictions on this.
[0189] Step S705: Recommend initial model parameters based on at least one target space.
[0190] It is understandable that the target space can be the space where locally optimal model parameters appear, and the initial model parameters can be determined from at least one target space after merging / splitting.
[0191] Therefore, in this disclosure, initial model parameters can be recommended to the user based on at least one target space.
[0192] Step S706: Based on the recommended initial model parameters, train the second model using multiple user samples to minimize the difference between the predicted preferences output by the model and the user preferences labeled in the corresponding user samples.
[0193] In this embodiment of the disclosure, a second model can be trained using multiple user samples based on recommended initial model parameters, so as to minimize the difference between the predicted preferences output by the model and the user preferences labeled in the corresponding user samples.
[0194] Step S707: Use the trained model to identify user preferences.
[0195] In this embodiment of the disclosure, a trained model can be used for user preference identification.
[0196] The user preference recognition method of this disclosure determines multiple value spaces based on the value range of the model parameters of the recognition model; samples each value space to obtain a first initial parameter within that value space; uses the first initial parameters in each value space as model parameters for first model training to adjust the model parameters to the trained first target parameters; wherein, in the first model training, the recognition model input includes training samples containing user parameters, performs classification to output predicted user preferences; merges and / or splits the value spaces according to the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training to obtain at least one target space; recommends initial model parameters based on at least one target space; and trains a second model using multiple user samples based on the recommended initial model parameters to minimize the difference between the predicted preferences output by the model and the user preferences labeled in the corresponding user samples; and uses the trained model for user preference recognition. Therefore, it is possible to effectively train the user preference model to be trained based on the recommended initial model parameters, which can improve the success rate of model fitting and thus improve the accuracy of model prediction.
[0197] As an application scenario, the recommendation method based on the model parameters of this disclosure is applied to predicting user preferences based on basic user information. Here, the basic user information is denoted as user sample in this disclosure. The basic information of multiple users is aggregated to construct the training dataset X of the model M to be trained.
[0198] It should be noted that the acquisition, storage, use, and processing of data in this disclosed technical solution all comply with the relevant provisions of national laws and regulations.
[0199] Suppose that the user's purchase record data is D, representing the user's preference, i.e., the user's inclination towards a product. D is the target variable for model M. The model to be trained for predicting user preferences is labeled as model M, and the model parameters of model M are θ = (θ1, θ2, ..., θ...). n ), where n is the total number of parameters in model M.
[0200] Understandably, after assigning initial values to the model parameters θ of model M and inputting X and D into model M, model training or fitting calculations can be performed on model M. The purpose of this fitting is to calculate the correlation between the user's basic information and the user's preferences. Thus, after model M is trained, the preferences of the new user can be predicted after inputting the basic information of the new user into model M.
[0201] However, assigning different initial values to the model parameters θ of model M often leads to different convergence results. Furthermore, if the total number of parameters n is too large, even the most powerful supercomputer cannot achieve the desired convergence of (θ1, θ2, ..., θ...). n If all initial combinations are traversed once, it is not easy to find the globally optimal solution for fitting the model parameters.
[0202] To address the aforementioned issues, the model parameter recommendation method disclosed herein can be employed. This method involves first determining the local optimum space (i.e., the target space) of the model parameters θ of model M, and then recommending the initial model parameters from each of the local optimum spaces where the global optimum of the model parameters is most likely to occur. In other words, it first determines the local optimum of the model parameter fitting, and then determines the initial model parameters based on each local optimum. This approach can assist relevant personnel in quickly finding the global optimum of the model parameter fitting, thereby improving the success rate of model fitting.
[0203] Therefore, in this application scenario, multiple value spaces can be determined based on the range of the model parameter θ of model M. Sampling in each value space yields the first initial parameters within each value space. The first initial parameters in each value space are used as model parameters for the first model training to adjust the model parameters of model M to the first target parameters after training. By merging and / or splitting the value spaces according to the value space to which at least one first target parameter belongs, and the value space to which the corresponding first initial parameter belongs before training, at least one target space can be obtained, where the target space is the local optimum space. Finally, based on at least one target space, the initial model parameters of the model M to be trained can be recommended. And based on these initial model parameters, the model M can be trained a second time using the basic information of multiple users, minimizing the difference between the predicted preferences output by model M and the user preferences labeled by the corresponding user. At this point, model M is successfully fitted, and the global optimum of model M can be determined. Furthermore, the successfully fitted or trained model M can be used to predict the preferences of new users.
[0204] It should be noted that the above scenarios are merely illustrative, and this disclosure does not limit the application scenarios of the model parameter recommendation method.
[0205] With the above Figures 1 to 6 Corresponding to the model parameter recommendation method provided in the embodiments, this disclosure also provides a model parameter recommendation device. Since the model parameter recommendation device provided in the embodiments of this disclosure is similar to the one described above... Figures 1 to 6 The method for recommending model parameters provided in the embodiments corresponds to the method for recommending model parameters provided in the embodiments of this disclosure. Therefore, the implementation method for recommending model parameters is also applicable to the device for recommending model parameters provided in the embodiments of this disclosure, and will not be described in detail in the embodiments of this disclosure.
[0206] Figure 8 This is a schematic diagram of the structure of the device for recommending model parameters shown in the sixth embodiment of this disclosure.
[0207] Reference Figure 8 The device 800 for recommending model parameters may include: a determination module 801, a sampling module 802, a training module 803, a processing module 804, and a recommendation module 805.
[0208] Among them, the determination module 801 is used to determine multiple value spaces based on the value range of the model parameters.
[0209] The sampling module 802 is used to sample each value space to obtain the first initial parameter in each value space.
[0210] The training module 803 is used to train the first model by taking the first initial parameters in each value space as model parameters, so as to adjust the model parameters of the model to the first target parameters after training.
[0211] The processing module 804 is used to merge and / or split the value space according to the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training, so as to obtain at least one target space.
[0212] Recommendation module 805 is used to recommend initial model parameters for training a second model based on at least one target space.
[0213] In one possible implementation of this disclosure, the processing module 804 is configured to: for any first target parameter, count the number of initial parameters contained in the value space of the first initial parameter before training; if the number of initial parameters is not greater than the number threshold, merge the value space of the first target parameter with the value space of the first initial parameter before training, so as to use the merged value space as the target space.
[0214] In one possible implementation of this disclosure, the model parameter recommendation device 800 may further include:
[0215] The splitting module is used to split the value space of the first initial parameter before training if the number of initial parameters is greater than the threshold, so as to obtain a subspace that matches the number of initial parameters.
[0216] The merging module is used to merge the subspace to which the first initial parameter belongs before training belongs with the value space to which the first target parameter belongs.
[0217] In one possible implementation of this disclosure, the splitting module is configured to: use the perpendicular bisector of the line connecting adjacent first initial parameters as a dividing line; and split the value space of the corresponding first initial parameter before training according to the dividing line to obtain a subspace matching the number of first initial parameters.
[0218] In one possible implementation of this disclosure, the processing module 804 is configured to: input a first training sample into a model using the first target parameter for any first target parameter, so as to determine a first function value of the target function based on the first output of the model and the first expectation of the first training sample, wherein the first function value of the target function is used to indicate the difference between the first output and the first expectation; filter each first target parameter according to the first function value corresponding to each first target parameter; and merge and / or split the value spaces of the selected and retained first target parameters according to their respective value spaces and the value spaces of the corresponding first initial parameters before training, so as to obtain at least one target space.
[0219] In one possible implementation of this disclosure, the processing module 804 is configured to: merge and / or split the value spaces according to the value space to which each first initial parameter belongs and the value space to which the corresponding trained first target parameter belongs, so as to obtain at least one target space.
[0220] In one possible implementation of this disclosure, the recommendation module 805 is configured to: acquire multiple training sample sets; for any training sample set, determine the corresponding global optimal space from at least one target space, wherein the global optimal space is the value space of the model parameters when the objective function of the model is maximized by using the training sample set to train the model using a third model to adjust the model parameters; statistically obtain the probability that each target space is the global optimal space based on the global optimal spaces corresponding to the multiple training sample sets; and recommend initial model parameters for training the model using a second model based on the probability that each target space is the global optimal space.
[0221] In one possible implementation of this disclosure, the recommendation module 805 is configured to: sample each target space for any training sample set to obtain second initial parameters; use the second initial parameters in each target space as model parameters, and train a third model based on the gradient descent algorithm using the training sample set; and determine the global optimal space that makes the objective function take the maximum or minimum value from multiple target spaces based on the value of the objective function after model training.
[0222] In one possible implementation of this disclosure, the recommendation module 805 is used to: display a heatmap based on the probability that each target space is the global optimal space; wherein the heatmap is used to recommend selecting initial model parameters from the target space with the highest probability.
[0223] The model parameter recommendation apparatus of this disclosure determines multiple value spaces based on the value range of the model parameters; samples each value space to obtain first initial parameters within each value space; uses the first initial parameters in each value space as model parameters for first model training to adjust the model parameters to the first target parameters after training; merges and / or splits the value spaces based on the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training to obtain at least one target space; and recommends initial model parameters for second model training based on at least one target space. Therefore, by merging and / or splitting the value spaces to which the first initial parameters belong before model training and the value spaces to which the corresponding first target parameters belong after model training, the target space (i.e., the local optimum space) corresponding to the model can be effectively obtained. This allows for the recommendation of initial model parameters based on each target space, i.e., recommending initial model parameters from each target space where the global optimum of the model parameters is more likely to occur, thereby improving the success rate of subsequent model fitting.
[0224] With the above Figure 7 Corresponding to the user preference recognition method provided in the embodiments, this disclosure also provides a user preference recognition device. Since the user preference recognition device provided in the embodiments of this disclosure is similar to the one described above... Figure 7 The user preference recognition method provided in the embodiments corresponds to the user preference recognition method provided in the embodiments of this disclosure, and therefore the implementation of the user preference recognition method is also applicable to the user preference recognition device provided in the embodiments of this disclosure, and will not be described in detail in the embodiments of this disclosure.
[0225] Figure 9 This is a schematic diagram of the user preference recognition device shown in the seventh embodiment of this disclosure.
[0226] Reference Figure 9 The user preference recognition device 900 may include: a determination module 901, a sampling module 902, a first training module 903, a processing module 904, a recommendation module 905, a second training module 906, and a prediction module 907.
[0227] Among them, the determining module 901 is used to determine multiple value spaces based on the value range of the model parameters of the recognition model.
[0228] The sampling module 902 is used to sample each value space to obtain the first initial parameter in each value space.
[0229] The first training module 903 is used to train the first model by taking the first initial parameters in each value space as model parameters, so as to adjust the model parameters of the model to the first target parameters after training; wherein, in the first model training, the training samples containing user parameters in the model input are identified, classified and output predicted user preferences.
[0230] The processing module 904 is used to merge and / or split the value space according to the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training, so as to obtain at least one target space.
[0231] Recommendation module 905 is used to recommend initial model parameters based on at least one target space.
[0232] The second training module 906 is used to train the model using multiple user samples based on the recommended initial model parameters, so as to minimize the difference between the predicted preferences output by the model and the user preferences labeled in the corresponding user samples.
[0233] The recognition module 907 is used to identify user preferences using a trained model.
[0234] The user preference recognition device of this disclosure determines multiple value spaces based on the value range of the model parameters of the recognition model; samples each value space to obtain a first initial parameter within each value space; uses the first initial parameters in each value space as model parameters for first model training to adjust the model parameters to the trained first target parameters; wherein, in the first model training, the recognition model inputs training samples containing user parameters, performs classification to output predicted user preferences; merges and / or splits the value spaces according to the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training to obtain at least one target space; recommends initial model parameters based on at least one target space; and uses multiple user samples for second model training based on the recommended initial model parameters to minimize the difference between the predicted preferences output by the model and the user preferences labeled in the corresponding user samples; and uses the trained model for user preference recognition. Therefore, it is possible to effectively train the user preference recognition model to be trained based on the recommended initial model parameters, which can improve the success rate of model fitting and thus improve the accuracy of model prediction.
[0235] In an exemplary embodiment, an electronic device is also proposed.
[0236] The electronic devices include:
[0237] processor;
[0238] Memory used to store processor-executable instructions;
[0239] The processor is configured to execute instructions to implement the model parameter recommendation method or user preference recognition method proposed in any of the foregoing embodiments.
[0240] As an example, Figure 10 This is a schematic diagram of the structure of an electronic device 1000 as shown in an exemplary embodiment of this disclosure, as follows: Figure 10 As shown, the aforementioned electronic device 1000 may further include:
[0241] The memory 1010 and the processor 1020 are connected by a bus 1030, which connects different components (including the memory 1010 and the processor 1020). The memory 1010 stores a computer program, which, when executed by the processor 1020, implements the model parameter recommendation method or user preference recognition method described in the embodiments of this disclosure.
[0242] Bus 1030 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0243] Electronic device 1000 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by electronic device 1000, including volatile and non-volatile media, removable and non-removable media.
[0244] The memory 1010 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 1040 and / or cache memory 1050. The server 1000 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 1060 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 10 Not shown; usually referred to as a "hard drive"). Although Figure 10Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 1030 via one or more data media interfaces. Memory 1010 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this disclosure.
[0245] A program / utility 1080 having a set (at least one) of program modules 1070 may be stored, for example, in memory 1010. Such program modules 1070 include—but are not limited to—an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 1070 typically perform the functions and / or methods described in the embodiments of this disclosure.
[0246] Electronic device 1000 can also communicate with one or more external devices 1090 (e.g., keyboard, pointing device, display 1091, etc.), and with one or more devices that enable a user to interact with electronic device 1000, and / or with any device that enables electronic device 1000 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 1092. Furthermore, electronic device 1000 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1093. As shown, network adapter 1093 communicates with other modules of electronic device 1000 via bus 1030. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0247] The processor 1020 performs various functional applications and data processing by running programs stored in the memory 1010.
[0248] It should be noted that the implementation process and technical principles of the electronic device in this embodiment are explained in the foregoing description of the model parameter recommendation method or user preference recognition method of the present disclosure embodiments, and will not be repeated here.
[0249] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions that can be executed by a processor of an electronic device to perform the method proposed in any of the above embodiments. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0250] In an exemplary embodiment, a computer program product is also provided, including a computer program / instructions, characterized in that the computer program / instructions, when executed by a processor, implement the method proposed in any of the above embodiments.
[0251] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0252] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for recommending model parameters, characterized in that, The method includes: Based on the range of values of the model parameters, multiple value spaces are determined. Specifically, the range of values of the model parameters is divided according to the dimension corresponding to each parameter in the model parameters to obtain multiple value spaces. Samples are taken for each of the value spaces to obtain the first initial parameter in each of the value spaces; The first initial parameters in each of the value spaces are used as model parameters to train the first model, so as to adjust the model parameters of the model to the first target parameters after training. Based on the value space to which at least one of the first target parameters belongs and the value space to which the corresponding first initial parameter belongs before training belongs, the value space is merged and / or split to obtain at least one target space, including: for any first target parameter, counting the number of initial parameters contained in the value space to which the corresponding first initial parameter belongs before training belongs; if the number of initial parameters is not greater than a threshold, merging the value space to which the first target parameter belongs with the value space to which the corresponding first initial parameter belongs before training, so as to use the merged value space as the target space; Based on the at least one target space, initial model parameters are recommended for training the second model on the model.
2. The method according to claim 1, characterized in that, After counting the number of initial parameters included in the value space of the first initial parameter before training for any first target parameter, the method further includes: If the number of initial parameters is greater than the number threshold, the value space of the first initial parameter before training is split to obtain a subspace that matches the number of initial parameters; The subspace to which the first initial parameter belongs before training belongs is merged with the value space to which the first target parameter belongs.
3. The method according to claim 2, characterized in that, The step of splitting the value space of the first initial parameter before training to obtain a subspace matching the number of initial parameters includes: The perpendicular bisector of the line connecting adjacent first initial parameters is used as the dividing line. Based on the dividing line, the value space of the first initial parameter before training is split to obtain a subspace that matches the number of the first initial parameters.
4. The method according to any one of claims 1-3, characterized in that, The step of merging and / or splitting the value spaces based on the value spaces of at least one of the first target parameters and the value spaces of the corresponding first initial parameters before training to obtain at least one target space includes: For any of the first target parameters, a first training sample is input into a model using the first target parameters, so as to determine a first function value of the objective function based on the first output of the model and the first expectation of the first training sample, wherein the first function value of the objective function is used to indicate the difference between the first output and the first expectation; Based on the first function value corresponding to each first target parameter, each first target parameter is filtered; For the first target parameter that is selected and retained, the value spaces are merged and / or split according to their respective value spaces and the value spaces of the first initial parameters before training, so as to obtain at least one target space.
5. The method according to any one of claims 1-3, characterized in that, The step of merging and / or splitting the value spaces based on the value spaces of at least one of the first target parameters and the value spaces of the corresponding first initial parameters before training to obtain at least one target space includes: Based on the value space to which each of the first initial parameters belongs, and the value space to which the corresponding trained first target parameters belong, the value spaces are merged and / or split to obtain at least one target space.
6. The method according to any one of claims 1-3, characterized in that, The step of recommending initial model parameters for training the second model based on the at least one target space includes: Obtain multiple training sample sets; For any of the training sample sets, a corresponding global optimal space is determined from at least one of the target spaces, wherein the global optimal space is the value space of the model parameters when the objective function of the model is maximized by training the model with the training sample set to adjust the model parameters; Based on the global optimal spaces corresponding to the multiple training sample sets, the probability of each target space being the global optimal space is statistically obtained; Based on the probability that each of the target spaces is the global optimal space, initial model parameters are recommended for training the second model of the model.
7. The method according to claim 6, characterized in that, The step of determining the corresponding global optimal space from at least one of the target spaces for any of the training sample sets includes: For any of the training sample sets, the second initial parameters are obtained by sampling each of the target spaces; The second initial parameters in each of the target spaces are used as model parameters, and the third model is trained using the training sample set based on the gradient descent algorithm. Based on the values of the objective function after model training, a global optimal space is determined from multiple objective spaces that maximizes or minimizes the objective function.
8. The method according to claim 6, characterized in that, The method of recommending initial model parameters for training the second model based on the probability that each target space is the global optimal space includes: A heatmap is displayed based on the probability that each of the target spaces is the globally optimal space; The heatmap is used to recommend selecting the initial model parameters from the target space with the highest probability.
9. A user preference recognition method, characterized in that, The method includes: Based on the value range of the model parameters of the recognition model, multiple value spaces are determined. Specifically, the value range of the model parameters is divided according to the dimension corresponding to each parameter in the model parameters to obtain multiple value spaces. Samples are taken for each of the value spaces to obtain the first initial parameter in each of the value spaces; The first initial parameters in each of the value spaces are used as model parameters for the first model training, so as to adjust the model parameters of the model to the first target parameters after training; wherein, in the first model training, the recognition model inputs training samples containing user parameters, performs classification, and outputs predicted user preferences; Based on the value space to which at least one of the first target parameters belongs and the value space to which the corresponding first initial parameter belongs before training belongs, the value space is merged and / or split to obtain at least one target space, including: for any first target parameter, counting the number of initial parameters contained in the value space to which the corresponding first initial parameter belongs before training belongs; if the number of initial parameters is not greater than a threshold, merging the value space to which the first target parameter belongs with the value space to which the corresponding first initial parameter belongs before training, so as to use the merged value space as the target space; Based on the at least one target space, recommend initial model parameters; Based on the recommended initial model parameters, a second model is trained using multiple user samples to minimize the difference between the predicted preferences output by the model and the user preferences labeled in the corresponding user samples. A trained model is used to identify user preferences.
10. A device for recommending model parameters, characterized in that, The device includes: The determination module is used to determine multiple value spaces based on the value range of the model parameters, wherein the value range of the model parameters is divided according to the dimension corresponding to each parameter in the model parameters to obtain multiple value spaces; A sampling module is used to sample each of the value spaces to obtain the first initial parameter in each of the value spaces; The training module is used to train the first model by taking the first initial parameters in each of the value spaces as model parameters, so as to adjust the model parameters of the model to the first target parameters after training. The processing module is configured to merge and / or split the value spaces according to the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training, so as to obtain at least one target space, including: for any first target parameter, counting the number of initial parameters contained in the value space to which the corresponding first initial parameter belongs before training; if the number of initial parameters is not greater than a number threshold, merging the value space to which the first target parameter belongs with the value space to which the corresponding first initial parameter belongs before training, so as to use the merged value space as the target space; The recommendation module is used to recommend initial model parameters for training the second model based on the at least one target space.
11. A user preference recognition device, characterized in that, The device includes: The determination module is used to determine multiple value spaces based on the value range of the model parameters of the recognition model, wherein the value range of the model parameters is divided according to the dimension corresponding to each parameter in the model parameters to obtain multiple value spaces; A sampling module is used to sample each of the value spaces to obtain the first initial parameter in each of the value spaces; The first training module is used to train the first model by taking the first initial parameters in each of the value spaces as model parameters, so as to adjust the model parameters of the model to the first target parameters after training; wherein, in the first model training, the recognition model inputs training samples containing user parameters, performs classification, and outputs predicted user preferences. The processing module is configured to merge and / or split the value spaces according to the value space to which at least one first target parameter belongs and the value space to which the corresponding first initial parameter belongs before training, so as to obtain at least one target space, including: for any first target parameter, counting the number of initial parameters contained in the value space to which the corresponding first initial parameter belongs before training; if the number of initial parameters is not greater than a number threshold, merging the value space to which the first target parameter belongs with the value space to which the corresponding first initial parameter belongs before training, so as to use the merged value space as the target space; The recommendation module is used to recommend initial model parameters based on the at least one target space; The second training module is used to train the second model using multiple user samples based on the recommended initial model parameters, so as to minimize the difference between the predicted preferences output by the model and the user preferences labeled in the corresponding user samples. The prediction module is used to identify user preferences using a trained model.
12. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-8 or the method described in claim 9.
13. A computer-readable medium, characterized in that, The computer-readable medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-8 or the method described in claim 9.
14. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-8 or the method of claim 9.
Citation Information
Patent Citations
Model training method and device, computer equipment and readable storage medium
CN113344212A
Model training method and system, nonvolatile storage medium and computer terminal
CN114463158A
Algorithm initialization parameter recommendation method and device, electronic equipment and medium
CN115994586A