Model optimization method and device for black box stochastic optimization, terminal and medium
By obtaining and updating model parameters in the black box stochastic optimization algorithm, combining Gaussian smoothing and population gradient optimization strategies, the problem of unstable performance of the black box stochastic optimization algorithm is solved, and more efficient and stable optimization performance is achieved.
Patent Information
- Application Number
- CN202411880487.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-19
AI Technical Summary
The existing black box stochastic optimization algorithm model has the problem of unstable performance, and it is difficult to provide stable optimization performance in practical applications.
By obtaining the model parameters of the target black box random optimization model, including model solution parameters, step size parameters, momentum learning rate parameters, smoothing radius parameters, population size and maximum iteration number, the population gradient and momentum vector of the current iteration period are determined in turn, combined with Gaussian smoothing processing logic and normalized descent calculation formula, the model solution parameters of the next iteration period are calculated, and the population gradient calculation formula and momentum update calculation formula are calculated to calculate the population gradient and momentum vector of the corresponding iteration period.
Through the combination of Gaussian smoothing technology and population-based gradient optimization strategies, the sampling noise in the solution space is effectively reduced, the optimization efficiency and convergence speed are improved, the impact of data space and solution space noise on the optimization process is reduced, and the overall performance and stability of the algorithm are improved.
Smart Images

