This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2023-112457, filed on Jul. 7, 2023, the entire contents of which are incorporated herein by reference.
The embodiments discussed herein are related to a temperature adjustment program, a data processing apparatus, and a data processing method.
When searching for a solution to a combinatorial optimization problem, there is a method of converting the combinatorial optimization problem into an Ising model representing a behavior of a spin of a magnetic substance. The Ising model is represented by an Ising-type evaluation function for evaluating the solution to the combinatorial optimization problem. The Ising-type evaluation function includes a plurality of state variables and a plurality of weight values. A state of the Ising model is represented by values of the plurality of state variables. In the Ising-type evaluation function, a state variable is a binary variable having a value of 0 or 1 (or −1 or +1). The state variable may be denoted by a bit. The value of the Ising-type evaluation function may also be referred to as energy of the Ising model.
Japanese Laid-open Patent Publication No. 2022-94510 and Japanese Laid-open Patent Publication No. 2020-46718 are disclosed as related art.
According to an aspect of the embodiments, a non-transitory computer-readable recording medium stores a temperature adjustment program for causing a computer to execute a process including: acquiring an average value of values of an evaluation function obtained in a search processing by a replica circuit in which a first temperature value higher than a minimum temperature value by n (n is an integer of 1 or more) is set, among a plurality of replica circuits in which a plurality of temperature values different from each other are set during the search processing a plurality of times from the search processing that performs the search processing of a solution to a combinatorial optimization problem by a replica exchange method by using the plurality of replica circuits that correspond to a plurality of replicas of the evaluation function based on an Ising model obtained by converting the combinatorial optimization problem; changing the first temperature value based on a comparison result between a first average value among the average values acquired the plurality of times and a second average value acquired before the first average value; newly determining the plurality of temperature values by, while fixing a maximum temperature value and the changed first temperature value among the plurality of temperature values, changing other temperature values that include the minimum temperature value based on the maximum temperature value and the changed first temperature value; and setting the plurality of determined temperature values.
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.
A Markov-chain Monte Carlo (MCMC) method is used in the search for a solution. Hereinafter, the search for the solution by the MCMC method is referred to as MCMC processing. For example, in the MCMC processing, a state transition is accepted with an acceptance probability of the state transition defined by a Metropolis method or a Gibbs method. At this time, the state transition that increases the value of the evaluation function is also stochastically permitted. As the increase amount of the value of the evaluation function is larger, the acceptance probability is lower.
As one type of the MCMC method, there is a replica exchange method (also referred to as a parallel tempering method or the like). According to the replica exchange method, the MCMC processing using a plurality of temperature values is performed independently of each other by a plurality of replicas of the evaluation function based on the Ising model. For each certain number of trials, the values of the evaluation function obtained in each MCMC processing are compared with each other, and states for the two temperature values are exchanged with an appropriate exchange probability. Compared with a simulated annealing method in which the temperature value is gradually decreased, the replica exchange method reduces a possibility of being constrained to a local solution and enables an efficient search of the entire solution space.
Heretofore, there has been a method in which a minimum temperature value (hereafter, may also be referred to as a minimum temperature) and a maximum temperature value (hereafter, may also be referred to as a maximum temperature) among a plurality of temperature values in the replica exchange method are determined from information on a resolution of a value of an evaluation function.
At the time of solving the combinatorial optimization problem by using the replica exchange method, in a case where a minimum temperature is not appropriately set, a time until a solution is obtained may be very long. For example, it is because, when the minimum temperature is too low, state transition accompanied by the increase in a value of an evaluation function hardly occurs, and once a local solution is obtained, there is a possibility that it may not be possible to escape from the local solution.
However, to determine an appropriate minimum temperature, a procedure of performing solution search processing by using a certain minimum temperature and adjusting the minimum temperature based on a result of the solution search processing is repeated. For this reason, there is a problem that it takes time to adjust the minimum temperature.
In one aspect, an object of the present disclosure is to provide a temperature adjustment program, a data processing apparatus, and a data processing method capable of shortening an adjustment time of a minimum temperature used in a replica exchange method.
Hereinafter, embodiments of the present disclosure will be described with reference to the drawings.
A data processing apparatus 10 includes a storage unit 11, a search unit 12, and a processing unit 13.
For example, the storage unit 11 is a volatile storage apparatus that is an electronic circuit such as a dynamic random-access memory (DRAM) or a non-volatile storage apparatus that is an electronic circuit such as a hard disk drive (HDD) or a flash memory. The storage unit 11 may include an electronic circuit such as a static random-access memory (SRAM) register.
For example, the storage unit 11 stores information on a combinatorial optimization problem to be calculated, calculation conditions, and the like. Various programs such as a temperature adjustment program may be stored in the storage unit 11.
For example, the search unit 12 may be implemented by using an electronic circuit such as an application-specific integrated circuit (ASIC) or a field-programmable gate array (FPGA). The search unit 12 may be implemented by software processing in which a processor that is hardware such as a central processing unit (CPU), a graphics processing unit (GPU), or a digital signal processor (DSP) executes a program.
The search unit 12 uses replica circuits 12a0, . . . , 12an, . . . , and 12aN corresponding to (N+1) replicas of an evaluation function based on an Ising model obtained by converting a combinatorial optimization problem to be calculated, and searches for a solution to the combinatorial optimization problem by a replica exchange method.
For example, the evaluation function based on the Ising model is defined by Expression (1) below.
A first term on a right side is a sum obtained by adding up products of values of two state variables and a weight coefficient without missing and overlapping for all combinations of the two state variables selectable from all state variables included in the Ising model. xi is an i-th state variable. xj is a j-th state variable. Wij is a weight coefficient indicating a weight (for example, strength of coupling) between the i-th state variable and the j-th state variable. M is a total number of state variables.
A second term on the right side is a total sum of products of a bias coefficient of each of all the state variables and a value of the state variable. bi indicates a bias coefficient for the i-th state variable.
For example, “−1” of a spin in the Ising model corresponds to a value “0” of the state variable. “+1” of a spin in the Ising model corresponds to a value “1” of the state variable. Therefore, the state variable may also be referred to as a bit taking a value of 0 or 1.
A state when a minimum value among local minimum values of E(x) is obtained is an optimum solution. By changing a sign of each term on the right side of Expression (1), the search unit 12 may search for a state in which a value of E(x) is locally maximized (in this case, the state when the value of E(x) is the maximum value is the optimum solution). Hereinafter, the value of the evaluation function may also be referred to as energy.
Each of the replica circuits 12a0 to 12aN in which a plurality of temperature values different from each other are set repeats MCMC processing. For example, the MCMC processing includes processing of determining whether to permit a change of any bit of a plurality of bits, based on a comparison result between a change amount of the value of the evaluation function when a value of the bit is changed and a thermal noise value. The MCMC processing includes processing of causing, in a case where it is determined that the change in the value of a certain bit is permitted, a state transition by changing the value of the bit. Hereinafter, changing the value of the bit is referred to as a flip. The thermal noise value is obtained based on a temperature value and a random number value set for each of the replica circuits 12a0 to 12aN. As the temperature value increases, an amplitude of the thermal noise value increases.
The search unit 12 includes a temperature control unit 12b and an average energy calculation unit 12c.
The temperature control unit 12b sets (N+1) temperature values different from each other, which are obtained by the processing unit 13, for the replica circuits 12a0 to 12aN.
In the example illustrated in
The temperature control unit 12b controls replica exchange in replica circuits 21a0 to 21aN. Based on an exchange probability (pij) represented by Expression (2) below, the temperature control unit 12b determines whether to perform replica exchange for each pair of replica circuits having adjacent temperature values.
In Expression (2), Ei is energy corresponding to a state of a replica (hereafter, referred to as a replica i) corresponding to an i-th replica circuit among the replica circuits 12a0 to 12aN. Ej is energy corresponding to a state of a replica (hereafter, referred to as a replica j) corresponding to a j-th replica circuit. Ti is a temperature value set for the i-th replica circuit. Tj is a temperature value set for the j-th replica circuit. k is a Boltzmann constant. States of the replicas i and j are represented by M state variables x1 to xM.
With the probability of pij described above, the temperature control unit 12b causes the state of the replica i and the state of the replica j to be exchanged.
Instead of exchanging the states between the replicas i and j, the temperature control unit 12b may exchange Ti and Tj with the probability of pij described above.
The average energy calculation unit 12c calculates an average value (hereafter, referred to as average energy) of values of the above-described evaluation function (E (x)) obtained in the search processing by the replica circuit 12an in which the temperature value (Tn) higher than the minimum temperature by n is set. n is an integer equal to or greater than 1. Although not particularly limited, for example, n may be a value of about 10% of the number of replicas N+1. An upper limit of Tn is TN−1. Accordingly, the upper limit of n is the number of replicas minus 2.
For example, the average energy calculation unit 12c updates average energy every time the replica circuit 12an flips any value of x1 to XM.
For example, the processing unit 13 may be implemented by software processing in which a processor that is hardware such as a CPU, a GPU, or a DSP executes a program such as the temperature adjustment program stored in the storage unit 11. The processing unit 13 may be implemented by using an electronic circuit such as an ASIC or an FPGA.
The processing unit 13 has a function of adjusting a plurality of temperature values that are different from each other used for solution search by the replica exchange method.
Step S10: The processing unit 13 determines whether it is an adjustment cycle of a temperature value. For example, the processing unit 13 determines that it is an adjustment cycle of a temperature value every time replica exchange is performed a predetermined number of times in the search unit 12. By increasing the number of times of replica exchange serving as the adjustment cycle, adjustment may be performed in consideration of a wider search space, but an adjustment frequency decreases. For this reason, the adjustment cycle may be appropriately set in accordance with a difficulty level of the combinatorial optimization problem to be calculated, or the like.
Every time the MCMC processing is performed a predetermined number of times in the search unit 12, the processing unit 13 may determine that it is the adjustment cycle of the temperature value.
When the processing unit 13 determines that it is the adjustment cycle of the temperature value, the processing unit 13 performs processing in step S11. When the processing unit 13 determines that it is not the adjustment cycle of the temperature value, the processing unit 13 repeats the processing in step S10.
Step S11: The processing unit 13 acquires average energy from the search unit 12. The processing unit 13 holds the acquired average energy.
Step S12: The processing unit 13 compares average energy acquired last time with the average energy acquired this time.
Step S13: Based on the comparison result obtained in the processing of step S12, the processing unit 13 changes Tn. For example, the processing unit 13 changes Tn as follows.
First, for example, the processing unit 13 divides a range between an initial value of Tn input from a user and a maximum temperature determined in advance by a predetermined division number, and calculates a plurality of candidate values of Tn that have a plurality of steps of magnitude based on the division number. When the average energy acquired this time is equal to or smaller than the average energy acquired last time, the processing unit 13 changes Tn to a candidate value larger than the current Tn by one step. When the average energy acquired this time is larger than the average energy acquired last time, the processing unit 13 changes Tn to a candidate value smaller than the current Tn by one step.
Step S14: The processing unit 13 newly determines T0 to TN by, while fixing a maximum temperature value (TN) and the changed Tn among T0 to TN, changing other temperature values that include T0 based on TN and the changed Tn.
For example, to cause replica exchange to occur with the same frequency at any temperature value, a range between T0 and TN may be divided by a ratio of an exponential function. In this case, a temperature value (Tm) other than Tn and TN is given by Expression (3) below.
In Expression (3), T0 is given by Expression (4) below.
As in Expression (4), T0 is changed in accordance with TN and Tn.
A method of dividing the range between T0 and TN is not limited to the above-described example. When there is a more appropriate division method (for example, linear division or the like) from the problem information of the combinatorial optimization problem, the division method may be applied.
Step S15: The processing unit 13 sets the determined T0 to TN for the search unit 12.
With the above, one-time adjustment processing of the temperature value ends. Such adjustment processing is repeated until an end condition of the solution search processing is satisfied.
As described above, in the data processing apparatus 10, the search unit 12 uses the replica circuits 12a0 to 12aN corresponding to a plurality of replicas of an evaluation function based on an Ising model obtained by converting a combinatorial optimization problem, and performs search processing for a solution to the combinatorial optimization problem by the replica exchange method. During the search processing, the processing unit 13 acquires, from the search unit 12, average energy obtained in the search processing by the replica circuit 12an, in which a temperature value (Tn) higher than T0 by n (n is an integer of 1 or more) is set, among the replica circuits 12a0 to 12aN, a plurality of times. Based on a result of comparison between first average energy among average energies acquired the plurality of times and second average energy acquired before the first average energy, the processing unit 13 changes Tn. The processing unit 13 newly determines T0 to TN by, while fixing the maximum temperature value (TN) and the changed Tn among T0 to TN, changing other temperature values that include T0 based on TN and the changed Tn. The processing unit 13 sets the determined T0 to TN for the search unit 12.
To determine an appropriate T0, in a case where a procedure of performing solution search processing using a certain T0 and adjusting T0 based on the result of the search processing is repeated, it takes time to adjust T0. By contrast, in the data processing apparatus 10 according to the first embodiment, average energy to be used to determine new temperature values may be obtained during the solution search processing. For this reason, it is possible to determine new temperature values including T0 during the solution search processing based on the average energy acquired a plurality of times. For example, since it is possible to adjust the temperature values including T0 during the search processing without waiting for the end of the search processing, it is possible to shorten the adjustment time of T0.
Constraint of a solution to a local solution by replica exchange is suppressed. Thus, by setting an adjustment cycle to a predetermined number of times of replica exchange, it is possible to appropriately adjust T0 in consideration of a wide search space.
A reason why the temperature values including T0 are adjusted based on the average energy obtained in the search processing by the replica circuit 12an in which Tn is set will be described.
The manner in which the average energy of the minimum temperature replica changes with respect to T0 is similar to that of the minimum energy. For this reason, there is a possibility that the adjustment of the optimum T0 for obtaining smaller minimum energy may be performed based on the average energy of the minimum temperature replica. However, as a result of experiments, it has been found that, in the case of the method of adjusting T0 based on the average energy of the minimum temperature replica, an initial value of T0 takes a value closer to the optimum T0 than T0 after adjustment, depending on the combinatorial optimization problem.
In the example illustrated in
As described above, even when Tn is adjusted to a value higher than the optimum T0, (n−1) temperature values on the lower temperature side than Tn are set in (n−1) replica circuits, and search processing in the vicinity of the optimum T0 is performed.
It may be expected that the data processing apparatus 10 as described above is useful as means for obtaining an accurate solution in a short period of time when solving various problems in modern society which may be converted into a combinatorial optimization problem.
A data processing apparatus 20 according to the second embodiment includes a search unit 21, a temperature adjustment unit 22, and an overall control unit 23. The search unit 21 is an example of the search unit 12 illustrated in
For example, the search unit 21 may be implemented by using an electronic circuit such as an ASIC or an FPGA. For example, the temperature adjustment unit 22 and the overall control unit 23 may be implemented by software processing in which a processor such as a CPU executes a program. The implementation is not limited to this, and a part or entirety of each of the search unit 21, the temperature adjustment unit 22, and the overall control unit 23 may be implemented by using the electronic circuit as described above. A part or entirety of each of the search unit 21, the temperature adjustment unit 22, and the overall control unit 23 may be implemented by software processing.
In the data processing apparatus 20 according to the second embodiment, the search unit 21 searches for a solution to a combinatorial optimization problem by a replica exchange method in which states are exchanged between replicas.
For example, as illustrated in
Temperature values (T0 to TN) different from each other are set for the replica circuits 21a0 to 21aN. T0 is set for the replica circuit 21a0, T1 is set for the replica circuit 21a1, Tn is set for the replica circuit 21an, and TN is set for the replica circuit 21aN. T0<T1< . . . <Tn< . . . <TN holds. For this reason, a replica corresponding to the replica circuit 21a0 is a minimum temperature replica. Hereinafter, a replica corresponding to the replica circuit 21an is referred to as a replica n.
As an initial value of Tn, for example, a value input by the user may be used.
TN, which is a maximum temperature, is calculated in advance. For example, the temperature adjustment unit 22 of the data processing apparatus 20 may calculate TN in advance by the following method.
First, in a state where each temperature value from T0 to TN is fixed, the search unit 21 performs the MCMC processing a predetermined number of times using replica exchange. The temperature adjustment unit 22 acquires a state (hereafter, referred to as a local solution) corresponding to minimum energy obtained in each of the replica circuits 21a0 to 21aN. From the plurality of acquired local solutions, the temperature adjustment unit 22 selects two local solutions in ascending order of energy, for example. The temperature adjustment unit 22 calculates a change amount (ΔE) of a value of an evaluation function caused in a case where one value of a plurality of bits different from a bit string of another local solution among bit strings of one selected local solution is changed. This calculation processing is sequentially performed for each of the plurality of bits. In a case where an increase in energy occurs continuously a plurality of times, the temperature adjustment unit 22 calculates a total value of the energies increased in the plurality of times. Based on the total value, the temperature adjustment unit 22 calculates a maximum temperature (Tmax) by, for example, Expression (5) below.
As described above, in a case where an increase in energy occurs continuously a plurality of times, Dsum is a total value of energies increased in the plurality of times. A is a parameter indicating a transition probability of accepting a state transition that causes a maximum energy increase, and is set in advance.
Even in a case where there is a large peak of energy that may not be crossed unless a plurality of continuous energy increases occur between the two local solutions, the use of Tmax described above as TN allows crossing of such an energy peak with a relatively high probability.
Initial values of temperature values other than Tn and TN may be obtained from Expressions (3) and (4) described above.
Each of the replica circuits 21a0 to 21aN implements the solution search based on the evaluation function represented by Expression (1) by, for example, a circuit as illustrated in
The replica circuit 21an corresponding to the replica n includes bit flip availability determination units 30a1, 30a2, . . . , and 30aM, a selector unit 30b, a holding unit 30c, and an average energy calculation unit 30d.
Processing of determining availability of flipping each bit included in the state of the replica n and flipping any bit determined to be flippable corresponds to one-time processing of the MCMC processing by the replica circuit 21an. The one-time processing is repeatedly executed.
Each of the bit flip availability determination units 30a1 to 30aM is, for example, an arithmetic processing circuit that determines availability of flipping related to one bit handled thereby. The bit flip availability determination units 30a1 to 30aM may perform the above-described determination processing in parallel.
When a value of a bit (state variable xi) with index=i changes to 1−xi, a change amount of xi is represented as δxi=(1−xi)−xi=1−2xi. Accordingly, a change amount (ΔEi) of the value of the evaluation function accompanied by the change in the value of xi may be represented by Expression (6) below from Expression (1).
In Expression (6), hi is referred to as a local field and may be represented by Expression (7) below.
Each of the bit flip availability determination units 30a1 to 30aM holds hi for xi, and obtains, from hi, ΔEi in a case where the value of xi is changed, based on Expression (6).
Hereinafter, the bit flip availability determination unit 30a1 will be mainly described as an example. The bit flip availability determination units 30a2 to 30aM that are configurations with the same name have the same function.
The bit handled by the bit flip availability determination unit 30a1 is referred to as an own bit, and the bits handled by the bit flip availability determination units 30a2 to 30aM are referred to as other bits.
The bit flip availability determination unit 30a1 stores weight coefficients (Wij (j=1 to N)) between the own bit and the other bits. A subscript “j” of Wij indicates an index of one of the bits including the own bit (bit with index=1). W11=0.
The bit flip availability determination unit 30a1 uses Wij to calculate h1 based on Expression (7).
By using h1, the bit flip availability determination unit 30a1 generates ΔE1 caused in a case where the own bit is flipped, based on Expression (6). For example, the bit flip availability determination unit 30a1 may determine whether the value of the own bit changes to 0 or 1 from a current value of the own bit supplied from the holding unit 30c. The bit flip availability determination unit 30a1 outputs the generated ΔE1 to the selector unit 30b.
The bit flip availability determination unit 30a1 determines availability of flipping the own bit, based on a comparison result between ΔE1 and a thermal noise value. As the thermal noise value, for example, Tn·log (u) may be used. Tn is a temperature value set for the replica circuit 21an, and u is a uniform random number taking a value from 0 to 1. The bit flip availability determination unit 30a1 permits the flip when, for example, −ΔE1≥Tn·log (u).
The selector unit 30b receives the determination result of the flip availability output by each of the bit flip availability determination units 30a1 to 30aM. When there are a plurality of bits determined to be flippable, the selector unit 30b selects one of the plurality of bits randomly or according to a predetermined rule. When there is a bit determined to be flippable, the selector unit 30b outputs an index of the selected bit, an instruction signal for instructing flipping, and the change amount (ΔE) of the value of the evaluation function in a case where the bit is flipped. The index, the instruction signal, and ΔE are supplied to the holding unit 30c. The index is further supplied to each of the bit flip availability determination units 30a1 to 30aM.
For example, the holding unit 30c has a register and holds the state of the replica n and ΔE output by the selector unit 30b. In a case where the holding unit 30c receives an instruction signal for instructing flipping, the holding unit 30c flips the bit designated by the index output by the selector unit 30b. The holding unit 30c outputs the state of the replica n when the search processing in the replica circuit 21an is completed a predetermined number of times or for a predetermined period to the temperature adjustment unit 22 and the overall control unit 23.
The average energy calculation unit 30d calculates average energy (Eave) of the replica n. Eave is supplied to the temperature adjustment unit 22. For example, the average energy calculation unit 30d holds an initial value of the evaluation function represented by Expression (1), and updates Eave by using ΔE output by the selector unit 30b and held by the holding unit 30c every time the MCMC processing is repeated. In a case where none of the bits are determined to be flippable, ΔE=0.
Although the replica circuits corresponding to the other replicas may also be implemented by a circuit configuration similar to that of the replica circuit 21an, those replica circuits may not include the average energy calculation unit 30d.
The temperature control unit 21b sets T0 to TN obtained by the temperature adjustment unit 22 in the bit flip availability determination units 30a1 to 30aM included in each of the replica circuits 21a0 to 21aN. The temperature control unit 21b controls the exchange of the states (X0 to XN) of each of the replicas in the replica circuits 21a0 to 21aN. Based on the exchange probability (pij) represented by Expression (2) described above, the temperature control unit 21b determines, on a pair-by-pair basis, whether to exchange states for a pair of replica circuits having adjacent temperature values.
T0 obtain Ei and Ej of Expression (2), the temperature control unit 21b holds, for example, an initial value of an evaluation function of each replica, and updates the value of the evaluation function of each replica based on ΔE held in the holding units 30c of the replica circuits 21a0 to 21aN. Each of the replica circuits 21a0 to 21aN may have an energy calculation unit that calculates an evaluation function (energy) of a replica for which the replica circuit itself is responsible for processing.
When exchanging the states of the replica i and the replica j, the temperature control unit 21b sets Xi, which is the state of the replica i, in the replica circuit corresponding to the replica j, and sets Xj, which is the state of the replica j, in the replica circuit corresponding to the replica i.
Every time replica exchange is performed b times, the temperature adjustment unit 22 acquires Eave, which is the average energy of the replica n, and adjusts Tn based on a comparison result between Eave and eave, old, which is Eave acquired last time. An example of the temperature adjustment unit 22 will be described later.
The overall control unit 23 controls overall operations of the data processing apparatus 20. Upon receiving input of an activation signal from an outside of the data processing apparatus 20, the overall control unit 23 outputs the activation signal to the temperature control unit 21b, activates the search unit 21, and starts search processing for a solution to a combinatorial optimization problem. When the search processing by the search unit 21 ends, the overall control unit 23 acquires X0 to XM from the search unit 21 and obtains the solution for the combinatorial optimization problem.
For example, the overall control unit 23 sets, as a solution, a state in which the value of the evaluation function is the minimum among the acquired X0 to XM. The overall control unit 23 outputs an end signal indicating an end of the arithmetic operation to the outside of the data processing apparatus 20. The end signal may include information indicating the solution obtained by the arithmetic operation. For example, the overall control unit 23 may output image information indicating the solution to a display apparatus (not illustrated) coupled to the data processing apparatus 20 and causes the display apparatus to display the image information indicating the solution to present details of the obtained solution to the user.
The overall control unit 23 may receive problem information (Wij or bi) described above stored in a storage unit (not illustrated), an initial value of the state, and the like, and may set them in each unit of the search unit 21. The setting of these pieces of information may be performed by another control unit. Upon receiving input of a reset signal from the outside of the data processing apparatus 20, the overall control unit 23 clears information held by the search unit 21 and the temperature adjustment unit 22.
The temperature adjustment unit 22 includes a parameter acquisition unit 40, an average energy acquisition unit 41, an average energy holding unit 42, a comparison unit 43, a Tn adjustment unit 44, a temperature value dividing unit 45, and a temperature value setting unit 46.
The parameter acquisition unit 40 acquires, for example, a number n of redundant replica circuits, a division number a, an adjustment cycle b, and an initial value (Tn, 0) of Tn input from the user. The redundant replica circuits are n replica circuits in which temperature values of T0 to T(n−1) on a lower temperature side than Tn among T0 to TN are set. The division number a is a division number, of the range between Tn, 0 and TN(=maximum temperature), for determining “a” candidate values of Tn. A lower limit of the “a” candidate values of Tn is Tn, 0, and an upper limit is a candidate value of a division point that is one immediately below TN. The adjustment cycle b is represented by the number of times of replica exchange. For example, every time the replica exchange is performed b times, adjustment of Tn is performed.
Every time the replica exchange is performed b times, the average energy acquisition unit 41 acquires Eave, which is average energy of the replica n. For example, the average energy acquisition unit 41 acquires information indicating whether the replica exchange has been performed from the temperature control unit 21b.
The average energy holding unit 42 holds Eave acquired by the average energy acquisition unit 41 as eave, old.
The comparison unit 43 outputs a comparison result between Eave acquired this time and eave, old, which is Eave acquired last time, held in the average energy holding unit 42.
Based on the above-described comparison result, the Tn adjustment unit 44 adjusts Tn. At the time of initialization, the Tn adjustment unit 44 divides the range between Tn, 0 and TN to calculate the “a” candidate values described above. When Eave≤eave, old, the Tn adjustment unit 44 changes Tn to a candidate value larger than the current Tn by one step among the “a” candidate values. When Eave>eave, old, the Tn adjustment unit 44 changes Tn to a candidate value smaller than the current Tn by one step among the “a” candidate values.
However, when Eave≤eave, old, the Tn adjustment unit 44 does not change Tn in a case where the current Tn is a candidate value closest to TN (maximum temperature), for example, the upper limit of the “a” candidate values. When Eave>eave, old, the Tn adjustment unit 44 does not change Tn in a case where the current Tn is Tn, 0, for example, the lower limit of the “a” candidate values.
According to the above-described adjustment method, adjustment may be performed with a small number of parameters, but the adjustment method is not limited to the above-described adjustment method. For example, after the Tn adjustment unit 44 changes Tn to the candidate value smaller than the current candidate value by one step, in a case where Eave>eave, old also holds for Eave acquired next, the Tn adjustment unit 44 may change Tn to a candidate value larger than the current candidate value by one step. This is because a state of lower energy may be obtained by increasing Tn.
The Tn adjustment unit 44 may set the initial value of Tn as the upper limit among the “a” candidate values.
When Tn is changed, the temperature value dividing unit 45 determines T0 to TN by dividing the range between T0 and TN to include the maximum temperature value (TN). The temperature value dividing unit 45 calculates (changes) temperature values other than Tn and TN based on, for example, Expressions (3) and (4) described above.
The temperature value setting unit 46 sets the determined T0 to TN in the search unit 21.
For example, the following processing is performed under the control of the overall control unit 23.
As parameters for adjusting the temperature value, the temperature adjustment unit 22 acquires the number n of redundant replica circuits, the division number a, the adjustment cycle b, and Tn, 0 (step S20).
At the time of initialization, the temperature adjustment unit 22 divides the range between Tn, 0 and TN to calculate the “a” candidate values described above (step S21). Hereinafter, the “a” candidate values are assumed to be T′0, T′1, . . . , and T′(a-1).
The temperature adjustment unit 22 sets i=0 and Tn=T′0 (step S22). The temperature adjustment unit 22 initializes j indicating the number of times of replica exchange to j=1 (step S23).
After that, the MCMC processing is performed in the search unit 21 (step S24). Accordingly, the state of each replica is updated in accordance with the acceptance probability of a predetermined state transition. Replica exchange is performed in the search unit 21 (step S25).
The temperature adjustment unit 22 sets j=j+1 (step S26). The temperature adjustment unit 22 determines whether j≤b+1 holds (step S27). When it is determined that j≤b+1 does not hold, the processing from step S24 is repeated.
When it is determined that j≤b+1 holds, the temperature adjustment unit 22 acquires Eave, which is the average energy of the replica n, from the search unit 21 (step S28).
The temperature adjustment unit 22 determines whether there is eave, old in the average energy holding unit 42 (step S29).
When it is determined that there is no eave, old in the average energy holding unit 42, the temperature adjustment unit 22 causes the average energy holding unit 42 to hold the currently acquired Eave as eave, old (step S30). After the processing of step S30, processing from step S23 is repeated.
When it is determined that there is eave, old in the average energy holding unit 42, the temperature adjustment unit 22 determines whether Eave≤eave, old holds (step S31).
When it is determined that Eave≤eave, old does not hold, the temperature adjustment unit 22 changes Tn to Tn=T′i-1 (step S32). T′i-1 is a candidate value that is smaller than T′i, which is the current candidate value, by one step among the “a” candidate values. When T′i=Tn, 0, Tn is not changed.
When it is determined that Eave≤eave, old holds, the temperature adjustment unit 22 changes Tn to Tn=T′i+1 (step S33). T′i+1 is a candidate value that is larger than T′i, which is the current candidate value, by one step among the “a” candidate values. When T′i is the upper limit of the candidate values, Tn is not changed.
After the processing of steps S32 and S33 described above, as described above, the temperature adjustment unit 22 determines T0 to TN obtained by dividing the ranges between T0 and TN (step S34). In the processing of step S34, the temperature adjustment unit 22 sets the determined T0 to TN in the search unit 21.
The temperature adjustment unit 22 causes the average energy holding unit 42 to hold Eave acquired this time as eave, old (step S35).
After that, for example, the overall control unit 23 determines whether a predetermined end condition is satisfied (step S36). For example, when the number of times of MCMC processing reaches a predetermined number of times, the overall control unit 23 determines that the end condition is satisfied. Although not illustrated, for example, in a case where it is determined that the end condition is satisfied, the overall control unit 23 acquires X0 to XN from the search unit 21, outputs a state in which the value of the evaluation function is the minimum among X0 to XN as a solution, and ends the search processing.
When the overall control unit 23 determines that the predetermined end condition is not satisfied, the processing from step S23 is repeated.
The order of the processing described above is an example, and the order may be appropriately changed.
The data processing apparatus 20 according to the second embodiment described above also provides similar effects to those of the data processing apparatus 10 according to the first embodiment. For example, by determining a new temperature value including the minimum temperature based on Eave acquired a plurality of times during the solution search processing, it is possible to shorten the adjustment time of the minimum temperature. The constraint of the solution to the local solution by the replica exchange is suppressed. Thus, by setting the adjustment cycle to the predetermined number of times of replica exchange, it is possible to appropriately adjust the minimum temperature in consideration of a wide search space.
The data processing apparatus 20 according to the second embodiment adjusts Tn based on Eave obtained in the search processing by the replica circuit 21an in which Tn is set, and determines temperature values including T0 based on the adjustment result. Accordingly, even when Tn is adjusted to a value higher than the optimum minimum temperature, (n−1) temperature values on the lower temperature side than Tn are set in (n−1) replica circuits, and search processing in the vicinity of the optimum minimum temperature may be performed.
Although the search unit 21 exchanges states between replicas in the replica exchange in the data processing apparatus 20 according to the second embodiment described above, temperature values may be exchanged between the replicas. In this case, the temperature values set for the replica circuits 21a0 to 21aN corresponding to the replicas 0 to N are not fixed. For this reason, the replica circuit that performs the processing of the replica n is not fixed to the replica circuit 21an. Accordingly, the average energy calculation unit 30d, that calculates the average energy (Eave) of the replica n, may be provided in the temperature control unit 21b instead of the replica circuits 21a0 to 21aN.
By exchanging temperature values instead of exchanging states between replicas, an amount of data to be moved at the time of replica exchange may be reduced.
Even in a case where states are exchanged between replicas in the replica exchange, the average energy calculation unit 30d as described above may be provided in the temperature control unit 21b. The average energy calculation unit 30d may be provided in the overall control unit 23, or may be provided independently of the replica circuits 21a0 to 21aN, the temperature control unit 21b, the overall control unit 23, and the like.
As illustrated in
Details of the above-described processing (for example,
The program may be recorded on a computer-readable recording medium. As the recording medium, for example, a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like may be used. Examples of the magnetic disk include a flexible disk (FD) and an HDD. Examples of the optical disk include a compact disc (CD), a CD-recordable (R)/rewritable (RW), a Digital Versatile Disc (DVD), and a DVD-R/RW. The program may be recorded on a portable-type recording medium and distributed. In such a case, the program may be copied from the portable-type recording medium to another recording medium and executed.
A computer 50 includes a processor 51, a RAM 52, an HDD 53, a GPU 54, an input interface 55, a medium reader 56, and a communication interface 57. The units described above are coupled to a bus.
For example, the processor 51 may function as the search unit 12 and the processing unit 13 in
For example, the RAM 52 functions as the storage unit 11 illustrated in
The HDD 53 is a non-volatile storage apparatus that stores a software program such as an operating system (OS), middleware, or application software, and data. Examples of the program include a program for causing the computer 50 to execute the processing of searching for the solution to the combinatorial optimization problem and the adjustment processing of the temperature value as described above. The computer 50 may include another type of a storage apparatus such as a flash memory or a solid-state drive (SSD) and may include a plurality of non-volatile storage apparatuses.
According to an instruction from the processor 51, the GPU 54 outputs an image (for example, an image representing a search result or the like of the solution to the combinatorial optimization problem) to a display 54a coupled to the computer 50. As the display 54a, a cathode ray tube (CRT) display, a liquid crystal display (LCD), a plasma display panel (PDP), an organic electro-luminescence (OEL) display, or the like may be used.
The input interface 55 acquires an input signal from an input device 55a coupled to the computer 50 and outputs the input signal to the processor 51. As the input device 55a, a pointing device such as a mouse, a touch panel, a touch pad, or a trackball, a keyboard, a remote controller, a button switch, or the like may be used. A plurality of types of input devices may be coupled to the computer 50.
The medium reader 56 is a reading apparatus that reads a program or data recorded on a recording medium 56a. As the recording medium 56a, for example, a magnetic disk, an optical disk, a magneto-optical (MO) disk, a semiconductor memory, or the like may be used. Examples of the magnetic disk include an FD and an HDD. Examples of the optical disk include a CD and a DVD.
For example, the medium reader 56 copies a program or data read from the recording medium 56a to another recording medium such as the RAM 52 or the HDD 53. For example, the read program is executed by the processor 51. The recording medium 56a may be a portable-type recording medium and may be used to distribute the program or data. The recording medium 56a or the HDD 53 may be referred to as a computer-readable recording medium.
The communication interface 57 is an interface that is coupled to a network 57a and communicates with another information processing apparatus via the network 57a. The communication interface 57 may be a wired communication interface coupled to a communication apparatus such as a switch via a cable or may be a wireless communication interface coupled to a base station via a wireless link.
An accelerator card having an electronic circuit such as an FPGA or an ASIC may be coupled to the bus of the computer 50. The processing of the search units 12 and 21 may be executed by the accelerator card.
Although aspects of the temperature adjustment program, the data processing apparatus, and the data processing method of the present disclosure have been described above based on the embodiments, these are merely examples and the present disclosure is not limited to the above description.
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-112457 | Jul 2023 | JP | national |