Task operation method, electronic equipment, medium and product
By redetermining the time function value at the initial moment in the simulated bifurcation machine, using the maximum cutting problem and the prediction method of the sub-undirected graph, the problem of long-term redundancy during the simulated bifurcation machine is solved, and the computing efficiency is improved.
Patent Information
- Application Number
- CN202510222693.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2045-02-27
AI Technical Summary
The simulation bifurcator has low computing efficiency during operation, mainly due to the long-term redundancy between the initial moment and the critical moment.
By determining the maximum cutting problem based on the actual pending tasks, building multiple subundirected graphs, predicting the loss function value, and redetermining the time function value at the initial moment of the simulation bifurcating machine, making it closer to the time function value at the critical moment, thereby shortening the running time of the simulation bifurcating machine.
The operation efficiency of the simulated bifurcation machine is improved, the time interval from the initial moment to the critical moment is reduced, and computing resources are saved.
Smart Images

Figure CN119718553A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a task calculation method, electronic equipment, medium and product. Background Art
[0002] With the rapid development of information technology, more and more practical tasks can be reduced to combinatorial optimization problems. It is of great significance to deal with combinatorial optimization problems by simulating bifurcation machines.
[0003] In the related art, the simulation bifurcation machine starts from the initial moment when it is running, wherein the time function value at the initial moment is 0, runs for a period of time to reach the critical moment of the bifurcation point, and starts the bifurcation operation from the critical moment, and the time after the critical moment is the time that plays an important role in the operation result. However, the operation efficiency of the simulation bifurcation machine is low when it is running. Summary of the invention
[0004] The present application provides a task operation method, electronic device, medium and product to at least solve the problem of low operation efficiency of the simulated bifurcation machine during operation in the related art.
[0005] The present application provides a task operation method, including:
[0006] According to the actual tasks to be processed, determine the corresponding maximum cut problem to be solved;
[0007] Constructing multiple sub-undirected graphs corresponding to the maximum cut problem to be solved;
[0008] Determine, according to the multiple sub-undirected graphs, a predicted value of a loss function of the maximum cut problem to be solved;
[0009] Determine the time function value at the initial moment when the simulated bifurcation machine starts running the operation according to the predicted value of the loss function;
[0010] According to the time function value at the initial moment, the simulation bifurcation machine is used to perform the operation of the maximum cut problem to be solved until a preset convergence condition is met to obtain the operation result.
[0011] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of the computing method of any of the above tasks when executing the computer program.
[0012] The present application also provides a computer-readable storage medium, in which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the operation method of any of the above tasks are implemented.
[0013] The present application also provides a computer program product, including a computer program, which implements the steps of the computing method of any of the above tasks when the computer program is executed by a processor.
[0014] Through the present application, the corresponding maximum cut problem is determined according to the actual task to be processed, and multiple sub-undirected graphs corresponding to the maximum cut problem are constructed. The loss function prediction value is determined according to the multiple sub-undirected graphs, and the time function value at the initial moment when the simulated bifurcation machine starts running the operation is determined according to the loss function prediction value, so that the simulated operation machine starts running according to the time function value, thereby reducing the long redundancy of the simulated bifurcation machine from the initial moment to the critical moment when it is running, which is caused by the time function value at the initial moment being set to 0 in the related technology, thereby improving the operation efficiency of the simulated bifurcation machine. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. 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 any creative work.
[0016] Figure 1 A hardware architecture diagram of a computing method for executing a task provided in an embodiment of the present application;
[0017] Figure 2 A flowchart of a method for calculating a task provided in an embodiment of the present application;
[0018] Figure 3 A schematic diagram of the operation of a trajectory simulation bifurcation machine provided in an embodiment of the present application;
[0019] Figure 4 A flowchart of a method for determining a predicted value of a loss function of a maximum cut problem to be solved provided in an embodiment of the present application;
[0020] Figure 5 A flow chart of a method for determining the time function value at the initial moment when a simulated bifurcation machine starts running an operation provided by an embodiment of the present application;
[0021] Figure 6 A schematic diagram of the structure of a computing device for a task provided in an embodiment of the present application;
[0022] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] It should be noted that, in the description of this application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0025] With the development of information technology, some practical problems, such as route planning, network design, and data classification, play an increasingly important role. The common feature of these problems is that the answers are either A or B. Mathematically, these problems can be abstracted into a type of combinatorial optimization problem. Combinatorial optimization problems refer to mathematical problems that seek optimal solutions that meet specific constraints in a discrete solution space. The core of combinatorial optimization problems is to determine a better solution from a limited set of feasible solutions by optimizing the objective function.
[0026] The Max-Cut problem is a classic combinatorial optimization problem, which is solved by converting the actual problem into the corresponding Max-Cut problem. In physics, the Max-Cut problem is equivalent to a classic Ising model, and the Ising model can be solved by simulating a bifurcation machine. Therefore, the actual problem can be solved by simulating a bifurcation machine.
[0027] In the related technology, when the simulated bifurcation machine is running (evolving), the operation of the system is from the initial moment Start, the time function value at the initial moment However, the critical moment for the operation of the system is when the bifurcation point begins to appear, that is, the critical moment , the time function at the critical moment can be expressed as Therefore, when the simulated fork is running, there is actually arrive There is a long time redundancy problem between the two, which leads to the low operation efficiency of the simulated fork machine.
[0028] Therefore, in view of the problems in the above-mentioned related technologies, the inventors found in the process of research that if the simulation bifurcation machine can be reduced in operation arrive The time interval between the two is determined by re-determining the new initial time value, that is, the time function value of the new initial time ,in, , The closer , the shorter the time it takes for the simulated bifurcating machine to run to the critical moment, the shorter the entire running time of the model bifurcating machine, thereby improving the running efficiency of the simulated bifurcating machine. Specifically, by determining the corresponding maximum cut problem according to the actual task to be processed, and constructing multiple sub-undirected graphs corresponding to the maximum cut problem to be solved, the loss function prediction value of the maximum cut problem is determined according to the multiple sub-undirected graphs, and the time function value at the initial moment when the simulated bifurcating machine starts running the operation is determined based on the loss function prediction value, so that the model bifurcating machine performs operations according to the time function value at the initial moment, thereby reducing the running time of the simulated bifurcating machine and saving computing resources. Therefore, the present application proposes a task operation method, electronic equipment, medium and product.
[0029] See also Figure 1 , Figure 1 A hardware architecture diagram of a computing method for executing a task provided in an embodiment of the present application, wherein the executing subject of the method may be an electronic device, which includes a computing module 01 and a simulation bifurcating machine module 02, and the computing module 01 and the simulation bifurcating machine module 02 are connected.
[0030] The calculation module 01 includes a first control module 011 and a storage module 012. The first control module 011 is used to determine the corresponding maximum cut problem to be solved according to the actual task to be processed, and determine the loss function prediction value of the maximum cut problem to be solved according to the multiple sub-undirected graphs corresponding to the maximum cut problem to be solved. It is also used to determine the time function value at the initial moment when the simulation bifurcation machine starts running the operation according to the loss function prediction value, and send the time function value at the initial moment to the simulation bifurcation machine module 02. The storage module 012 is used to store the above data, including but not limited to the loss function prediction value and the time function value at the initial moment.
[0031] The simulation bifurcating machine module 02 includes a second control module 021, an operation module 022 and a measurement module 023. The second control module 021 is used to receive the time function value at the initial moment sent by the first control module 011, and receive the evolution start instruction sent by the first control module 011. The operation module 022 is used to perform operations according to the evolution start instruction and the time function value at the initial moment until the preset convergence conditions are met, and obtain the operation results, and send the operation results to the second control module 021. The measurement module 023 is used to measure the measurement data of the simulation bifurcating machine during operation, etc. The second control module 021 sends the operation results to the first control module 011, and the first control module 011 sends the evolution end instruction to the second control module 021 according to the operation results, and the operation module 022 ends the calculation according to the evolution end instruction.
[0032] It can be understood that the modules in the above examples are only used for illustration and do not limit the present application. It may also include other modules, such as an input module, an output module, etc.
[0033] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0034] See also Figure 2 , Figure 2 A flowchart of a method for calculating a task provided in an embodiment of the present application, the execution subject of the method may be a computing device for the task, and the computing device for the task may be implemented by a computer program; it may also be implemented by a medium storing relevant computer programs, such as a USB flash drive and / or a CD, or it may also be implemented by a physical device integrated or installed with relevant computer programs, such as a chip or an electronic device. Among them, the electronic device may be a server, a server cluster, a computer or other intelligent terminal. The method may include the following steps:
[0035] S201. Determine the corresponding maximum cut problem to be solved according to the actual task to be processed.
[0036] The maximum cut problem is a classic problem in graph theory and combinatorial optimization. It is defined as: given an undirected graph ,in is a set of vertices, represents the number of vertices, It is a collection of edges. Connect Vertices and The goal of the maximum cut problem is to transform the vertex set Divide into two disjoint subsets A and B so that the number of edges connecting the vertices in A and B or the sum of the weights of the edges is maximized. The set of edges connecting the two subsets is called a "cut", and finding a partitioning method that maximizes the "cut" is the core of the maximum cut problem.
[0037] If you use Represents a vertex If the partition state Indicates that the vertex belongs to subset A if Represents a vertex belongs to subset B, then the loss function of the maximum cut problem is It can be expressed as the following formula (1).
[0038]
[0039] in, represents the loss function; represents weight; Indicates The value of the vertices, Indicates The value of each vertex; Represents a set of edges.
[0040] The actual task to be processed can be abstracted as a type of combinatorial optimization problem, which is defined as The value is or ( or ) binary variable Assuming that the actual task to be processed includes multiple objects, the vertex set of the maximum cut problem can be determined based on the number of objects , according to the relationship between objects, the edge set of the maximum cut problem can be determined .
[0041] S202, construct multiple sub-undirected graphs corresponding to the maximum cut problem to be solved. The maximum cut problem is a non-deterministic polynomial hard (NP-hard) problem. NP-hard problems mean that as the number of problems increases, the number of problems is generally exponential, and the computing resources required to solve the problem are also higher. However, due to the limited computing resources at present, the maximum cut problem within 200 vertices can generally be processed. Therefore, it is necessary to decompose the maximum cut problem to be solved at the large system level into multiple small system-level maximum cut problems. Among them, the order of magnitude of the number of vertices contained in the large system is significantly greater than the order of magnitude of the number of vertices contained in the small system.
[0042] In this embodiment, a possible implementation method of constructing multiple sub-undirected graphs corresponding to the maximum cut problem to be solved is:
[0043] Obtain an undirected graph corresponding to the maximum cut problem to be solved, and create multiple sub-undirected graphs based on the feature information in the undirected graph.
[0044] The undirected graph includes multiple vertices and edges between vertices, the vertices are used to represent the objects corresponding to the actual tasks to be processed, and the edges are used to represent the preset relationships between the objects. The number of vertices included in any sub-undirected graph is smaller than the number of vertices in the undirected graph.
[0045] The level of the undirected graph corresponding to the maximum cut problem to be solved is equivalent to the large system level mentioned above, and the level of each sub-undirected graph is equivalent to the small system level mentioned above.
[0046] S203. Determine a predicted value of a loss function of a maximum cut problem to be solved according to the multiple sub-undirected graphs.
[0047] In this embodiment, the maximum cut problem of the large system is decomposed into multiple maximum cut problems of small systems according to the characteristic information in the undirected graph corresponding to the maximum cut problem to be solved, and the loss function prediction value corresponding to the maximum cut problem of each small system is obtained, where the loss function prediction value is also called the energy prediction value.
[0048] Then, based on the loss function prediction values corresponding to the maximum cut problems of each small system, the loss function prediction values of the maximum cut problem of the large system can be indirectly obtained. The method indicated in the above content can also be called the energy interpolation method.
[0049] S204. Determine the time function value at the initial moment when the simulated bifurcation machine starts running the operation according to the predicted value of the loss function.
[0050] The maximum cut problem can be solved by the classical Ising model, where the Ising model is a spin model. For example, the spin-up Correspondingly, the spin down and Correspondingly, the highest excited state of the spin model corresponds to the solution to the maximum cut problem.
[0051] In this embodiment, a simulated bifurcation machine can be used to solve the spin model. In order to facilitate the understanding of the simulated bifurcation machine in this step, the simulated bifurcation machine is first introduced.
[0052] The internal structure of the simulated bifurcation machine is composed of multiple components, each of which can be used to represent the vertex of the maximum cut problem. The Hamiltonian describing the components of the simulated bifurcation machine is shown in formulas (2)-(3):
[0053]
[0054]
[0055] in, represents the Hamiltonian; Indicates a preset constant, which is usually set to 1; Indicates the number of parts; represents the potential energy of the component; represents the time function, , generally speaking ,and ; Indicates The coordinates of the components; Indicates The coordinates of the components; represents the interaction constant; represents weight; Represents the momentum of the component.
[0056] The Hamiltonian describes the motion behavior of the N components under the interaction of the fourth-order harmonic oscillator potential and the surrounding components. The motion equation of each component can be expressed by Hamiltonian equations (4)-(5):
[0057]
[0058]
[0059] In the above-mentioned simulated bifurcation machine, the role of the fourth power potential is that when or ,make Oscillates around 0, making Continue to grow towards for or direction of movement.
[0060] It should be noted that when solving The value of or , which means less than or greater than The part of is not very meaningful, so the fourth power potential energy term corresponding to this part can be ignored. In order to prevent it from exceeding the range, we can introduce If the inelastic wall , then The value is One of them, specifically or , depending on the current The symbol of . Thus, the deformation of the simulated bifurcation machine is obtained, namely the ballistic simulated bifurcation machine (bSBM).
[0061] The Hamiltonian of the ballistic simulation bifurcating machine components and the kinematic equations they satisfy are shown in formulas (6)-(9):
[0062]
[0063]
[0064]
[0065]
[0066] In this embodiment, the simulation bifurcation machine takes the ballistic simulation bifurcation machine as an example. During the operation of the ballistic simulation bifurcation machine, each component can be regarded as being in the interaction potential between the oscillator potential and the component. The coordinates of each component With momentum will gradually change with evolution. Figure 3 As shown, Figure 3 A schematic diagram of the operation of a trajectory simulation bifurcation machine provided in an embodiment of the present application, wherein when hour, Oscillates around 0, and when hour, Will quickly spread. The change in behavior is the bifurcation phenomenon. Also known as the time corresponding to the bifurcation point, the initial time when the trajectory simulation bifurcation machine in this step starts running the calculation is located at Previously, the time function value at the initial moment was 0 in the non-correlated technique, which saved time such as Figure 3 The runtimes shown.
[0067] According to the predicted value of the loss function corresponding to the maximum cut problem to be solved, the time function value at the initial moment when the trajectory simulation bifurcation machine starts running the operation is determined. The specific implementation process will be described in detail in the following embodiments, please refer to the following embodiments.
[0068] S205. According to the time function value at the initial moment, a simulation bifurcation machine is used to perform calculations on the maximum cut problem to be solved until a preset convergence condition is met to obtain a calculation result.
[0069] In the present application, the type of the simulation bifurcating machine is not limited, and it may be a ballistic simulation bifurcating machine or other variant forms of the simulation bifurcating machine.
[0070] After determining the time function value at the initial moment, the simulated bifurcation machine runs according to the time function value, so that the simulated bifurcation machine runs to the bifurcation point in a shorter time to diverge, and when the preset convergence condition is reached, the calculation result is obtained.
[0071] For example, take the distribution of a public service promotional video as an example. We want to select a part of users to distribute the public service promotional video. These users will influence the users around them to expand the influence of the public service promotional video. The goal is to find suitable users to make the public service promotional video spread as widely as possible. The distribution problem of the public service promotional video can be abstracted as a maximum cut problem. All users are represented by binary variables. Indicates that when When When , it means that the user has not received the public service promotional video. Through the method of this embodiment, the calculation result finally obtained by simulating the bifurcation machine is whether each user will receive the public service promotional video.
[0072] In the above-mentioned embodiment of the present application, the corresponding maximum cut problem is determined according to the actual task to be processed, and the loss function prediction value of the maximum cut problem is determined according to the multiple sub-undirected graphs corresponding to the constructed maximum cut problem, so as to determine the time function value at the initial moment when the simulated bifurcation machine starts to run the operation according to the loss function prediction value. The simulation machine runs according to the time function value at the initial moment, so that it can calculate to the critical moment faster, thereby reducing the long redundancy problem from the initial moment to the critical moment when the simulated bifurcation machine is running when the time function value at the initial moment is set to 0 in the related technology, thereby improving the operation efficiency of the simulated bifurcation machine.
[0073] Furthermore, based on the above embodiment, the process of determining the predicted value of the loss function of the maximum cut problem to be solved is described through the following embodiment.
[0074] See also Figure 4 , Figure 4 A flowchart of a method for determining a predicted value of a loss function for a maximum cut problem to be solved provided in an embodiment of the present application, the method comprising the following steps:
[0075] S401. Obtain an undirected graph corresponding to the maximum cut problem to be solved.
[0076] S402: Create multiple sub-undirected graphs according to the undirected graph.
[0077] Optionally, feature information of each vertex in the undirected graph is extracted, and the feature information may be, for example, the number of vertices to which each vertex can be connected, etc. Vertex number information preset in each sub-undirected graph is obtained, and the number of vertices preset in each sub-undirected graph may be different. For example, assuming that the first sub-undirected graph is preset to include 100 vertices, and the second sub-undirected graph is preset to include 150 vertices, etc., then multiple sub-undirected graphs are created according to the vertex number information and feature information preset in each sub-undirected graph.
[0078] It should be noted that the feature information of the vertices in any sub-undirected graph needs to be the same as the feature information of each vertex in the undirected graph, so that each sub-undirected graph and the undirected graph corresponding to the maximum cut problem to be solved have common similar properties, so that the predicted value of the loss function of the maximum cut problem to be solved indirectly determined based on the sub-undirected graph is not much different from the actual predicted value of the loss function of the maximum cut problem to be solved.
[0079] Optionally, based on a preset configuration model, multiple regions are randomly selected from the undirected graph, and for any region, image information in the region is extracted, and multiple sub-undirected graphs including different numbers of vertices are randomly generated based on the image information.
[0080] Optionally, based on a preset probability model, statistical characteristics of the graph are obtained from the undirected graph, such as the probability of the existence of an edge, the remaining vertices to which the vertex may be connected, etc., and then multiple sub-undirected graphs are generated based on the statistical characteristics, wherein the number of vertices included in each sub-undirected graph is different.
[0081] S403: Determine a predicted value of a loss function of a maximum cut problem to be solved according to the multiple sub-undirected graphs.
[0082] Based on a preset algorithm, such as a heuristic algorithm, the sub-loss function value corresponding to each sub-undirected graph is calculated. The loss function corresponding to each sub-undirected graph is the same as formula (1).
[0083] Then, according to the sub-loss function values corresponding to each sub-undirected graph and the undirected graph, the loss function prediction value of the maximum cut problem to be solved is determined.
[0084] One possible implementation is:
[0085] A preset fitting algorithm is used to fit the preset function according to the number of vertices in each sub-undirected graph and the corresponding sub-loss function value, wherein the preset function represents the mapping relationship between the number of vertices in the sub-undirected graph and the sub-loss function value.
[0086] Optionally, the preset function may be a linear function or a nonlinear function, etc., which is not limited in this embodiment.
[0087] According to the preset function and the number of vertices in the undirected graph, the predicted value of the loss function of the maximum cut problem to be solved is determined.
[0088] Optionally, the number of vertices in the undirected graph is input into a preset function to determine a predicted value of a loss function of the maximum cut problem to be solved.
[0089] In the above-mentioned embodiment of the present application, an undirected graph corresponding to the maximum cut problem to be solved is obtained, and multiple sub-undirected graphs are created based on the undirected graph, and then the loss function prediction value of the maximum cut problem to be solved is determined based on the multiple sub-undirected graphs. The method of this embodiment, due to the limited computing resources of the current computing module, cannot directly solve the undirected graph corresponding to the maximum cut problem to be solved. Therefore, by creating multiple sub-undirected graphs, the computing module can quickly obtain the loss function value corresponding to each sub-undirected graph according to the current computing resources, and then obtain the loss function prediction value of the undirected graph corresponding to the maximum cut problem to be solved according to the loss function value corresponding to each sub-undirected graph, thereby improving the flexibility of obtaining the loss function prediction value of the undirected graph corresponding to the maximum cut problem to be solved.
[0090] Furthermore, based on the above embodiment, the following embodiment illustrates the process of determining the initial moment when the bifurcation operation of the simulated bifurcation machine begins according to the predicted value of the loss function.
[0091] See also Figure 5 , Figure 5 A flow chart of a method for determining the time function value at the initial moment when a simulated bifurcation machine starts running an operation provided in an embodiment of the present application, the method may include the following steps:
[0092] S501. Determine a weight matrix according to a loss function corresponding to the maximum cut problem to be solved.
[0093] The weight matrix includes the weights of the edges between the vertices.
[0094] The solution to the maximum cut problem to be solved is to find the minimum value of the corresponding loss function. The loss function corresponding to the maximum cut problem to be solved is shown in the following formula (10), which is the same as formula (1).
[0095]
[0096] From the above formula, we can see that the loss function includes the weight matrix , is the weight matrix One of the weight values in In the case of binary features, finding the minimum value of the loss function is to find the weight matrix The maximum eigenvalue of .
[0097] It should be noted that the weight matrix The element corresponding to the maximum eigenvalue of is not binary, but a random number between [-1,1], so The maximum eigenvalue of is not a solution to the original problem, but can be obtained by The approximate solution is obtained by taking the sign of the maximum eigenvalue of .
[0098] The simulation bifurcating machine in this embodiment may be a ballistic simulation bifurcating machine. Considering the kinematic equations of the ballistic simulation bifurcating machine, namely, formula (8) and formula (9), when the motion state reaches a stable state, the operation of the ballistic simulation bifurcating machine is terminated and output The sign of , and the solution corresponding to the sign is taken as the approximate solution. When stability is reached, the kinematic equations are shown in formulas (11)-(12):
[0099]
[0100]
[0101] Solving formulas (11)-(12), we obtain ,as well as .
[0102] If the weight matrix The maximum eigenvalue of Less than ,but There is a unique solution , because the time function will increase with the increase of the running time of the ballistic simulation bifurcation machine, so will become smaller until hour, The second solution appears. is the weight matrix The eigenstate with the largest eigenvalue, , and then as the running time increases, It will also continue to evolve from the maximum eigenstate of the matrix obtained previously until it converges to inelastic wall.
[0103] From the above content, it can be seen that in the principle of the ballistic simulation bifurcation machine, due to the time function will increase with the increase of the running time of the ballistic simulation bifurcation machine, so There will be from greater than to less than In the analog bifurcation machine in the related art, it takes a long time to to equal The process is the process of bifurcation point, so the operation efficiency of the simulated bifurcation machine is low.
[0104] Therefore, in this application, the time function Set a new evolution initial value , instead of 0 in the related art, as the time function value corresponding to the initial moment when the trajectory simulation bifurcation machine starts running, that is, , so the kinematic equation of the trajectory simulation bifurcation machine becomes the following formula (13)-(14):
[0105]
[0106]
[0107] During the operation of the ballistic simulation bifurcating machine, From greater than to less than The process of change can make Evolved to weight matrix The maximum eigenstate of The following formula (15) needs to be satisfied:
[0108]
[0109] S502. Determine the predicted value of the maximum eigenvalue of the weight matrix according to the predicted value of the loss function.
[0110] The predicted value of the loss function is normalized to obtain the normalized predicted value of the loss function, and the predicted value of the maximum eigenvalue of the weight matrix is determined according to the normalized predicted value of the loss function.
[0111] In calculating the weight matrix When calculating the maximum eigenvalue of , the default maximum eigenstate is normalized, that is, the sum of the squares of all elements in each eigenstate is 1, but when calculating the maximum cut, the sum of the squares of all elements of the solution is N, so the result of the maximum cut must be normalized. In addition, when calculating the maximum cut, the contribution of the number of edges is included, but when calculating the weight matrix When the eigenvalue of is , there is no contribution from this part. So when predicting When the maximum eigenvalue is obtained, the information about the number of edges needs to be excluded, so the weight matrix obtained after conversion is determined The prediction method of the maximum eigenvalue of is shown in the following formula (16):
[0112]
[0113] in, represents the maximum eigenvalue of the weight matrix; represents the empirical constant; Indicates the number of vertices; Represents the predicted value of the loss function after normalization.
[0114] Therefore, by obtaining the number of vertices in the undirected graph corresponding to the maximum cut problem to be solved and the preset empirical constant, according to the empirical constant of the number of vertices and the predicted value of the loss function after normalization, the above data are substituted into formula (16) to determine the weight matrix The predicted value of the maximum eigenvalue of .
[0115] The above formula (16) gives The actual In this embodiment, appropriate empirical constants are set to make , in order to achieve From greater than to less than Therefore, it is necessary to set appropriate empirical constants based on experience.
[0116] S503. Determine the time function value at the initial moment when the simulated bifurcation machine starts running according to the predicted value of the maximum eigenvalue.
[0117] Determine the time function value at the initial moment according to formula (17):
[0118]
[0119] in, Represents the time function value at the initial moment; represents the interaction constant; Indicates a preset constant.
[0120] Compared with the case where the time function value of the initial moment of the simulated bifurcation machine is set to 0 in the related art, the time length is shortened to of running time.
[0121] Determine Afterwards, according to The simulation bifurcation machine is used to calculate the maximum cut problem to be solved. All reached or When , the operation reaches convergence and the operation result is obtained.
[0122] The time taken to obtain the operation result is obtained. If the time is greater than the preset time threshold, it means that the currently set empirical constant makes the running time of the simulated bifurcation machine too long, so the empirical constant is reset so that the simulated bifurcation machine can obtain the new empirical constant.
[0123] In the above-mentioned embodiment of the present application, the weight matrix is determined according to the loss function corresponding to the maximum cut problem to be solved, and the predicted value of the maximum eigenvalue of the weight matrix is determined according to the predicted value of the loss function. Then, according to the predicted value of the maximum eigenvalue, the time function value at the initial moment when the simulated bifurcating machine starts to run the operation is determined, so that the model bifurcating machine starts to operate according to the time function value at the initial moment, thereby reducing the running time of the simulated bifurcating machine and improving the running efficiency.
[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0125] Figure 6 A schematic diagram of a structure of a computing device for a task provided in an embodiment of the present application. Figure 6 As shown, including:
[0126] The determination module 601 is used to determine the corresponding maximum cut problem to be solved according to the actual task to be processed.
[0127] The construction module 602 is used to construct multiple sub-undirected graphs corresponding to the maximum cut problem to be solved.
[0128] The determination module 601 is further used to determine the predicted value of the loss function of the maximum cut problem to be solved according to the multiple sub-undirected graphs.
[0129] The determination module 601 is also used to determine the time function value at the initial moment when the simulated bifurcation machine starts running the operation according to the predicted value of the loss function.
[0130] The processing module 603 is used to use a simulated bifurcation machine to perform calculations on the maximum cut problem to be solved according to the time function value at the initial moment, until a preset convergence condition is met, and obtain a calculation result.
[0131] One possible implementation is to construct module 602, which is specifically used to:
[0132] An undirected graph corresponding to the maximum cut problem to be solved is obtained. The undirected graph includes multiple vertices and edges between vertices. The vertices are used to represent objects corresponding to the actual tasks to be processed, and the edges are used to represent preset relationships between objects.
[0133] According to the characteristic information in the undirected graph, a plurality of sub-undirected graphs are created, wherein the number of vertices included in any sub-undirected graph is smaller than the number of vertices in the undirected graph.
[0134] One possible implementation is to construct module 602, which is specifically used to:
[0135] Extract feature information of each vertex in an undirected graph.
[0136] Get the preset number of vertices in each sub-undirected graph.
[0137] Multiple sub-undirected graphs are created according to the preset vertex quantity information and feature information in each sub-undirected graph.
[0138] Among them, the feature information of the vertices in any sub-undirected graph is the same as the feature information of each vertex in the undirected graph.
[0139] In a possible implementation manner, the determining module 601 is specifically configured to:
[0140] Based on the preset algorithm, the sub-loss function value corresponding to each sub-undirected graph is calculated.
[0141] According to the sub-loss function values corresponding to each sub-undirected graph and the undirected graph, the loss function value of the maximum cut problem to be solved is determined.
[0142] In a possible implementation manner, the determining module 601 is specifically configured to:
[0143] A preset fitting algorithm is used to fit the preset function according to the number of vertices in each sub-undirected graph and the corresponding sub-loss function value. The preset function represents the mapping relationship between the number of vertices in the sub-undirected graph and the sub-loss function value.
[0144] According to the preset function and the number of vertices in the undirected graph, the predicted value of the loss function of the maximum cut problem to be solved is determined.
[0145] In a possible implementation manner, the determining module 601 is specifically configured to:
[0146] The number of vertices in the undirected graph is input into a preset function to determine the predicted value of the loss function for the maximum cut problem to be solved.
[0147] In a possible implementation manner, the determining module 601 is specifically configured to:
[0148] According to the loss function corresponding to the maximum cut problem to be solved, a weight matrix is determined, where the weight matrix includes the weights of the edges between the vertices.
[0149] Based on the predicted value of the loss function, the predicted value of the maximum eigenvalue of the weight matrix is determined.
[0150] According to the predicted value of the maximum eigenvalue, the time function value at the initial moment when the simulated bifurcation machine starts running is determined.
[0151] In a possible implementation manner, the determining module 601 is specifically configured to:
[0152] The loss function prediction value is normalized to obtain the normalized loss function prediction value.
[0153] According to the predicted value of the loss function after normalization, the predicted value of the maximum eigenvalue of the weight matrix is determined.
[0154] In a possible implementation manner, the determining module 601 is specifically configured to:
[0155] Get the number of vertices in the undirected graph corresponding to the maximum cut problem to be solved.
[0156] Get the preset empirical constants.
[0157] The predicted value of the maximum eigenvalue of the weight matrix is determined based on the number of vertices, the empirical constant, and the normalized predicted value of the loss function.
[0158] In a possible implementation manner, the determining module 601 is specifically configured to:
[0159] The predicted value of the maximum eigenvalue of the weight matrix is determined according to the following formula:
[0160]
[0161] in, Represents the maximum eigenvalue of the weight matrix. represents an empirical constant. Indicates the number of vertices. Represents the predicted value of the loss function after normalization.
[0162] In a possible implementation manner, the determining module 601 is specifically configured to:
[0163] Determine the time function value at the initial moment according to the following formula:
[0164]
[0165] in, Represents the time function value at the initial time. represents the interaction constant. Indicates a preset constant.
[0166] In a possible implementation manner, the determining module 601 is specifically configured to:
[0167] Gets the time taken to obtain the calculation result.
[0168] If the duration is greater than the preset duration threshold, a new experience constant is obtained again.
[0169] For the description of the features in the embodiment corresponding to the task computing device, reference can be made to the relevant description of the embodiment corresponding to the task computing method, which will not be repeated here.
[0170] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device 70 provided in this embodiment includes: at least one processor 701 and a memory 702. Optionally, the electronic device 70 further includes a communication component 703. The processor 701, the memory 702 and the communication component 703 are connected via a bus 704.
[0171] In the specific implementation process, at least one processor 701 executes the computer execution instructions stored in the memory 702, so that at least one processor 701 performs the computing method embodiment of the above-mentioned task.
[0172] The specific implementation process of the processor 701 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0173] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the application may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0174] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
[0175] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0176] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of the computing method embodiment of any of the above tasks when run.
[0177] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0178] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in the computing method embodiment of any of the above tasks are implemented.
[0179] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the computing method embodiment of any of the above tasks are implemented.
[0180] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0181] The above is a detailed introduction to the computing method, electronic device, medium and product of a task provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A task calculation method, characterized in that: include: According to the actual tasks to be processed, determine the corresponding maximum cut problem to be solved; Constructing multiple sub-undirected graphs corresponding to the maximum cut problem to be solved; Determine, according to the multiple sub-undirected graphs, a predicted value of a loss function of the maximum cut problem to be solved; Determine the time function value at the initial moment when the simulated bifurcation machine starts running the operation according to the predicted value of the loss function; According to the time function value at the initial moment, the simulation bifurcation machine is used to perform the operation of the maximum cut problem to be solved until a preset convergence condition is met to obtain the operation result.
2. The method according to claim 1, characterized in that: The step of constructing a plurality of sub-undirected graphs corresponding to the maximum cut problem to be solved includes: Obtain an undirected graph corresponding to the maximum cut problem to be solved, wherein the undirected graph includes a plurality of vertices and edges between the vertices, the vertices are used to represent objects corresponding to the actual tasks to be processed, and the edges are used to represent preset relationships between the objects; A plurality of sub-undirected graphs are created according to the characteristic information in the undirected graph, wherein the number of vertices included in any of the sub-undirected graphs is smaller than the number of vertices in the undirected graph.
3. The method according to claim 2, characterized in that The step of creating a plurality of sub-undirected graphs according to the feature information in the undirected graph comprises: Extracting feature information of each vertex in the undirected graph; Get the preset vertex number information in each sub-undirected graph; Creating multiple sub-undirected graphs according to the preset vertex quantity information and the feature information in each sub-undirected graph; The feature information of the vertices in any of the sub-undirected graphs is the same as the feature information of the vertices in the undirected graph.
4. The method according to claim 3, characterized in that The step of determining the predicted value of the loss function of the maximum cut problem to be solved according to the multiple sub-undirected graphs includes: Based on a preset algorithm, calculate the sub-loss function value corresponding to each of the sub-undirected graphs; According to the sub-loss function values corresponding to each of the sub-undirected graphs and the undirected graph, the loss function prediction value of the maximum cut problem to be solved is determined.
5. The method according to claim 4, characterized in that The step of determining the predicted value of the loss function of the maximum cut problem to be solved according to the sub-loss function values corresponding to each of the sub-undirected graphs and the undirected graph comprises: Using a preset fitting algorithm, a preset function is fitted according to the number of vertices in each sub-undirected graph and the corresponding sub-loss function value, wherein the preset function represents a mapping relationship between the number of vertices in the sub-undirected graph and the sub-loss function value; According to the preset function and the number of vertices in the undirected graph, a predicted value of the loss function of the maximum cut problem to be solved is determined.
6. The method according to claim 5, characterized in that The step of determining the predicted value of the loss function of the maximum cut problem to be solved according to the preset function and the number of vertices in the undirected graph includes: The number of vertices in the undirected graph is input into the preset function to determine the predicted value of the loss function of the maximum cut problem to be solved.
7. The method according to claim 1, characterized in that Determining the time function value at the initial moment when the simulated bifurcation machine starts running the operation according to the loss function prediction value includes: Determine a weight matrix according to the loss function corresponding to the maximum cut problem to be solved, wherein the weight matrix includes weights of edges between vertices; Determining a predicted value of a maximum eigenvalue of the weight matrix according to the predicted value of the loss function; According to the predicted value of the maximum eigenvalue, the time function value at the initial moment when the simulated bifurcation machine starts running the operation is determined.
8. The method according to claim 7, characterized in that Determining the predicted value of the maximum eigenvalue of the weight matrix according to the predicted value of the loss function includes: Normalizing the loss function prediction value to obtain a normalized loss function prediction value; The predicted value of the maximum eigenvalue of the weight matrix is determined according to the predicted value of the loss function after the normalization process.
9. The method according to claim 8, characterized in that Determining the predicted value of the maximum eigenvalue of the weight matrix according to the predicted value of the loss function after the normalization process includes: Obtain the number of vertices in the undirected graph corresponding to the maximum cut problem to be solved; Get the preset empirical constants; The predicted value of the maximum eigenvalue of the weight matrix is determined according to the number of vertices, the empirical constant and the predicted value of the normalized loss function.
10. The method according to claim 9, characterized in that Determining the predicted value of the maximum eigenvalue of the weight matrix according to the number of vertices, the empirical constant, and the predicted value of the loss function after normalization includes: The predicted value of the maximum eigenvalue of the weight matrix is determined according to the following formula: Among them, the represents the predicted value of the maximum eigenvalue of the weight matrix; represents the empirical constant; represents the number of vertices; Represents the predicted value of the loss function after the normalization process.
11. The method according to claim 10, characterized in that Determining the time function value at the initial moment when the simulated bifurcation machine starts running the operation according to the predicted value of the maximum eigenvalue comprises: The time function value at the initial moment is determined according to the following formula: Among them, the represents the time function value of the initial moment; represents the interaction constant; Indicates a preset constant.
12. The method according to claim 9, characterized in that Also includes: Obtaining the time taken to obtain the calculation result; If the duration is greater than the preset duration threshold, a new empirical constant is re-acquired.
13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to implement the steps of the operation method of simulating a bifurcation machine as claimed in any one of claims 1 to 12 when executing the computer program.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the operation method of simulating a bifurcation machine as claimed in any one of claims 1 to 12.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the operation method for simulating a forking machine as claimed in any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Deep learning model training method and device, computer equipment and storage medium
CN111860840A
Graph segmentation method and device and electronic equipment
CN113591906A
Stereo matching method based on simulated bifurcation
CN115131422A
Quantum calculation method and device, electronic equipment and storage medium
CN116306951A
Intelligent traffic signal lamp regulation and control method and system based on spinning glass model
CN116363876A