Figure CN119647148A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a model optimization method, device, terminal and medium for black box random optimization. Background Art
[0002] Black-box stochastic optimization is an optimization method, and common ones include genetic algorithms, particle swarm optimization algorithms, simulated degradation algorithms, etc. In this method, the optimized objective function (also called a black-box function) is regarded as a "black box". This means that the user does not know the internal structure of this function, the specific mathematical expression or derivative information and other details. He can only input some parameters (decision variables) into this black-box function and then get the corresponding output (objective function value). In the optimization process, random factors will be introduced. For example, in the process of searching for the optimal solution, the search direction, step size, etc. may be determined based on random strategies.
[0003] In black-box stochastic optimization problems, the gradient information of the objective function is not available or cannot be directly accessed. For example, in scenarios such as physical simulation, reinforcement learning, and adversarial attacks, the objective function may be non-explicitly defined and the objective function value can only be obtained through random sampling. Traditional gradient-based optimization methods, such as Stochastic Gradient Descent (SGD) and its variants, cannot be directly applied to black-box environments because they rely on gradient information. To address this challenge, zero-order optimization (Zeroth-Order Optimization, ZO) methods represented by Gaussian smoothing techniques have gradually emerged. Zero-order optimization methods do not require gradient information and only optimize through changes in the value of the objective function. It obtains unbiased gradient estimates by introducing Gaussian perturbations in the solution space and calculating finite differences. However, due to noise interference in the solution space and data space, the convergence performance of Gaussian smoothing techniques will degrade, making it difficult to provide stable performance in practical applications. Summary of the invention
[0004] The present application provides a model optimization method, device, terminal and medium for black box random optimization, which are used to solve the technical problem of unstable performance of existing black box random optimization algorithm models.
[0005] In order to solve the above technical problems, the first aspect of the present application provides a model optimization method for black box random optimization, comprising:
[0006] Obtaining model parameters of a target black box stochastic optimization model, wherein the model parameters include: model solution parameters, step size parameters, momentum learning rate parameters, smoothing radius parameters, population size, and maximum number of iterations;
[0007] According to the model parameters and the current iteration period, the population gradient and momentum vector of the current iteration period are determined in sequence;
[0008] Based on the momentum vector, model solution parameters and step size parameters of the current iteration cycle, the model solution parameters of the next iteration cycle are calculated through Gaussian smoothing logic and normalized descent calculation formula. When the convergence or number of iterations of the target black box stochastic optimization model meets the preset iteration termination condition, the current model solution parameters are output. If not, based on the model solution parameters of the next iteration cycle, the population gradient and momentum vector of the corresponding iteration cycle are calculated through the population gradient calculation formula and momentum update calculation formula.
[0009] Preferably, based on the model solution parameters of the next iteration cycle, calculating the population gradient and momentum vector of the corresponding iteration cycle through the population gradient calculation formula and the momentum update calculation formula specifically includes:
[0010] Extracting data samples corresponding to the population size from a sampled data distribution according to the model solution parameters of the next iteration cycle, and generating a Gaussian disturbance vector corresponding to the population size in a solution space;
[0011] Through Gaussian smoothing, the gradient components of each pair of Gaussian perturbation vector and data sample are calculated, and the mean value of each gradient component is used as the population gradient of the corresponding iteration cycle;
[0012] According to the population gradient of the latest iteration cycle and the population gradient of the current iteration cycle, the momentum vector of the corresponding iteration cycle is calculated according to the momentum update calculation formula.
[0013] Preferably, the population gradient calculation formula is specifically:
[0014]
[0015] In the formula, is the population gradient of iteration period t, is the gradient component of population k in iteration period t, is the model solution parameter of iteration period t, is the population size, is the step size parameter, is the data sample of population k in iteration period t, is the Gaussian perturbation vector of population k in iteration period t, is the smoothing radius of iteration period t.
[0016] Preferably, the momentum update calculation formula is specifically:
[0017]
[0018] In the formula, is the momentum vector of iteration period t, is the momentum vector of iteration period t+1, Momentum learning rate for iteration period t, is the population gradient of iteration period t+1, is the population gradient of iteration period t.
[0019] Preferably, the normalized descent calculation formula is specifically:
[0020]
[0021] In the formula, is the model solution parameter of iteration period t+1, is the model solution parameter of iteration period t, is the momentum vector of iteration period t, is the norm of the momentum vector at iteration period t.
[0022] Preferably, before calculating the momentum vector of the corresponding iteration period according to the momentum update calculation formula based on the population gradient of the latest iteration period and the population gradient of the current iteration period, the step further includes:
[0023] Through the disturbance reuse method, according to the Gaussian perturbation vector and data samples of the next iteration cycle, combined with the model solution parameters of this iteration cycle, the gradient component estimation value of each pair of Gaussian perturbation vector and data sample is calculated through Gaussian smoothing processing, and the mean of the estimated values of each gradient component is used as the population gradient of this iteration cycle.
[0024] At the same time, the second aspect of the present application provides a model optimization device for black box random optimization, including:
[0025] A model parameter acquisition unit, used to acquire model parameters of a target black box stochastic optimization model, wherein the model parameters include: model solution parameters, step size parameters, momentum learning rate parameters, smoothing radius parameters, population size, and maximum number of iterations;
[0026] A gradient momentum calculation unit, used to determine the population gradient and momentum vector of the current iteration period in sequence according to the model parameters and the current iteration period;
[0027] An iterative control unit is used to calculate the model solution parameters of the next iterative cycle based on the momentum vector, model solution parameters and step size parameters of the current iterative cycle through Gaussian smoothing processing logic and normalized descent calculation formula. When the convergence or number of iterations of the target black box stochastic optimization model meets the preset iteration termination condition, the current model solution parameters are output. If not, based on the model solution parameters of the next iterative cycle, the population gradient and momentum vector of the corresponding iterative cycle are calculated through the population gradient calculation formula and the momentum update calculation formula.
[0028] Preferably, the model solution parameters based on the next iteration cycle in the iteration control unit are used to calculate the population gradient and momentum vector of the corresponding iteration cycle through the population gradient calculation formula and the momentum update calculation formula, which is specifically used for:
[0029] Based on the model solution parameters of the next iteration cycle, the population gradient and momentum vector of the corresponding iteration cycle are calculated by the population gradient calculation formula and the momentum update calculation formula, which specifically includes:
[0030] Extracting data samples corresponding to the population size from a sampled data distribution according to the model solution parameters of the next iteration cycle, and generating a Gaussian disturbance vector corresponding to the population size in a solution space;
[0031] Through Gaussian smoothing, the gradient components of each pair of Gaussian perturbation vector and data sample are calculated, and the mean value of each gradient component is used as the population gradient of the corresponding iteration cycle;
[0032] According to the population gradient of the latest iteration cycle and the population gradient of the current iteration cycle, the momentum vector of the corresponding iteration cycle is calculated according to the momentum update calculation formula.
[0033] A third aspect of the present application provides a computer terminal, comprising: a memory and a processor;
[0034] The memory is used to store program code, and the program code is used to implement a model optimization method for black box random optimization as provided in the first aspect of the present application;
[0035] The processor is used for reading and executing the program code.
[0036] The fourth aspect of the present application provides a computer-readable storage medium, in which a program code is contained, and the program code is used to be read and executed by a processor to implement a model optimization method for black-box random optimization as provided in the first aspect of the present application.
[0037] It can be seen from the above technical solutions that this application has the following advantages:
[0038] In each iteration cycle, the method of the present application determines the population gradient and momentum vector of the current iteration cycle in turn according to the model parameters and the current iteration cycle; based on the momentum vector, model solution parameters and step parameters of the current iteration cycle, the model solution parameters of the next iteration cycle are calculated through Gaussian smoothing processing logic and normalized descent calculation formula; when the iteration termination condition is not met, based on the model solution parameters of the new iteration cycle, the population gradient and momentum vector of the new iteration cycle are calculated through the population gradient calculation formula and the momentum update calculation formula. The method of the present application combines Gaussian smoothing technology with a population-based gradient optimization strategy, while retaining the advantages of Gaussian smoothing in processing high-dimensional optimization problems, and uses population search to effectively reduce the sampling noise of the solution space, thereby improving the optimization efficiency and convergence speed. It can not only reduce the impact of data space and solution space noise on the optimization process, but also improve the overall performance and stability of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 A flowchart of an embodiment of a model optimization method for black-box random optimization provided in this application.
[0041] Figure 2 A logic flow chart of gradient and momentum update in a model optimization method for black-box stochastic optimization provided in this application.
[0042] Figure 3 A pseudo-code logic diagram of a model optimization method for black-box random optimization provided in this application.
[0043] Figure 4 A schematic diagram of the structure of an embodiment of a model optimization device for black-box stochastic optimization provided in the present application.
[0044] Figure 5 A schematic diagram of the structure of a computer terminal embodiment provided in the present application. DETAILED DESCRIPTION
[0045] The embodiments of the present application provide a model optimization method, device, terminal and medium for black box random optimization, which are used to solve the technical problem of unstable performance of existing black box random optimization algorithm models.
[0046] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described below are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] First, a detailed description of an embodiment of a model optimization method for black box stochastic optimization provided by this application is as follows:
[0048] See also Figures 1 to 3 , the present application provides a model optimization method embodiment for black box random optimization, including:
[0049] Step 101: Obtain model parameters of a target black box stochastic optimization model;
[0050] Among them, the model parameters include: model solution parameters, step size parameters, momentum learning rate parameters, smoothing radius parameters, population size and maximum number of iterations;
[0051] It should be noted that according to the method provided in this embodiment, first, the black box stochastic optimization algorithm model to be optimized, that is, the target black box stochastic optimization model, is obtained, and then the model parameters of the target black box stochastic optimization model are obtained, wherein the model parameters include: model solution parameters , step size parameter , momentum learning rate parameter , smoothing radius parameter , population size and the maximum number of iterations T, where the model solution parameters , step size parameter , momentum learning rate parameter , smoothing radius parameter is the parameter to be optimized, and its specific value may change with each optimization iteration;
[0052] It is understandable that if the current iteration is in the first round, the model parameters obtained are all initial parameters, such as the initial model solution parameters , initial step size parameter , initial momentum learning rate parameter , initial smoothing radius parameter If it is not the first iteration cycle, the model parameters obtained are the parameters optimized in the previous iteration cycle.
[0053] Step 102: According to the model parameters and the current iteration cycle, the population gradient and momentum vector of the current iteration cycle are determined in sequence;
[0054] It should be noted that based on the model parameters obtained in the previous step, for each iteration t=0,1,…,T-1, the population gradient and momentum vector of the current iteration cycle are calculated in sequence through the preset population gradient calculation formula and momentum update calculation formula;
[0055] Step 103: Based on the momentum vector, model solution parameters and step size parameters of the current iteration cycle, the model solution parameters of the next iteration cycle are calculated through Gaussian smoothing logic and normalized descent calculation formula. When the convergence or number of iterations of the target black box stochastic optimization model meets the preset iteration termination condition, the current model solution parameters are output. If not, based on the model solution parameters of the next iteration cycle, the population gradient and momentum vector of the corresponding iteration cycle are calculated.
[0056] It should be noted that the gradient direction after momentum update is used to update the model solution parameters according to the following rules, so as to calculate the model solution parameters for the next iteration cycle: :
[0057] ,
[0058] in, is the step length, is the norm of the momentum vector. The normalized descent rule ensures adaptivity to the step size.
[0059] Then, the current optimization convergence and iteration number of the target black box stochastic optimization model are judged. When the convergence or iteration number of the target black box stochastic optimization model meets the preset iteration termination condition, the iteration cycle can be stopped and the final model solution parameters are output. If the iteration termination condition is not met, the model solution parameters are The population gradient calculation logic and momentum update logic provided in this embodiment calculate the population gradient of the corresponding iteration cycle in turn. and momentum vector , and then enter the next iteration. It can be understood that after entering the next iteration cycle, the model solution parameters calculated in the previous cycle can be used , population gradient and momentum vector As this iteration cycle Population gradient and momentum vector , continue to participate in the subsequent steps.
[0060] More specifically, if Figure 2 and Figure 3 As shown, the parameter updating logic in step 103 of this embodiment specifically includes:
[0061] Step 1031: extract data samples corresponding to the population size from the sampled data distribution according to the model solution parameters of the next iteration cycle, and generate a Gaussian disturbance vector corresponding to the population size in the solution space;
[0062] Step 1032: Calculate the gradient component of each pair of Gaussian disturbance vector and data sample through Gaussian smoothing, and use the mean value of each gradient component as the population gradient of the corresponding iteration period;
[0063] Step 1033 calculates the momentum vector of the corresponding iteration period according to the population gradient of the latest iteration period and the population gradient of the current iteration period and the momentum update calculation formula.
[0064] It should be noted that at iteration t, the current solution is smoothed by Gaussian smoothing technology. The specific implementation steps are as follows:
[0065] The population size generated in the solution space is The Gaussian perturbation vector :
[0066]
[0067] Among them, I represents the identity matrix, Represents a multidimensional normal distribution with mean 0 and identity covariance matrix.
[0068] From the data distribution Extract a data sample that is consistent with the population size :
[0069] .
[0070] According to the Gaussian smoothing technique, each pair of perturbation vectors is calculated and data samples The gradient component of is calculated as follows:
[0071]
[0072] In the formula, is the population gradient of iteration period t, is the gradient component of population k in iteration period t, is the model solution parameter of iteration period t, is the population size, is the step size parameter, is the data sample of population k in iteration period t, is the Gaussian perturbation vector of population k in iteration period t, is the smoothing radius of the iteration period t;
[0073] Next, take the average of all gradient components to get the gradient of the current iteration period t :
[0074] .
[0075] This method has a population size of When it increases, it can significantly reduce the gradient estimation error introduced by data sampling and solution space sampling, and the upper bound of the estimation error is:
[0076]
[0077] in represents stochastic gradient and the true smooth gradient The expected value of the mean square error between is the smoothing radius Noise variance A constant related to the dimension n of the solution space.
[0078] The momentum update calculation formula provided in this embodiment is specifically:
[0079]
[0080] In the formula, is the momentum vector of iteration period t, is the momentum vector of iteration period t+1, Momentum learning rate for iteration period t, is the population gradient of iteration period t+1, is the population gradient of iteration period t.
[0081] More specifically, the method provided in this embodiment may further include the following steps:
[0082] Step 10330: Through the disturbance reuse method, according to the Gaussian disturbance vector and data samples of the next iteration cycle, combined with the model solution parameters of this iteration cycle, through Gaussian smoothing processing, calculate the estimated value of the gradient component of each pair of Gaussian disturbance vector and data sample, and use the mean of the estimated values of each gradient component as the population gradient of this iteration cycle.
[0083] It should be noted that according to the momentum update calculation formula provided in this embodiment, the momentum vector of the update iteration period t+1 mentioned in step 103 is When the latest population gradient is used and the population gradient of the previous iteration cycle , where the population gradient of the previous iteration cycle is In addition to directly reading the population gradient value saved in the previous iteration cycle calculation process, the perturbation reuse processing logic can also be used to generate another set of Gaussian random perturbations, and Gaussian smoothing is performed in a similar way to the current point gradient estimation, that is, the perturbation sample set generated by the previous gradient estimation is reused. The specific implementation example is as follows:
[0084] First, if Figure 3 As shown, use The Gaussian perturbation generated at { } and data sample { }; Then at the previous iteration point , using the same perturbation vector and data samples to calculate the individual gradient components of iteration period t:
[0085]
[0086] Next, take the average of all the gradient components calculated by the above formula to get the estimated value of the population gradient at the previous iteration point , the expression is as follows:
[0087]
[0088] is the estimated value of the population gradient at iteration period t, is the estimated value of the gradient component of population k in iteration period t.
[0089] It should be noted that the key point of the perturbation reuse strategy is and The same Gaussian perturbation set Gaussian perturbation was used and data samples This sharing mechanism makes and The random noise sources of are partially overlapped, reducing the gradient correction term ( - ) of random fluctuations.
[0090] Under the assumption that the component functions are smooth, the gradient estimate given in the algorithm satisfies:
[0091]
[0092] Where L is the smoothness constant of the objective function; when the smoothing radius , and step length is small enough, the correction term ( - ) can be ignored, and the iteration gradually converges ( ). If the disturbance is regenerated and data samples , then the variance of the gradient estimate can be decomposed into the superposition of the noise in the solution space and the data space, and by reusing and , so that the gradient estimates of iteration cycles t+1 and t share the same noise source, and the momentum term Represents a true smooth gradient A Monte Carlo estimate of , combined with the boundedness principle of the gradient estimation error, its variance will gradually decrease during the iteration process. This method can limit the noise fluctuation of the correction term to provide a guarantee for the convergence of the algorithm, thereby improving the stability and accuracy of the estimation results.
[0093] Among them, the boundedness of the gradient estimation error is as follows: Consider using the hyperparameters as:
[0094] ;
[0095] Under the above assumptions, the gradient estimation error The following inequality constraints are satisfied:
[0096] ;
[0097] in, is the initial step size, is the step length of the tth generation, is the variance of the noise, is the smoothness constant of the objective function, is a bounding constant for the gradient, is the dimension of the solution space, is the population size.
[0098] This embodiment is based on the above method and also provides an example of optimizing performance based on the above method:
[0099] When the parameter setting satisfies the conditions of the disturbance reuse logic mentioned above and the following assumptions are met, When , the iteration satisfies the following relationship:
[0100]
[0101] in, , indicating the initial value of the function With the optimal value The gap between.
[0102] The above assumptions include:
[0103] Assumption 1 (boundedness of objective function value): The lower bound of the objective function value is a constant ,Right now: ;
[0104] Assumption 2 (unbiased and bounded data sampling): The data sampling is unbiased, that is: ;
[0105] In addition, there is a constant , so that ;
[0106] Assumption 3 (Smoothness of component functions): The component functions For all exist Above is ;
[0107] Assumption 4 (Boundedness of the gradient norm): The norm of the gradient is bounded by a constant ,Right now: .
[0108] When choosing the initial step size When , the above bounds can be further optimized as:
[0109]
[0110] in, Ignore minor Item, let the population size And the smoothness constant L of the objective function, the initial value of the function With the optimal value The gap between , the bounded constant G of the gradient and the noise variance is considered as a constant, then PVRE guarantees The number of iterations required is .
[0111] Since each iteration requires Function evaluation, PVRE outputs a The function evaluation complexity of the first-order optimal solution of accuracy is , which is consistent with the best result known so far, with only one difference Factor, which comes from the use of a gradually shrinking step size strategy. This embodiment combines Gaussian smoothing technology and a population-based gradient estimation method, effectively reducing sampling noise in the data space and the solution space, and enhancing the accuracy of gradient estimation. Compared with existing methods, the main advantage of PVRE lies in its adaptive convergence, because it does not require any prior knowledge about the characteristics of the problem landscape. PVRE adopts a gradually shrinking step size rule to achieve stable convergence in the optimization process and improve the performance of computers when running black box random optimization algorithms.
[0112] The above is a detailed description of an embodiment of a model optimization method for black box stochastic optimization provided by the present application. The following is a detailed description of an embodiment of a model optimization device for black box stochastic optimization provided by the present application.
[0113] See also Figure 4 , the present application provides a model optimization device for black box stochastic optimization, comprising:
[0114] A model parameter acquisition unit 201 is used to acquire model parameters of a target black box stochastic optimization model, wherein the model parameters include: model solution parameters, step size parameters, momentum learning rate parameters, smoothing radius parameters, population size, and maximum number of iterations;
[0115] A gradient momentum calculation unit 202, used to determine the population gradient and momentum vector of the current iteration period in sequence according to the model parameters and the current iteration period;
[0116] The iteration control unit 203 is used to calculate the model solution parameters of the next iteration cycle based on the momentum vector, model solution parameters and step parameters of the current iteration cycle through Gaussian smoothing processing logic and normalized descent calculation formula. When the convergence or number of iterations of the target black box stochastic optimization model meets the preset iteration termination condition, the current model solution parameters are output. If not, based on the model solution parameters of the next iteration cycle, the population gradient and momentum vector of the corresponding iteration cycle are calculated through the population gradient calculation formula and the momentum update calculation formula.
[0117] Furthermore, the model solution parameters based on the next iteration cycle in the iteration control unit 203 are used to calculate the population gradient and momentum vector of the corresponding iteration cycle through the population gradient calculation formula and the momentum update calculation formula. Specifically, it is used for:
[0118] According to the model solution parameters of the next iteration cycle, a data sample corresponding to the population size is extracted from the sampling data distribution, and a Gaussian perturbation vector corresponding to the population size is generated in the solution space;
[0119] Through Gaussian smoothing, the gradient components of each pair of Gaussian perturbation vector and data sample are calculated, and the mean value of each gradient component is used as the population gradient of the corresponding iteration cycle;
[0120] According to the population gradient of the latest iteration cycle and the population gradient of this iteration cycle, the momentum vector of the corresponding iteration cycle is calculated according to the momentum update calculation formula.
[0121] Furthermore, the population gradient calculation formula is as follows:
[0122]
[0123] In the formula, is the population gradient of iteration period t, is the gradient component of population k in iteration period t, is the model solution parameter of iteration period t, is the population size, is the step size parameter, is the data sample of population k in iteration period t, is the Gaussian perturbation vector of population k in iteration period t, is the smoothing radius of iteration period t.
[0124] Furthermore, the momentum update calculation formula is specifically:
[0125]
[0126] In the formula, is the momentum vector of iteration period t, is the momentum vector of iteration period t+1, Momentum learning rate for iteration period t, is the population gradient of iteration period t+1, is the population gradient of iteration period t.
[0127] Furthermore, the normalized descent calculation formula is specifically:
[0128]
[0129] In the formula, is the model solution parameter of iteration period t+1, is the model solution parameter of iteration period t, is the momentum vector of iteration period t, is the norm of the momentum vector at iteration period t.
[0130] Furthermore, according to the population gradient of the latest iteration cycle and the population gradient of the current iteration cycle, according to the momentum update calculation formula, before calculating the momentum vector of the corresponding iteration cycle, it also includes:
[0131] Through the perturbation reuse method, according to the Gaussian perturbation vector and data samples of the next iteration cycle, combined with the model solution parameters of this iteration cycle, the gradient component estimation value of each pair of Gaussian perturbation vector and data sample is calculated through Gaussian smoothing processing, and the mean of the estimated values of each gradient component is used as the population gradient of this iteration cycle.
[0132] In addition, the present application also provides a detailed description of embodiments of a computer terminal and a computer-readable storage medium.
[0133] like Figure 5 As shown, this embodiment provides a computer terminal, the main components of the terminal include: a memory 33 and a processor 31;
[0134] The memory 33 is used to store program codes, and the program codes are used to implement a model optimization method for black box random optimization provided in the above embodiment;
[0135] The processor 31 is used to read and execute program codes.
[0136] The present application provides a computer-readable storage medium embodiment, in which program code is stored, and the program code is used to be read and executed by the processor 31 to implement a model optimization method for black-box random optimization as provided in the above embodiment.
[0137] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the terminals, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0138] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0139] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0140] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0141] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0142] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0143] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0144] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A model optimization method for black box stochastic optimization, characterized in that: include: Obtaining model parameters of a target black box stochastic optimization model, wherein the model parameters include: model solution parameters, step size parameters, momentum learning rate parameters, smoothing radius parameters, population size, and maximum number of iterations; According to the model parameters and the current iteration period, the population gradient and momentum vector of the current iteration period are determined in sequence; Based on the momentum vector, model solution parameters and step size parameters of the current iteration cycle, the model solution parameters of the next iteration cycle are calculated through Gaussian smoothing logic and normalized descent calculation formula. When the convergence or number of iterations of the target black box stochastic optimization model meets the preset iteration termination condition, the current model solution parameters are output. If not, based on the model solution parameters of the next iteration cycle, the population gradient and momentum vector of the corresponding iteration cycle are calculated through the population gradient calculation formula and momentum update calculation formula.
2. A model optimization method for black box stochastic optimization according to claim 1, characterized in that: Based on the model solution parameters of the next iteration cycle, the population gradient and momentum vector of the corresponding iteration cycle are calculated by the population gradient calculation formula and the momentum update calculation formula, specifically including: Extracting data samples corresponding to the population size from a sampled data distribution according to the model solution parameters of the next iteration cycle, and generating a Gaussian disturbance vector corresponding to the population size in a solution space; Through Gaussian smoothing, the gradient components of each pair of Gaussian perturbation vector and data sample are calculated, and the mean value of each gradient component is used as the population gradient of the corresponding iteration cycle; According to the population gradient of the latest iteration cycle and the population gradient of the current iteration cycle, the momentum vector of the corresponding iteration cycle is calculated according to the momentum update calculation formula.
3. A model optimization method for black box stochastic optimization according to claim 2, characterized in that: The population gradient calculation formula is specifically: In the formula, is the population gradient of iteration period t, is the gradient component of population k in iteration period t, is the model solution parameter of iteration period t, is the population size, is the step size parameter, is the data sample of population k in iteration period t, is the Gaussian perturbation vector of population k in iteration period t, is the smoothing radius of iteration period t.
4. A model optimization method for black box stochastic optimization according to claim 2, characterized in that: The momentum update calculation formula is specifically: In the formula, is the momentum vector of iteration period t, is the momentum vector of iteration period t+1, Momentum learning rate for iteration period t, is the population gradient of iteration period t+1, is the population gradient of iteration period t.
5. The model optimization method for black box stochastic optimization according to claim 1, characterized in that: The normalized descent calculation formula is specifically: In the formula, is the model solution parameter of iteration period t+1, is the model solution parameter of iteration period t, is the momentum vector of iteration period t, is the norm of the momentum vector at iteration period t.
6. A model optimization method for black box stochastic optimization according to claim 2, characterized in that: Before calculating the momentum vector of the corresponding iteration period according to the momentum update calculation formula based on the population gradient of the latest iteration period and the population gradient of the current iteration period, the method further includes: Through the disturbance reuse method, according to the Gaussian perturbation vector and data samples of the next iteration cycle, combined with the model solution parameters of this iteration cycle, the gradient component estimation value of each pair of Gaussian perturbation vector and data sample is calculated through Gaussian smoothing processing, and the mean of the estimated values of each gradient component is used as the population gradient of this iteration cycle.
7. A model optimization device for black box stochastic optimization, characterized in that: include: A model parameter acquisition unit, used to acquire model parameters of a target black box stochastic optimization model, wherein the model parameters include: model solution parameters, step size parameters, momentum learning rate parameters, smoothing radius parameters, population size, and maximum number of iterations; A gradient momentum calculation unit, used to determine the population gradient and momentum vector of the current iteration period in sequence according to the model parameters and the current iteration period; An iterative control unit is used to calculate the model solution parameters of the next iterative cycle based on the momentum vector, model solution parameters and step size parameters of the current iterative cycle through Gaussian smoothing processing logic and normalized descent calculation formula. When the convergence or number of iterations of the target black box stochastic optimization model meets the preset iteration termination condition, the current model solution parameters are output. If not, based on the model solution parameters of the next iterative cycle, the population gradient and momentum vector of the corresponding iterative cycle are calculated through the population gradient calculation formula and the momentum update calculation formula.
8. A model optimization device for black box stochastic optimization according to claim 7, characterized in that: The model solution parameters based on the next iteration cycle in the iteration control unit are used to calculate the population gradient and momentum vector of the corresponding iteration cycle through the population gradient calculation formula and the momentum update calculation formula. Specifically, it is used to: Extracting data samples corresponding to the population size from a sampled data distribution according to the model solution parameters of the next iteration cycle, and generating a Gaussian disturbance vector corresponding to the population size in a solution space; Through Gaussian smoothing, the gradient components of each pair of Gaussian perturbation vector and data sample are calculated, and the mean value of each gradient component is used as the population gradient of the corresponding iteration cycle; According to the population gradient of the latest iteration cycle and the population gradient of the current iteration cycle, the momentum vector of the corresponding iteration cycle is calculated according to the momentum update calculation formula.
9. A computer terminal, characterized in that: include: Memory and processor; The memory is used to store program codes, and the program codes are used to implement a model optimization method for black box stochastic optimization according to any one of claims 1 to 6; The processor is used for reading and executing the program code.
10. A computer-readable storage medium, characterized in that: The program code in the computer-readable storage medium is used to be read and executed by a processor to implement a model optimization method for black-box stochastic optimization as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Black box optimization method, system and device and storage medium
CN118690111A
Blackbox optimization via model ensembling
US20220405531A1
Cited By
Zero-order primitive dual method and device for black box constraint optimization problem
CN121351632A