This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2023-114576, filed on Jul. 12, 2023, the entire contents of which are incorporated herein by reference.
The embodiment discussed herein is related to an operation program, an operation method, and an information processing apparatus.
A technique has been disclosed in which optimization is performed by performing sampling of binary variables.
Japanese Laid-open Patent Publication No. 2022-190752, Japanese Laid-open Patent Publication No. 2021-33544, and Japanese Laid-open Patent Publication No. 2022-45870 are disclosed as related art.
According to an aspect of the embodiments, a non-transitory computer-readable recording medium stores an operation program for causing a computer to execute a process of, in a case where operation processing is repeatedly executed, the operation processing including creating an Ising model based on a learning data group, searching for a first set number of first recommended points for the Ising model, searching for a second set number of second recommended points for the learning data group by a genetic algorithm, and adding the first recommended points and first evaluation values of the first recommended points and the second recommended points and second evaluation values of the second recommended points to the learning data group as learning data, expressing each piece of learning data of the learning data group as an objective variable obtained by a linear weighted sum of a plurality of objective functions, and changing a weight of the linear weighted sum every time the operation processing is executed.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention.
For example, since a sampling technique using an Ising model in a quadratic unconstrained binary optimization (QUBO) format is a method of sequentially sampling recommended points on a model, there is a possibility that a sampling region is limited. Therefore, as a result, there is a possibility that the number of times of sampling increases.
In one aspect, an object of the present disclosure is to provide an operation program, an operation method, and an information processing apparatus that may reduce the number of times of sampling.
As a technique of searching for a good solution with a high evaluation value from a large number of combinations, order, or the like, a sampling technique of binary variables is used. As the sampling technique of binary variables, there are a sampling technique of randomly performing sampling, a sampling technique using an Ising model in the QUBO format, and the like.
The sampling technique of randomly performing sampling may easily perform sampling, but has a disadvantage that sampling efficiency is poor and the number of times of sampling increases in order to obtain a good solution with high accuracy.
For example, as the sampling technique using a model in the QUBO format, there are factorization machine with quantum annealing (FMQA) and the like. FMQA is a method in which quantum annealing (QA) and factorization machine (FM) (machine learning method) are combined. In the method of FMQA, an FM model in the QUBO format is created from learning data, a good solution is obtained by QA, an evaluation value of the good solution is analyzed by a solver, a result is added to the learning data, and sampling is performed interactively. Further, as the sampling technique using a model in the QUBO format, there is an FMDA technique. FMDA is obtained by replacing the QA portion of FMQA with a digital annealer (DA).
The QUBO format is quadratic unconstrained binary optimization, and is a format that is free from a quadratic constraint and enables binary optimization. For example, the QUBO format may be expressed as in the following formula. xi=0 or 1 (i=1, . . . , N). Wij is a coupling coefficient between xi and xj. bi is a bias coefficient of xi. The first term on the right side is a quadratic term and represents interaction. The second term on the right side is a linear term and represents a bias effect. The third term on the right side is a constant term. In the QUBO format, as exemplified in
As an example of the sampling technique using a model in the QUBO format, an overview of FMDA will be described.
In the above formula, w0, wi, vi, and vj are coefficients to be learned. This machine learning model is a model that is strong against a sparse data set. Since this model is in the QUBO format, a model in the QUBO format may be automatically generated by learning FM.
Next, an evaluation value of an initial point is calculated by using a solver (step S2). An evaluation value is an indicator for determining whether an initial point or a recommended point to be described later is good. By the above-described steps, an initial learning data group in which an initial point and an evaluation value form a set is generated.
Next, a model in the QUBO format is created by generating FM from the learning data group (step S3). Since FM is in the QUBO format, generation of FM is equivalent to generation of a model in the QUBO format. Any other machine learning model may be used as long as a model in the QUBO format may be generated.
Next, optimization of the created model in the QUBO format is performed by using DA, and a good solution with the best evaluation value (DA recommended point) is generated (step S4).
Next, an evaluation value of the DA recommended point is calculated by using the solver (step S5).
Next, an evaluation result (a recommended point and evaluation value set) is added to the learning data group as learning data (step S6).
Next, it is determined whether the number of times of iteration has reached an upper limit (step S7). When “No” is determined in step S7, the processing is executed again from step S3. Accordingly, step S3 to step S6 are repeated until an end condition is satisfied. When “Yes” is determined in step S7, the execution of the flowchart ends. As the end condition, a condition such as a case where an amount of change in objective function is less than a threshold for a certain period of time may be used.
By the above-described procedure, the learning data group is updated, and an optimal solution may be obtained.
Although FMDA has been described in
Since the sampling technique using a model in the QUBO format is a method of sequentially sampling recommended points on the model, there is a possibility that a sampling region may be limited. In the sampling technique using a model in the QUBO format, sampling performance depends on a learning data group for model generation. Since FM is a quadratic model, there is a possibility that a problem may not be fully expressed. In a case where a plurality of recommendation methods is used, it is difficult to adjust the number of recommendations. From the above, the number of times of sampling increases in order to increase the accuracy of searching for an optimal solution.
Accordingly, in the following embodiment, an example in which the number of times of sampling may be reduced will be described.
The CPU 101 is a central processing unit. The CPU 101 includes one or more cores. The RAM 102 is a volatile memory that temporarily stores a program executed by the CPU 101, data processed by the CPU 101, and the like. The storage device 103 is a nonvolatile storage device. As the storage device 103, for example, a read-only memory (ROM), a solid-state drive (SSD) such as a flash memory, a hard disk to be driven by a hard disk drive, or the like may be used. The storage device 103 stores an operation program. The input device 104 is an input device such as a keyboard or a mouse. The display device 105 is a display device such as a liquid crystal display (LCD). By the CPU 101 executing the operation program, the storing unit 10, the initial point generation unit 20, the evaluation unit 30, the FMDA execution unit 40, the GA execution unit 50, the learning data update unit 60, the output unit 70, and the like are realized. Hardware such as dedicated circuits may be used as the storing unit 10, the initial point generation unit 20, the evaluation unit 30, the FMDA execution unit 40, the GA execution unit 50, the learning data update unit 60, the output unit 70, and the like.
Next, the evaluation unit 30 calculates an evaluation value of an initial point by using a solver (step S12). An initial learning data group in which the initial point obtained in step S11 and the evaluation value calculated in step S12 form a set is stored in the storing unit 10.
Next, the FMDA execution unit 40 generates a DA recommended point, and the GA execution unit 50 generates a GA recommended point (step S13).
Next, the evaluation unit 30 calculates an evaluation value of the recommended point generated in step S13 by using the solver (step S14).
Next, the learning data update unit 60 adds an evaluation result (a recommended point and evaluation value set) to the learning data group as learning data (step S15).
Next, the FMDA execution unit 40 determines whether the number of times of iteration has reached an upper limit (step S16). The number of times of execution of step S16 may be set as the number of times of iteration. An upper limit number of the number of times of iteration is set in advance by a user.
When “No” is determined in step S16, the processing is executed again from step S13. When “Yes” is determined in step S16, the execution of the flowchart ends.
Next, the initial point generation unit 20 calculates determinant D=|XTX| serving as a D optimal indicator by using the result of step S21 (step S22). XT is a transposed matrix of matrix X.
Next, the initial point generation unit 20 saves the current D and X as Dbest and Xbest, respectively (step S23). In this flowchart, X created in step S21 is saved as Xbest, and D created in step S22 is saved as Dbest.
Next, the initial point generation unit 20 newly and randomly creates matrix X having the value of 0 or 1 for the same (initial point, number of variables) as that in step S21 (step S24).
Next, the initial point generation unit 20 calculates determinant D=|XTX| serving as a D optimal indicator by using the result of step S24 (step S25).
Next, the initial point generation unit 20 determines whether D>Dbest (step S26). When “No” is determined in step S26, the processing is executed again from step S24.
When “Yes” is determined in step S26, the initial point generation unit 20 saves the current D and X as Dbest and Xbest, respectively (step S27). In this flowchart, X finally created in step S24 is saved as Xbest, and D finally created in step S25 is saved as Dbest.
Next, the initial point generation unit 20 determines whether the number of times of searching has reached an upper limit (step S28). As the number of times of searching, the number of times of execution of step S28 or the like may be used. For example, the number of times of searching is 10000 or the like. When “No” is determined in step S28, the processing is executed again from step S24.
When “Yes” is determined in step S28, the initial point generation unit 20 sets the current Xbest as the initial point (step S29). After that, the execution of the flowchart ends.
By executing the processing of
In matrix X of the upper part of
The lower part of
Next, the FMDA execution unit 40 calculates an objective function value by a linear weighted sum (step S32). In this flowchart, the FMDA execution unit 40 adds a plurality of objective functions by a linear weighted sum, and converts the plurality of objective functions into one objective function. For example, when first objective function F1=y1 and second objective function F2=y2, post-conversion objective function E=αF1+ (1−α)F2. α is a weight and satisfies 0<α<1. Every time step S31 is iterated, the value of α changes. Alternatively, an interaction term may be introduced as in E=αF1+βF2+γF1F2. In this case, α, β, and γ are weights, and when β=(1−α) and γ=0, E=αF1+(1−α)F2.
Next, the learning data update unit 60 determines whether the total number of pieces of learning data in a learning data group exceeds an upper limit number (step S33). An upper limit number of the number of pieces of learning data is set in advance by a user.
When “Yes” is determined in step S33, the learning data update unit 60 selects the upper limit number of pieces of learning data in descending order of evaluation value of objective function value by a linear weighted sum, and deletes data other than the selected learning data (step S34). Alternatively, the learning data update unit 60 may select learning data in which an evaluation value is equal to or larger than a predetermined value, and delete learning data other than the selected learning data.
When “No” is determined in step S33, the learning data update unit 60 sets all pieces of learning data as learning data (step S35).
After the execution of step S34 or step S35, the FMDA execution unit 40 generates a model in the QUBO format by generating FM based on the learning data group stored in the storing unit 10 (step S36). Since FM is in the QUBO format, generation of FM is equivalent to generation of a model in the QUBO format. Any other machine learning model may be used as long as a model in the QUBO format may be generated.
Next, the FMDA execution unit 40 calculates determination coefficient R2 of the FM model for the learning data group (step S37). Determination coefficient R2 is an indicator of model accuracy, and represents that, as the determination coefficient is closer to 1, the accuracy of searching for a good solution with a high evaluation value is higher. For example, determination coefficient R2 may be calculated by the following formula.
In the formula, yi is an actual measurement value. The following formula is a prediction value.
ŷ
The following formula is an average value of actual measurement values.
Next, the FMDA execution unit 40 determines whether determination coefficient R2 exceeds threshold δ (step S38). Threshold δ is set in advance by a user. An example of threshold δ will be described. For example, threshold δ is set to be 0.8 or so when step S38 is executed for the first time. Preferably, the value of threshold δ is small when DA recommendation works effectively, and the value of threshold δ is large when DA recommendation does not work effectively. For example, whether DA recommendation works effectively may be determined depending on whether a rate of determination of “Yes” in step S38 is equal to or larger than a threshold.
When “Yes” is determined in step S38, the FMDA execution unit 40 generates as many DA recommended points as the number of DA set recommendations by QUBO optimization by DA (step S39). The number of DA set recommendations is set in advance by a user. A DA recommended point is a good solution (recommended point) with the best evaluation value. Alternatively, a DA recommended point is a good solution (recommended point) with an evaluation value equal to or larger than a threshold. Alternatively, a DA recommended point is a good solution (recommended point) with an evaluation value up to a predetermined ranking from the top.
After that, the GA execution unit 50 sets the number of GA recommendations to be the number of GA set recommendations (step S40).
When “No” is determined in step S38, the GA execution unit 50 sets the number of GA recommendations to be (the number of GA set recommendations+the number of DA set recommendations) (step S41). The number of GA set recommendations is set in advance by a user. The number of GA recommendations does not have to be (the number of GA set recommendations+the number of DA set recommendations), and may be a number larger than the number of GA recommendations.
After the execution of step S40 or after the execution of step S41, the GA execution unit 50 selects, from all learning data groups stored in the storing unit 10, as many parent individuals as the number of GA recommendations by using a multi-objective GA method (step S42). The method of selecting parent individuals is not particularly limited as long as the method is a multi-objective GA method. For example, the non-dominated sorting genetic algorithm II (NSGAII) may be used. In NSGAII, individuals are selected from the viewpoint of variety based on convergence based on a non-dominated rank and a crowding distance. For example, individuals are selected in rank order (Rank 1→Rank 2→ . . . ), and are selected in ascending order of crowdedness within the same rank. For example, as exemplified in
Next, the GA execution unit 50 generates as many child individuals (GA recommended points) as the number of GA recommendations from the parent individual by crossover and mutation (step S43).
The output unit 70 outputs a result of the processing of
According to the present embodiment, the number of DA set recommendations and the number of GA set recommendations are determined according to the accuracy of an FM model generated from a learning data group. Accordingly, both high accuracy for obtaining a good solution and reduction in the number of times of sampling may be achieved.
For example, in a case where the accuracy of an FM model generated from a learning data group is low, there is a possibility that the accuracy of searching for a good solution in DA is low. Accordingly, the number of GA recommendations is increased without performing DA recommendation. By using GA, it is possible to treat learning data as a population and generate recommended points by using GA processing. Accordingly, a region in which an evaluation value is likely to be good may be sampled in a wide range. In this case, since DA recommendation with low accuracy is not performed, as a result, a good solution may be obtained with high accuracy with a small number of times of sampling.
For example, in a case where the accuracy of an FM model generated from a learning data group is high, a good solution in an FM model may be generated by DA as a recommended point. In this case, a region in which an evaluation value is high may be actively sampled. Accordingly, the number of times of sampling for obtaining a good solution may be reduced.
From the above, according to the present embodiment, both high accuracy for obtaining a good solution and reduction in the number of times of sampling may be achieved.
In the present embodiment, a plurality of objective functions is added by a linear weighted sum. At a stage where a solution search by FMDA and GA proceeds, the weight of the linear weighted sum is dynamically changed. By doing so, the plurality of objective functions may be optimized while reducing the number of times of sampling.
In step S42, as many parent individuals as the number of GA recommendations are selected from all learning data groups by using a multi-objective GA method. Accordingly, since all pieces of learning data are treated as a population, GA recommended points may be generated by using multi-objective GA processing (selection of multipurpose GA, crossover, and mutation).
By using a D-optimal design in step S11, initial points may be generated in a wide range in an analysis space. Accordingly, search omission of an optimal solution may be reduced.
The accuracy of modeling used for sampling may be improved by updating a learning data group according to the evaluation value of each piece of learning data included in the learning data group when the number of pieces of data in the learning data group exceeds an upper limit number.
Hereinafter, description will be given for a simulation result obtained by setting a virtual problem and performing operation processing according to the above embodiment.
The tables in
This arrangement problem may be expressed as shape function y as in the following formula. si, zi∈{0, 1} and wi∈{−1, 0, 1}. In this way, an optimization problem of magnetic shield is treated as an arrangement problem of positive and negative Gaussian basis functions.
The distribution of shape function y is as illustrated in the upper diagram of
An object of magnetic shield shape optimization is to minimize magnitude BaveT of an average magnetic flux density and magnetic body area Smag in a target region. For example, the object is minimization of the following first objective function F1 and second objective function F2. Post-conversion objective function E=αF1+(1−α)F2.
For this optimization problem, sampling has been performed by two methods of the method according to a comparative example and the method of the above embodiment. In the comparative example, learning data is expressed by a single-objective function instead of a linear weighted sum of a plurality of objective functions. Although a D-optimal design has not been implemented in the method of the above embodiment, other methods are the method of the above embodiment. As common settings, the number of initial points is 192, the number of times of iteration is 384, and the number of DA set recommendations is 1. The number of GA set recommendations is 3, the crossover probability is 0.9, the mutation probability is 0.1, threshold δ is 0.99, and the upper limit number of pieces of learning data is 400. In the comparative example, α=0.5 is fixed. In the method of the above embodiment, the magnitude of a is changed randomly between 0 and 1 at each time of iteration.
Hyper volume (HV) will be described.
Although a D-optimal design is not implemented in the simulation for the method of the above embodiment, since initial points may be generated in a wide range in an analysis space by implementing a D-optimal design, Pareto solutions further spread.
In the above example, the number of DA set recommendations is an example of a first set number, a DA recommended point is an example of a first recommended point, the number of GA set recommendations is an example of a second set number, and a GA recommended point is an example of a second recommended point. The FMDA execution unit 40 and the GA execution unit are examples of an execution unit that executes processing of expressing each piece of learning data of a learning data group as an objective variable obtained by a linear weighted sum of a plurality of objective functions, and changing a weight of the linear weighted sum every time operation processing is executed. The initial point generation unit 20 is an example of an initial point generation unit that searches for matrix X satisfying a predetermined condition by repeating processing of randomly creating matrix X in which the number of initial points and a variable are expressed by the value of 0 or 1 and calculating D=|XTX| for matrix X, and generates an initial point of each piece of learning data of a learning data group using each value expressed by the searched matrix X. The learning data update unit 60 is an example of an update unit that updates a learning data group according to the evaluation value of each piece of learning data when the number of pieces of learning data in the learning data group exceeds an upper limit.
Although the embodiment of the present disclosure has been described in detail above, the present disclosure is not limited to such particular embodiment and may be variously modified and changed within the scope of the gist of the present disclosure described in claims.
All examples and conditional language provided herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
| Number | Date | Country | Kind |
|---|---|---|---|
| 2023-114576 | Jul 2023 | JP | national |