Multi-layer feedforward neural network training method and system for Isin machine

By modeling the supervised learning of multi-layer feedforward quantized neural networks as a quadratic constrained binary optimization problem and using the augmented Lagrangian function to solve it on an Ising machine, the problem of training multi-layer feedforward neural networks with Ising machines is solved For problems with large network calculations, it achieves an easier solution process and a more efficient training effect.

CN118586470APending Publication Date: 2024-09-03TSINGHUA UNIVERSITY
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410539239.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-30
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The existing Ising machine requires a large amount of calculation when training a multi-layer feedforward neural network and is difficult to solve. How to reduce the amount of calculation and simplify the difficulty of solving the problem.

Method used

Model the supervised learning of multi-layer feedforward quantized neural networks as a quadratic constrained binary optimization problem, construct an augmented Lagrangian function, transform it into a quadratic unconstrained binary optimization problem, solve it on an Ising machine, and update The coefficients in the augmented Lagrangian function are solved iteratively until the constraints are satisfied and the objective function converges, and the optimal solution is obtained.

Benefits of technology

It reduces the use of spin numbers and simplifies the difficulty of problem solving, making it easier to solve real machine problems and capable of solving large-scale problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118586470A
    Figure CN118586470A
Patent Text Reader

Abstract

The invention relates to a multilayer feedforward neural network training method and system for an Isin machine. The method comprises the following steps: modeling supervised learning of a multi-layer feed-forward quantization neural network into a quadratic constrained binary optimization problem; constructing an augmented Lagrangian function based on the quadratic constrained binary optimization problem, reducing the order of the augmented Lagrangian function, and converting the augmented Lagrangian function into a quadratic unconstrained binary optimization problem; the quadratic unconstrained binary optimization problem is solved on an Isin machine, coefficients in a Guangdongian function are increased based on a solving result, a new quadratic unconstrained binary optimization problem is obtained through conversion and solved, and an optimal solution of a quadratic constrained binary optimization problem is obtained after constraint is met and an objective function is converged; and decoding the optimal solution to obtain parameters of the trained multilayer feedforward neural network. According to the embodiment of the invention, the spinning number is reduced, the problem solving difficulty is simplified, real machine solving is easier, and large-scale problems can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of artificial intelligence and quantum computing, and in particular to a multi-layer feedforward neural network training method and system for an Ising machine. Background Art

[0002] Currently, the huge computational cost of training deep neural networks has become a key bottleneck in the development of artificial intelligence. Traditional gradient-based back-propagation training methods encounter many problems such as gradient vanishing and falling into local optimality. This training method requires a large number of graphics processing units (GPUs) to efficiently update the model. Ising machines, as dedicated quantum computers, have achieved a large number of spin bits, showing the potential possibility of training neural networks on Ising machines.

[0003] So far, Ising machine has been used for some machine learning tasks, such as support vector machine training and clustering model training. Meanwhile, in the field of neural networks, Ising machine can be used to train Boltzmann machine (BoltzmannMachine) and dynamic energy network (DynamicalEnergyNetwork), and these two types of networks do not belong to feedforward network. Due to the powerful representation ability, fast reasoning ability and flexible connection structure of feedforward network, multilayer feedforward network is the most widely used neural network type in industry. The existing Ising machine has a large number of quantum spin bits occupied by the algorithm in the process of training neural network, which makes the Ising machine calculation large and difficult to solve. Therefore, how to reduce the calculation amount of Ising machine and simplify the difficulty of problem solving is the problem that this application needs to solve. Summary of the invention

[0004] In view of this, the present application proposes a multi-layer feedforward neural network training method and system for Ising machine.

[0005] According to one aspect of the present application, a multi-layer feedforward neural network training method for an Ising machine is provided. The method comprises:

[0006] Model the supervised learning of multi-layer feedforward quantized neural networks as a quadratic constrained binary optimization problem;

[0007] Based on the quadratic constrained binary optimization problem, an augmented Lagrangian function is constructed, and the augmented Lagrangian function is reduced in degree to transform it into a quadratic unconstrained binary optimization problem.

[0008] Solve the quadratic unconstrained binary optimization problem on the Ising machine;

[0009] Based on the solution results, the coefficients in the augmented Lagrangian function are updated, and the new quadratic unconstrained binary optimization problem is transformed and solved. After the constraints are satisfied and the objective function converges, the optimal solution of the quadratic constrained binary optimization problem is obtained.

[0010] The optimal solution is decoded to obtain the parameters of the trained multi-layer feedforward neural network.

[0011] In one possible implementation, supervised learning of a multi-layer feedforward quantized neural network is modeled as a quadratic constrained binary optimization problem, including:

[0012] Based on the loss function, inequality constraints, equality constraints and encoded optimization variables of the quantized neural network, the supervised learning of the multi-layer feedforward quantized neural network is modeled as a quadratic constrained binary optimization problem. The objective function of the quadratic constrained binary optimization problem is the loss function of the quantized neural network. The equality constraints represent the linear transformation in the feedforward topology of the quantized neural network. The inequality constraints represent the activation function in the feedforward topology of the quantized neural network. The encoded optimization variables are obtained by encoding the optimization variables using binary representation rules.

[0013] In a possible implementation, the inequality constraints include constraints on the same sign of the values ​​before and after activation of each layer and constraints when boundary conditions are met.

[0014] In a possible implementation, the optimization variables include: the quantization weight of each layer in the quantized neural network, the quantization bias of each layer, the value of each layer before activation, the value of each layer after activation, and the predicted value of the sample.

[0015] In a possible implementation, an augmented Lagrangian function is constructed based on a quadratic constrained binary optimization problem, and the augmented Lagrangian function is reduced in order to be converted into a quadratic unconstrained binary optimization problem, including:

[0016] Construct an augmented Lagrangian function for the objective function and constraints in a quadratic constrained binary optimization problem.

[0017] The augmented Lagrangian function is reduced in degree using the Rosenberg method and transformed into a quadratic unconstrained binary optimization problem.

[0018] In a possible implementation, an augmented Lagrangian function is constructed for the objective function and constraints in the quadratic constrained binary optimization problem, including:

[0019] Multiply the difference between the two ends of the equality constraint by the Lagrange multiplier for the equality constraint to obtain a penalty term for the equality constraint and add it to the objective function;

[0020] Multiply the difference between the two ends of the inequality constraint by the Lagrange multiplier for the inequality constraint to obtain a first-order penalty term for the inequality constraint and add it to the objective function;

[0021] Introduce a penalty coefficient for the equality constraint, multiply the square of the difference between the two ends of the equality constraint by the penalty coefficient for the equality constraint, and obtain a quadratic penalty term for the equality constraint, which is added to the objective function;

[0022] Introduce the penalty coefficient for the inequality constraint, multiply the square of the difference between the two ends of the inequality constraint by the penalty term for the inequality constraint, and obtain the quadratic penalty term for the inequality constraint, which is added to the objective function;

[0023] The first-order penalty term and the second-order penalty term for the equality constraint and the inequality constraint are added to the objective function to construct the augmented Lagrangian function.

[0024] In a possible implementation, the coefficients in the augmented Lagrangian function are updated based on the solution result, including:

[0025] The Lagrange multipliers for the equality constraints and the Lagrange multipliers for the inequality constraints are updated based on the solution results.

[0026] In a possible implementation, the Lagrange multipliers for the equality constraints and the Lagrange multipliers for the inequality constraints are updated based on the solution results, including:

[0027] Determine the value of the difference between the two ends of the equality constraint and the value of the difference between the two ends of the inequality constraint based on the solution result;

[0028] The Lagrange multiplier for the equality constraint is updated to the product of the difference between the two ends of the equality constraint term and the penalty coefficient for the equality constraint and the sum of the original Lagrange multiplier for the equality constraint;

[0029] When the product of the difference between the two ends of the inequality constraint term and the penalty coefficient for the inequality constraint is not greater than 0, the Lagrange multiplier for the inequality constraint is updated to the sum of the product of the difference between the two ends of the inequality constraint term and the penalty coefficient for the inequality constraint and the original Lagrange multiplier for the inequality constraint; otherwise, the Lagrange multiplier for the inequality constraint is updated to 0.

[0030] According to another aspect of the present application, a multi-layer feedforward neural network training device for an Ising machine is provided. The device comprises:

[0031] A task building module for modeling supervised learning of multi-layer feedforward quantized neural networks as a quadratic constrained binary optimization problem;

[0032] The problem conversion module is used to construct an augmented Lagrangian function based on a quadratic constrained binary optimization problem, reduce the order of the augmented Lagrangian function, and convert it into a quadratic unconstrained binary optimization problem;

[0033] Ising machine solving module, used to solve the quadratic unconstrained binary optimization problem on the Ising machine;

[0034] A coefficient updating module is used to update the coefficients in the augmented Lagrangian function based on the solution result, transform and solve a new quadratic unconstrained binary optimization problem, and obtain the optimal solution of the quadratic constrained binary optimization problem after the constraints are satisfied and the objective function converges;

[0035] The parameter decoding module is used to decode the optimal solution and obtain the parameters of the trained multi-layer feedforward neural network.

[0036] In a possible implementation, the task building module is used to:

[0037] Based on the loss function, inequality constraints, equality constraints and encoded optimization variables of the quantized neural network, the supervised learning of the multi-layer feedforward quantized neural network is modeled as a quadratic constrained binary optimization problem. The objective function of the quadratic constrained binary optimization problem is the loss function of the quantized neural network. The equality constraints represent the linear transformation in the feedforward topology of the quantized neural network. The inequality constraints represent the activation function in the feedforward topology of the quantized neural network. The encoded optimization variables are obtained by encoding the optimization variables using binary representation rules.

[0038] In a possible implementation, the inequality constraints include constraints on the same sign of the values ​​before and after activation of each layer and constraints when boundary conditions are met.

[0039] In a possible implementation, the optimization variables include: the quantization weight of each layer in the quantized neural network, the quantization bias of each layer, the value of each layer before activation, the value of each layer after activation, and the predicted value of the sample.

[0040] In a possible implementation, the problem conversion module is used to:

[0041] Construct an augmented Lagrangian function for the objective function and constraints in a quadratic constrained binary optimization problem.

[0042] The augmented Lagrangian function is reduced in degree using the Rosenberg method and transformed into a quadratic unconstrained binary optimization problem.

[0043] In a possible implementation, an augmented Lagrangian function is constructed for the objective function and constraints in the quadratic constrained binary optimization problem, including:

[0044] Multiply the difference between the two ends of the equality constraint by the Lagrange multiplier for the equality constraint to obtain a penalty term for the equality constraint and add it to the objective function;

[0045] Multiply the difference between the two ends of the inequality constraint by the Lagrange multiplier for the inequality constraint to obtain a first-order penalty term for the inequality constraint and add it to the objective function;

[0046] Introduce a penalty coefficient for the equality constraint, multiply the square of the difference between the two ends of the equality constraint by the penalty coefficient for the equality constraint, and obtain a quadratic penalty term for the equality constraint, which is added to the objective function;

[0047] Introduce the penalty coefficient for the inequality constraint, multiply the square of the difference between the two ends of the inequality constraint by the penalty term for the inequality constraint, and obtain the quadratic penalty term for the inequality constraint, which is added to the objective function;

[0048] The first-order penalty term and the second-order penalty term for the equality constraint and the inequality constraint are added to the objective function to construct the augmented Lagrangian function.

[0049] In a possible implementation, the coefficient updating module is used to:

[0050] The Lagrange multipliers for the equality constraints and the Lagrange multipliers for the inequality constraints are updated based on the solution results.

[0051] In a possible implementation, the Lagrange multipliers for the equality constraints and the Lagrange multipliers for the inequality constraints are updated based on the solution results, including:

[0052] Determine the value of the difference between the two ends of the equality constraint and the value of the difference between the two ends of the inequality constraint based on the solution result;

[0053] The Lagrange multiplier for the equality constraint is updated to the product of the difference between the two ends of the equality constraint term and the penalty coefficient for the equality constraint and the sum of the original Lagrange multiplier for the equality constraint;

[0054] When the product of the difference between the two ends of the inequality constraint term and the penalty coefficient for the inequality constraint is not greater than 0, the Lagrange multiplier for the inequality constraint is updated to the sum of the product of the difference between the two ends of the inequality constraint term and the penalty coefficient for the inequality constraint and the original Lagrange multiplier for the inequality constraint; otherwise, the Lagrange multiplier for the inequality constraint is updated to 0.

[0055] According to another aspect of the present application, a multi-layer feedforward neural network training system for an Ising machine is provided. The system comprises:

[0056] A host, used for modeling the supervised learning of a multi-layer feedforward quantized neural network as a quadratic constrained binary optimization problem; constructing an augmented Lagrangian function based on the quadratic constrained binary optimization problem, reducing the order of the augmented Lagrangian function, and converting it into a quadratic unconstrained binary optimization problem; sending the quadratic unconstrained binary optimization problem to be solved to an Ising machine for solving; receiving the solution result sent by the Ising machine, updating the coefficients in the augmented Lagrangian function based on the solution result, converting it into a new quadratic unconstrained binary optimization problem and sending it to the Ising machine again for solving, iterating the above steps, and obtaining the optimal solution of the quadratic constrained binary optimization problem after the constraints are satisfied and the objective function converges; decoding the optimal solution to obtain the parameters of the trained multi-layer feedforward neural network;

[0057] The Ising machine is used to solve the quadratic unconstrained binary optimization problem sent by the host and send the solution results to the host.

[0058] According to another aspect of the present application, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0059] According to another aspect of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.

[0060] According to another aspect of the present application, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0061] According to the embodiment of the present application, the supervised learning of the multi-layer feedforward quantized neural network is modeled as a quadratic constrained binary optimization problem; based on the quadratic constrained binary optimization problem, an augmented Lagrangian function is constructed, and the augmented Lagrangian function is reduced to a quadratic unconstrained binary optimization problem; the quadratic unconstrained binary optimization problem is solved on an Ising machine, and the coefficients in the augmented Lagrangian function are updated based on the solution result, and a new quadratic unconstrained binary optimization problem is obtained and solved, and after the constraints are satisfied and the objective function converges, the optimal solution of the quadratic constrained binary optimization problem is obtained; the optimal solution is decoded to obtain the parameters of the trained multi-layer feedforward neural network. This application can reduce the use of spin numbers, simplify the difficulty of problem solving, make real machine solving easier, and solve large-scale problems.

[0062] In this application, an augmented Lagrangian function is constructed based on a quadratic constrained binary optimization problem. Different from the method of constructing a penalty function, in the penalty function method, it is necessary to convert all inequality constraints into equality constraints to establish a penalty function, and two types of auxiliary variables need to be introduced when converting inequality constraints into equality constraints. In this application, there is no need to convert inequality constraints into equality constraints, and the augmented Lagrangian function can be directly established using inequality constraints. Since the augmented Lagrangian function method is used, there is no need to introduce auxiliary variables in the expression of inequality constraints, which can significantly reduce the use of spin numbers. Since in the existing Ising machine, the main bottleneck is the number of available spins, the calculation time is also affected by the use of spin numbers. According to the augmented Lagrangian function method and inequality constraint expression of the embodiment of the present application, the time and space complexity of solving on the Ising machine can be further reduced compared to the method using the penalty function.

[0063] Other features and aspects of the present application will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the present application and, together with the description, serve to explain the principles of the present application.

[0065] Figure 1 A multi-layer feedforward neural network training framework diagram for an Ising machine according to an embodiment of the present application is shown.

[0066] Figure 2 A flowchart of a multi-layer feedforward neural network training method for an Ising machine according to an embodiment of the present application is shown.

[0067] Figure 3 A structural diagram of a multi-layer quantized neural network according to an embodiment of the present application is shown.

[0068] Figure 4 A structural diagram of a multi-layer feedforward neural network training device for an Ising machine according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0069] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0070] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0071] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.

[0072] At present, the huge computational cost of training deep neural networks has become a key bottleneck in the development of artificial intelligence. The traditional gradient-based back-propagation training method encounters many problems such as gradient vanishing and falling into local optimality. This training method requires a large number of graphics processing units (GPUs) to efficiently update the model. As a dedicated quantum computer, Ising machines have achieved a large number of spin bits, showing the potential possibility of training neural networks on Ising machines. So far, Ising machines have been used for some machine learning tasks, such as training support vector machines and clustering models. At the same time, in the field of neural networks, Ising machines can be used to train Boltzmann machines and dynamic energy networks, neither of which belongs to feedforward networks. Due to the powerful representation ability, fast reasoning ability and flexible connection structure of feedforward networks, multi-layer feedforward networks are the most widely used type of neural networks in industry. The existing Ising machine algorithm occupies a large number of quantum spin bits during the training of the neural network, which makes the Ising machine computationally intensive and difficult to solve. Therefore, how to reduce the computational complexity of the Ising machine and simplify the difficulty of problem solving is a problem that this application needs to solve.

[0073] In view of this, the present application provides a multi-layer feedforward neural network training method and system for Ising machine. The multi-layer feedforward neural network training method for Ising machine of the embodiment of the present application is to model the supervised learning of the multi-layer feedforward quantized neural network as a quadratic constrained binary optimization problem; construct an augmented Lagrangian function based on the quadratic constrained binary optimization problem, reduce the order of the augmented Lagrangian function, and convert it into a quadratic unconstrained binary optimization problem; solve the quadratic unconstrained binary optimization problem on the Ising machine, update the coefficients in the augmented Lagrangian function based on the solution result, and convert it into a new quadratic unconstrained binary optimization problem and solve it. After the constraints are satisfied and the objective function converges, the optimal solution of the quadratic constrained binary optimization problem is obtained; the optimal solution is decoded to obtain the parameters of the trained multi-layer feedforward neural network. According to this embodiment, the use of spin numbers is reduced, the difficulty of problem solving is simplified, and the real machine solution is easier, which can solve large-scale problems.

[0074] Figure 1FIG. 1 shows a multi-layer feedforward neural network training framework diagram for an Ising machine according to an embodiment of the present application. Figure 1 As shown, the method of the embodiment of the present application can be deployed in a multi-layer feedforward neural network training system, and the multi-layer feedforward neural network training system can be deployed in a terminal device or a server. The present application does not limit the type of terminal device or server.

[0075] The multi-layer feedforward neural network training system may include a host and an Ising machine, wherein the host (i.e., a processor in a terminal device or a server) may perform operations other than "solving a quadratic unconstrained binary optimization problem", and the Ising machine is used to solve a quadratic unconstrained binary optimization problem. In the multi-layer feedforward neural network training system, the supervised learning of the multi-layer feedforward quantized neural network model may be modeled as a quadratic constrained binary optimization problem, and converted to a quadratic unconstrained binary optimization problem; wherein, in the process of converting to a quadratic unconstrained binary optimization problem, the QNN may be expressed as a quadratic constrained binary optimization (QCBO) problem, and the QCBO problem may be converted to a quadratic unconstrained binary optimization (QUBO) problem through the Lagrangian function method and the Rosenberg reduction method.

[0076] The host can send the quadratic unconstrained binary optimization problem to be solved to the Ising machine for solution;

[0077] The Ising machine can solve the quadratic unconstrained binary optimization problem sent by the host, obtain the solution of the quadratic unconstrained binary optimization problem, and send the solution to the host;

[0078] The host can receive the solution results sent by the Ising machine, and based on the solution results, update the coefficients in the augmented Lagrangian function (i.e., Lagrangian multipliers), transform it into a new quadratic unconstrained binary optimization problem and send it to the Ising machine for solution again, iterate the above steps, and after the constraints are satisfied and the objective function converges, the optimal solution of the quadratic constrained binary optimization problem is obtained; finally, the host decodes the optimal solution of the quadratic constrained binary optimization problem to obtain the parameters of the trained multi-layer feedforward neural network. Thus, the training of the multi-layer feedforward neural network is realized.

[0079] Figure 2 FIG. 1 is a flow chart of a multi-layer feedforward neural network training method for an Ising machine according to an embodiment of the present application. Figure 2 As shown, the method may include:

[0080] Step S201 , modeling the supervised learning of the multi-layer feedforward quantized neural network as a quadratic constrained binary optimization problem.

[0081] Among them, the multi-layer feedforward quantized neural network (hereinafter referred to as quantized neural network) is a special form of the multi-layer feedforward neural network.

[0082] This step can be performed by the host, which can be any type of processor, such as a central processing unit (CPU), etc. The supervised learning of the multi-layer feedforward quantized neural network can be modeled as a quadratic constrained binary optimization problem (Quadratic Constrained Binary Optimization, QCBO) based on the training data set D and the quantized neural network (Quantized Neural Network, QNN) parameters θ.

[0083] It can be assumed that f is a multi-layer quantized neural network with quantization parameters θ, see Figure 3 , shows a structural diagram of a multi-layer quantized neural network according to an embodiment of the present application. Figure 3 As shown, 301 represents input layer neurons, 302 represents hidden layer neurons, and 303 represents output layer neurons.

[0084] The problem of supervised learning of multi-layer feedforward quantized neural networks can be expressed as:

[0085]

[0086] Among them, θ represents the quantized neural network parameters to be solved (i.e. Figure 3 Parameters of 301 to 303 in θ * represents the optimal quantized neural network parameters, N represents the size of the training data set, and the input and label of the i-th sample are x i ∈X n ,y i ∈Y m . Among them, L represents the total number of layers of the quantized neural network, and the symbol It represents a function composite operation, that is, the output of the previous layer of operation is used as the input of the next layer of operation. The operation of the kth layer is f (k) (x) = g(W (k) x+b (k) ), g is the activation function, W (k) represents the quantized weight of the kth layer, b (k) Represents the quantization bias of the kth layer.

[0087] In step S201, you can:

[0088] The supervised learning of multi-layer feedforward quantized neural network is modeled as a quadratic constrained binary optimization problem based on the loss function, inequality constraints, equality constraints and encoded optimization variables of the quantized neural network.

[0089] Among them, the objective function of the quadratic constrained binary optimization problem is the loss function of the quantized neural network, the equality constraint represents the linear transformation in the feedforward topology of the quantized neural network, the inequality constraint represents the activation function in the feedforward topology of the quantized neural network, and the encoded optimization variable is obtained by encoding the optimization variable using a binary representation rule.

[0090] Among them, the equality constraint corresponding to the linear transformation (which can be called linear constraint, indicating the linear transformation process in the feedforward process) can be:

[0091] W (k) a (k-1) +b (k) =s (k) ,

[0092] where s (k) is the value before activation of the kth layer, a (k-1) is the activated value of the k-1th layer.

[0093] The activation function can be a sign function, that is:

[0094]

[0095] Where x represents the input of the sign function.

[0096] The inequality constraints corresponding to the activation function (which may be called activation constraints, representing the transformation process of the activation function in the feedforward system) may include constraints on the same sign of the values ​​before and after activation of each layer and constraints on satisfying boundary conditions.

[0097] For the activation function, it can be modeled as the following two inequality constraints:

[0098]

[0099]

[0100] The first inequality constraint is the same-sign constraint for the values ​​before and after activation of each layer. It represents the activated value of the kth layer when the i-th sample is input. represents the value before activation of the kth layer when the i-th sample is input. This inequality constraint can make and Same number.

[0101] The second inequality constraint is the constraint when the boundary condition is satisfied, that is, the zero point constraint of the sign function. This inequality constraint can make the boundary condition (that is, when When is equal to 0, The value of is +1.

[0102] Different from the method using the penalty function, the method of the embodiment of the present application can directly use the above constraints to construct the augmented Lagrangian function in the future, without converting the above inequality constraints (same sign constraints and zero point constraints) into equality constraints before constructing the augmented Lagrangian function. Since it is not necessary to convert the above inequality constraints into equality constraints in the present application, there is no need to introduce auxiliary variables to help the conversion as in the method using the penalty function. Since the inequality constraints are directly used in the subsequent construction of the augmented Lagrangian function in the present application, there is no need to use auxiliary variables, and the use of the number of spin bits can also be reduced when the Ising machine is used to solve the problem in the future.

[0103] In the process of modeling the supervised learning of QNN as the QCBO problem, the loss function in supervised learning can be expressed as the mean squared error (MSE):

[0104]

[0105] in, is the predicted value of sample i.

[0106] In minimizing the mean square error L MSE , the above linear constraints and activation constraints should be satisfied for the 1st to L-1th layers of the model.

[0107] When minimizing L MSE When doing so, some of the aforementioned constraints must be met, which are listed in layers below.

[0108] For the first layer, the following linear constraints and activation constraints should be satisfied. The linear constraints represent the linear transformation process in the feedforward process, and the activation constraints represent the transformation process of the activation function in the feedforward system:

[0109]

[0110]

[0111]

[0112] For 2, 3, ..., L-1 layers, the following linear constraints and activation constraints should be satisfied:

[0113] W (k) a (k-1) +b (k) =s (k) ,

[0114]

[0115]

[0116] For the last layer of the model (i.e., layer L, network output layer), the linear constraints should be satisfied:

[0117]

[0118] Among them, W (L) represents the quantized weight of the Lth layer, represents the activated value of the L-1th layer when the i-th sample is input, b (L) Represents the quantization bias of the Lth layer.

[0119] The MSE loss function and all constraints described above constitute an optimization problem, where the objective function of the quadratic constrained binary optimization problem is the loss function of the quantized neural network (i.e., the MSE loss function described above).

[0120] The optimization variables (i.e., decision variables) of the QCBO problem include: the quantization weight of each layer in the quantized neural network, the quantization bias of each layer, the value before activation of each layer, the value after activation of each layer, and the predicted value of the sample. The optimization variables can be expressed as: L is the number of quantized neural network layers.

[0121] The optimization variables in the present application are also inconsistent with the optimization variables established in the method using the penalty function. In the present application, since there is no need to convert the inequality constraints into equality constraints in the constraint expression, the two types of auxiliary variables required in the method using the penalty function can be excluded from the optimization variables, which further reduces the number of spin bits compared to the method using the penalty function.

[0122] All optimization variables can be encoded with binary bits, and the value range of each bit is {0, 1}, corresponding to a spin on the Ising machine, so that the relationship between the optimization variables and the spin of the Ising machine can be established.

[0123] The coding schemes for all variables are listed below in a hierarchical manner.

[0124] For the first level, all decision variables include: Encoded by the following binary variables: The expressions of the variables are as follows:

[0125]

[0126]

[0127]

[0128]

[0129] in, The variable W can be represented (1) The binary encoding of Can represent variable b (1) The value of the jth bit in the binary code, Can represent variables The value of the jth bit in the binary code, Can represent variables, The binary encoding of .

[0130] The range of binary variables is:

[0131]

[0132]

[0133] For 2, 3, ..., L-1 layers, all decision variables include: Encoded by the following binary variables: The expressions of the variables are as follows:

[0134]

[0135]

[0136]

[0137] The range of binary variables is:

[0138]

[0139]

[0140] For the last layer, all decision variables include: Encoded by the following binary variables: The expressions of the variables are as follows:

[0141]

[0142]

[0143]

[0144] The range of binary variables is:

[0145]

[0146]

[0147] By using the encoded 01 variables as optimization variables, the QCBO problem for QNN training can be modeled.

[0148] In the embodiment of the present application, the training of the quantized neural network is defined as a quadratic constrained binary optimization problem through the above scheme. The present application directly uses inequality constraints in the QCBO problem, and there is no need to introduce auxiliary variables to convert the inequality constraints into equality constraints. Accordingly, the optimization variables of the QCBO problem can include no auxiliary variables, reduce the use of spin numbers, and reduce the bit width of the coefficient matrix. At the same time, the difficulty of solving subsequent problems is reduced at the application level, making it easier to solve using the Ising machine and making the solution more accurate.

[0149] Since the Ising machine is suitable for solving the QUBO problem without any constraints, the QCBO problem can be converted to the QUBO problem. Figure 2 :

[0150] Step S202: construct an augmented Lagrangian function based on a quadratic constrained binary optimization problem, reduce the order of the augmented Lagrangian function, and transform it into a quadratic unconstrained binary optimization problem.

[0151] The QCBO problem can be transformed into a QUBO problem by using the augmented Lagrangian function method and the Rosenberg reduction method. The augmented Lagrangian function method can be used to eliminate all constraints and construct an augmented Lagrangian function. The Rosenberg reduction method is used to reduce the Lagrangian function to obtain a quadratic loss function. The quadratic loss function composed of binary variables is a QUBO problem, which can be solved efficiently and quickly on an Ising machine.

[0152] In step S202, it is possible to:

[0153] According to the objective function and constraints in the quadratic constrained binary optimization problem, the augmented Lagrangian function is constructed; the augmented Lagrangian function is reduced in degree using the Rosenberg method and transformed into a quadratic unconstrained binary optimization problem.

[0154] This process can be implemented on a CPU.

[0155] In the process of constructing the augmented Lagrangian function for the objective function and constraints in the quadratic constrained binary optimization problem, we can:

[0156] Multiply the difference between the two ends of the equality constraint by the Lagrange multiplier for the equality constraint to obtain a penalty term for the equality constraint and add it to the objective function;

[0157] Multiply the difference between the two ends of the inequality constraint by the Lagrange multiplier for the inequality constraint to obtain a first-order penalty term for the inequality constraint and add it to the objective function;

[0158] Introduce a penalty coefficient for the equality constraint, multiply the square of the difference between the two ends of the equality constraint by the penalty coefficient for the equality constraint, and obtain a quadratic penalty term for the equality constraint, which is added to the objective function;

[0159] Introduce the penalty coefficient for the inequality constraint, multiply the square of the difference between the two ends of the inequality constraint by the penalty term for the inequality constraint, and obtain the quadratic penalty term for the inequality constraint, which is added to the objective function;

[0160] The first-order penalty term and the second-order penalty term for the equality constraint and the inequality constraint are added to the objective function to construct the augmented Lagrangian function.

[0161] The constructed augmented Lagrangian function can be expressed as:

[0162]

[0163] Among them, φ represents the set of equality constraints, φ j represents the difference between the two ends of the jth equality constraint, represents a penalty term for equality constraints; ψ represents the set of inequality constraints, ψ j represents the difference between the two ends of the jth inequality constraint, represents a penalty term for the inequality constraint; λ j represents the Lagrange multiplier of the jth equality constraint, μ j represents the Lagrange multiplier of the jth inequality constraint; represents the quadratic penalty term for the equality constraint, represents the quadratic penalty term for inequality constraints, ρ1 represents the penalty coefficient for equality constraints, and ρ2 represents the penalty coefficient for inequality constraints.

[0164] In the method using penalty function, the penalty coefficient of the penalty term is generally fixed, and when using the penalty function method to handle constraints, the penalty coefficient needs to be manually adjusted, which is very difficult. Different from the method using penalty function, in this application, ρ1 and ρ2 are fixed hyperparameters, while Lagrange multipliers μ and λ can be adjusted as needed, that is, μ and λ are variable and updated to make the optimization process more stable and efficient.

[0165] The above Rosenberg reduction method includes:

[0166] Determine the quadratic term factor with the highest frequency in the augmented Lagrangian function, and replace the quadratic term factor with an auxiliary binary variable; add the Rosenberg polynomial as a penalty term to the original loss function; iterate the Rosenberg reduction method until the augmented Lagrangian function is reduced to quadratic, obtain the quadratic loss function, and transform it into a quadratic unconstrained binary optimization problem.

[0167] Among them, the Rosenberg polynomial is:

[0168] h(u1,u2,v)=3v+u1u2-2u1v-2u2v

[0169] Among them, u1,u2,v∈{0,1}. u1u2 can represent the quadratic term factor with the highest frequency in the augmented Lagrangian function, and v can represent the auxiliary binary variable. In each iteration, it is determined in the augmented Lagrangian function that the product of the two variables u1 and u2 can be replaced by the auxiliary binary variable v, and the product is replaced by the auxiliary variable v. Then, the Rosenberg polynomial h(u1,u2,v) composed of u1, u2, and v is added to the original loss function as a penalty term, and a sufficiently large positive coefficient is assigned to the penalty term. This process is iterated until the loss function is reduced to quadratic.

[0170] Thus, the QCBO problem can be converted to the QUBO problem.

[0171] Step S203, solving the quadratic unconstrained binary optimization problem on the Ising machine.

[0172] The process of solving the problem on the Ising machine can be implemented on the quantum processing unit (QPU). The process of solving the quadratic unconstrained binary optimization problem on the Ising machine can be expressed as:

[0173] σ * =argmin σ L QUBO

[0174] Among them, the loss function L QUBO Through L lagrange The obtained value is σ * Is the solution obtained by Ising machine optimization. This problem can be solved on an Ising machine in a short time. Generally speaking, the time to solve the QUBO problem on an Ising machine is measured in milliseconds. The solution may include undecoded and optimized model parameters.

[0175] Step S204, based on the solution result, the coefficients in the augmented Lagrangian function are updated, and a new quadratic unconstrained binary optimization problem is obtained and solved. After the constraints are satisfied and the objective function converges, the optimal solution of the quadratic constrained binary optimization problem is obtained.

[0176] In the process of updating the coefficients in the augmented Lagrangian function based on the solution results, we can:

[0177] The Lagrange multipliers for the equality constraints and the Lagrange multipliers for the inequality constraints are updated based on the solution results.

[0178] The process of updating the Lagrange multipliers can be implemented on the CPU.

[0179] Among them, you can:

[0180] Based on the solution results, the values ​​of the difference between the two ends of the equality constraint and the value of the difference between the two ends of the inequality constraint are determined; the Lagrange multiplier for the equality constraint is updated to the product of the difference between the two ends of the equality constraint item and the penalty coefficient for the equality constraint and the sum of the original Lagrange multiplier for the equality constraint; when the product of the difference between the two ends of the inequality constraint item and the penalty coefficient for the inequality constraint is not greater than 0, the Lagrange multiplier for the inequality constraint is updated to the product of the difference between the two ends of the inequality constraint item and the penalty coefficient for the inequality constraint and the sum of the original Lagrange multiplier for the inequality constraint; otherwise, the Lagrange multiplier for the inequality constraint is updated to 0.

[0181] Since the solution results contain the values ​​of model parameters, and the equality constraints and inequality constraints also contain model parameters, the values ​​of model parameters obtained from the solution results can be substituted into the equality constraints φ in the augmented Lagrangian function. j , the inequality constraint ψ j , to determine the difference between the two ends of each equality constraint and each inequality constraint. For example, we can use σ * The equality constraint set v and the inequality constraint set ψ are obtained, and the Lagrange multipliers corresponding to each equality constraint and the Lagrange multipliers of the inequality constraint are updated.

[0182] Taking the update of the Lagrange multiplier corresponding to the jth equality constraint as an example, the update method can be expressed as:

[0183] λ j ←λ j +ρ1φ j

[0184] Among them, we can use the λ after substituting the solution j +ρ1φ j The value of is used as the value of the Lagrange multiplier corresponding to the updated j-th equality constraint, that is, λ j +ρ1φ j The value of replaces λ in the above augmented Lagrangian function j The value of .

[0185] Taking the update of the Lagrange multiplier corresponding to the jth inequality constraint as an example, the update method can be expressed as:

[0186] μ j ←max(0,μ j +ρ2ψ j )

[0187] Among them, we can use the max(0,μ j +ρ2ψ j ) as the value of the Lagrange multiplier corresponding to the updated j-th inequality constraint, that is, max(0,μ j +ρ2ψ j ) value, replacing μ in the above augmented Lagrangian function j The value of .

[0188] By updating and adjusting the Lagrange multipliers through the above process, it is possible to solve the QUBO problem on the Ising machine more quickly and accurately without manually adjusting the Lagrange multipliers.

[0189] If any constraints are not satisfied or the mean square error objective function has not converged, the next iteration is entered, that is, the subsequent steps are re-executed from "reducing the augmented Lagrangian function to a quadratic unconstrained binary optimization problem" until all constraints are satisfied and the mean square error objective function meets the convergence conditions. The convergence conditions can be arbitrarily selected as needed, such as when the number of iterations reaches a predetermined number.

[0190] Thus, the optimal solution to the quadratic constrained binary optimization problem can be obtained.

[0191] Step S205, decoding the optimal solution to obtain parameters of the trained multi-layer feedforward neural network.

[0192] Among them, when the augmented Lagrangian function meets the convergence condition, the solved σ * is the optimal solution to the quadratic constrained binary optimization problem. The decoding result obtained by decoding the optimal solution is the optimal quantized neural network parameters, which are the parameters of the trained multi-layer feedforward neural network. The decoding process can be expressed as:

[0193] θ * =decode(σ * )

[0194] Among them, “decode” means to convert the optimal solution σ * The decoding result obtained by decoding is the optimal quantized neural network parameter θ * .

[0195] Among them, the trained multi-layer feedforward neural network can run on any processor to perform inference tasks.

[0196] Reasoning tasks are, for example, handwritten digital image recognition problems, etc., and this application does not limit this. For example, for image recognition tasks, in the training phase, based on the image data set and the set network structure, the supervised learning of the multi-layer feedforward quantized neural network is modeled as a quadratic constrained binary optimization problem on the host, and an augmented Lagrangian function is constructed based on the quadratic constrained binary optimization problem, and the augmented Lagrangian function is reduced to a quadratic unconstrained binary optimization problem; the host sends the quadratic unconstrained binary optimization problem to be solved to the Ising machine for solution, and the Ising machine sends the solution result to the host after solving the quadratic unconstrained binary optimization problem and obtaining the solution result, and the host updates the coefficients in the augmented Lagrangian function based on the solution result, and the new quadratic unconstrained binary optimization problem is converted and sent to the Ising machine again for solution, and the above steps are iterated. After the constraints are satisfied and the objective function converges, the optimal solution of the quadratic constrained binary optimization problem can be obtained, and the optimal solution is decoded to obtain the parameters of the trained multi-layer feedforward neural network, and the training is completed to obtain the trained multi-layer feedforward neural network.

[0197] In the inference stage, the image to be recognized can be input into the trained multi-layer feedforward neural network, and the recognition result corresponding to the image to be recognized can be output.

[0198] In existing Ising machines, the main bottleneck is the number of available spins, and the computation time is also affected by the number of spins used. The method according to the embodiment of the present application can further reduce the number of spins by reducing the number of optimization variables, thereby reducing the time and space complexity of solving on the Ising machine.

[0199] According to the embodiment of the present application, the supervised learning of the multi-layer feedforward quantized neural network is modeled as a quadratic constrained binary optimization problem; based on the quadratic constrained binary optimization problem, an augmented Lagrangian function is constructed, and the augmented Lagrangian function is reduced to a quadratic unconstrained binary optimization problem; the quadratic unconstrained binary optimization problem is solved on an Ising machine, and the coefficients in the augmented Lagrangian function are updated based on the solution result, and a new quadratic unconstrained binary optimization problem is obtained and solved, and after the constraints are satisfied and the objective function converges, the optimal solution of the quadratic constrained binary optimization problem is obtained; the optimal solution is decoded to obtain the parameters of the trained multi-layer feedforward neural network. According to this embodiment, the use of spin numbers is reduced, the difficulty of problem solving is simplified, and the real machine solution is easier, which can solve large-scale problems.

[0200] Figure 4 FIG. 2 shows a structural diagram of a multi-layer feedforward neural network training device for an Ising machine according to an embodiment of the present application. Figure 4 As shown, the device comprises:

[0201] A task construction module 401 is used to model the supervised learning of the multi-layer feedforward quantized neural network as a quadratic constrained binary optimization problem;

[0202] A problem conversion module 402 is used to construct an augmented Lagrangian function based on a quadratic constrained binary optimization problem, reduce the order of the augmented Lagrangian function, and convert it into a quadratic unconstrained binary optimization problem;

[0203] An Ising machine solving module 403, used for solving a quadratic unconstrained binary optimization problem on an Ising machine;

[0204] A coefficient updating module 404 is used to update the coefficients in the augmented Lagrangian function based on the solution result, transform and solve a new quadratic unconstrained binary optimization problem, and obtain the optimal solution of the quadratic constrained binary optimization problem after the constraints are satisfied and the objective function converges;

[0205] The parameter decoding module 405 is used to decode the optimal solution to obtain the parameters of the trained multi-layer feedforward neural network.

[0206] In a possible implementation, the task construction module 401 is used to:

[0207] Based on the loss function, inequality constraints, equality constraints and encoded optimization variables of the quantized neural network, the supervised learning of the multi-layer feedforward quantized neural network is modeled as a quadratic constrained binary optimization problem. The objective function of the quadratic constrained binary optimization problem is the loss function of the quantized neural network. The equality constraints represent the linear transformation in the feedforward topology of the quantized neural network. The inequality constraints represent the activation function in the feedforward topology of the quantized neural network. The encoded optimization variables are obtained by encoding the optimization variables using binary representation rules.

[0208] In a possible implementation, the inequality constraints include constraints on the same sign of the values ​​before and after activation of each layer and constraints when boundary conditions are met.

[0209] In a possible implementation, the optimization variables include: the quantization weight of each layer in the quantized neural network, the quantization bias of each layer, the value of each layer before activation, the value of each layer after activation, and the predicted value of the sample.

[0210] In a possible implementation, the question conversion module 402 is used to:

[0211] Construct an augmented Lagrangian function for the objective function and constraints in a quadratic constrained binary optimization problem.

[0212] The augmented Lagrangian function is reduced in degree using the Rosenberg method and transformed into a quadratic unconstrained binary optimization problem.

[0213] In a possible implementation, an augmented Lagrangian function is constructed for the objective function and constraints in the quadratic constrained binary optimization problem, including:

[0214] Multiply the difference between the two ends of the equality constraint by the Lagrange multiplier for the equality constraint to obtain a penalty term for the equality constraint and add it to the objective function;

[0215] Multiply the difference between the two ends of the inequality constraint by the Lagrange multiplier for the inequality constraint to obtain a first-order penalty term for the inequality constraint and add it to the objective function;

[0216] Introduce a penalty coefficient for the equality constraint, multiply the square of the difference between the two ends of the equality constraint by the penalty coefficient for the equality constraint, and obtain a quadratic penalty term for the equality constraint, which is added to the objective function;

[0217] Introduce the penalty coefficient for the inequality constraint, multiply the square of the difference between the two ends of the inequality constraint by the penalty term for the inequality constraint, and obtain the quadratic penalty term for the inequality constraint, which is added to the objective function;

[0218] The first-order penalty term and the second-order penalty term for the equality constraint and the inequality constraint are added to the objective function to construct the augmented Lagrangian function.

[0219] In a possible implementation, the coefficient updating module 404 is used to:

[0220] The Lagrange multipliers for the equality constraints and the Lagrange multipliers for the inequality constraints are updated based on the solution results.

[0221] In a possible implementation, the Lagrange multipliers for the equality constraints and the Lagrange multipliers for the inequality constraints are updated based on the solution results, including:

[0222] Determine the value of the difference between the two ends of the equality constraint and the value of the difference between the two ends of the inequality constraint based on the solution result;

[0223] The Lagrange multiplier for the equality constraint is updated to the product of the difference between the two ends of the equality constraint term and the penalty coefficient for the equality constraint and the sum of the original Lagrange multiplier for the equality constraint;

[0224] When the product of the difference between the two ends of the inequality constraint term and the penalty coefficient for the inequality constraint is not greater than 0, the Lagrange multiplier for the inequality constraint is updated to the product of the difference between the two ends of the inequality constraint term and the penalty coefficient for the inequality constraint and the sum of the original Lagrange multiplier for the inequality constraint; otherwise, the Lagrange multiplier for the inequality constraint is updated to 0.

[0225] In a possible implementation, the Rosenberg downscaling method includes:

[0226] Determine the quadratic term factor with the highest frequency in the augmented Lagrangian function and replace the quadratic term factor with an auxiliary binary variable;

[0227] Add the Rosenberg polynomial as a penalty term to the original loss function;

[0228] The Rosenberg reduction method is iterated until the augmented Lagrangian function is reduced to quadratic, which is transformed into a quadratic unconstrained binary optimization problem.

[0229] According to the embodiment of the present application, the supervised learning of the multi-layer feedforward quantized neural network is modeled as a quadratic constrained binary optimization problem; based on the quadratic constrained binary optimization problem, an augmented Lagrangian function is constructed, and the augmented Lagrangian function is reduced to a quadratic unconstrained binary optimization problem; the quadratic unconstrained binary optimization problem is solved on an Ising machine, and the coefficients in the augmented Lagrangian function are updated based on the solution result, and a new quadratic unconstrained binary optimization problem is obtained and solved, and after the constraints are satisfied and the objective function converges, the optimal solution of the quadratic constrained binary optimization problem is obtained; the optimal solution is decoded to obtain the parameters of the trained multi-layer feedforward neural network. According to this embodiment, the use of spin numbers is reduced, the difficulty of problem solving is simplified, and the real machine solution is easier, which can solve large-scale problems.

[0230] According to another aspect of the present application, a multi-layer feedforward neural network training system for an Ising machine is provided. The system comprises:

[0231] A host, used for modeling the supervised learning of a multi-layer feedforward quantized neural network as a quadratic constrained binary optimization problem; constructing an augmented Lagrangian function based on the quadratic constrained binary optimization problem, reducing the order of the augmented Lagrangian function, and converting it into a quadratic unconstrained binary optimization problem; sending the quadratic unconstrained binary optimization problem to be solved to an Ising machine for solving; receiving the solution result sent by the Ising machine, updating the coefficients in the augmented Lagrangian function based on the solution result, converting it into a new quadratic unconstrained binary optimization problem and sending it to the Ising machine again for solving, iterating the above steps, and obtaining the optimal solution of the quadratic constrained binary optimization problem after the constraints are satisfied and the objective function converges; decoding the optimal solution to obtain the parameters of the trained multi-layer feedforward neural network;

[0232] The Ising machine is used to solve the quadratic unconstrained binary optimization problem sent by the host and send the solution results to the host.

[0233] According to another aspect of the present application, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0234] According to another aspect of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.

[0235] According to another aspect of the present application, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0236] Various aspects of the present application are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0237] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0238] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0239] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the function involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs the function or action of the specification, or can be realized by a combination of special-purpose hardware and computer instructions.

[0240] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A multi-layer feedforward neural network training method for an Ising machine, characterized in that: The method comprises: Model the supervised learning of multi-layer feedforward quantized neural networks as a quadratic constrained binary optimization problem; Constructing an augmented Lagrangian function based on the quadratic constrained binary optimization problem, reducing the order of the augmented Lagrangian function to transform it into a quadratic unconstrained binary optimization problem; Solving the quadratic unconstrained binary optimization problem on an Ising machine; Based on the solution result, the coefficients in the augmented Lagrangian function are updated, and a new quadratic unconstrained binary optimization problem is obtained and solved, and after the constraints are satisfied and the objective function converges, the optimal solution of the quadratic constrained binary optimization problem is obtained; The optimal solution is decoded to obtain parameters of the trained multi-layer feedforward neural network.

2. The method according to claim 1, characterized in that The supervised learning of the multi-layer feedforward quantized neural network is modeled as a quadratic constrained binary optimization problem, including: Based on the loss function of the quantized neural network, inequality constraints, equality constraints and encoded optimization variables, the supervised learning of the multi-layer feedforward quantized neural network is modeled as a quadratic constrained binary optimization problem, the objective function of the quadratic constrained binary optimization problem is the loss function of the quantized neural network, the equality constraints represent the linear transformation in the feedforward topology of the quantized neural network, the inequality constraints represent the activation function in the feedforward topology of the quantized neural network, and the encoded optimization variables are obtained by encoding the optimization variables using binary representation rules.

3. The method according to claim 2, characterized in that The inequality constraints include constraints on the same sign of the values ​​before and after activation of each layer and constraints when boundary conditions are met.

4. The method according to claim 2, characterized in that: The optimization variables include: the quantization weight of each layer in the quantized neural network, the quantization bias of each layer, the value of each layer before activation, the value of each layer after activation, and the predicted value of the sample.

5. The method according to claim 2, characterized in that: The method of constructing an augmented Lagrangian function based on the quadratic constrained binary optimization problem and reducing the order of the augmented Lagrangian function to convert it into a quadratic unconstrained binary optimization problem includes: Constructing an augmented Lagrangian function for the objective function and constraints in the quadratic constrained binary optimization problem; The augmented Lagrangian function is reduced in degree using the Rosenberg method and converted into a quadratic unconstrained binary optimization problem.

6. The method according to claim 5, characterized in that The method of constructing an augmented Lagrangian function for the objective function and the constraint conditions in the quadratic constrained binary optimization problem includes: Multiply the difference between the two ends of the equality constraint by the Lagrange multiplier for the equality constraint to obtain a penalty term for the equality constraint and add it to the objective function; Multiply the difference between the two ends of the inequality constraint by the Lagrange multiplier for the inequality constraint to obtain a first-order penalty term for the inequality constraint and add it to the objective function; Introduce a penalty coefficient for the equality constraint, multiply the square of the difference between the two ends of the equality constraint by the penalty coefficient for the equality constraint, and obtain a quadratic penalty term for the equality constraint, which is added to the objective function; Introduce the penalty coefficient for the inequality constraint, multiply the square of the difference between the two ends of the inequality constraint by the penalty term for the inequality constraint, and obtain the quadratic penalty term for the inequality constraint, which is added to the objective function; The first-order penalty term and the second-order penalty term for the equality constraint and the inequality constraint are added to the objective function to construct an augmented Lagrangian function.

7. The method according to claim 6, characterized in that The updating of the coefficients in the augmented Lagrangian function based on the solution result comprises: The Lagrange multipliers for the equality constraints and the Lagrange multipliers for the inequality constraints are updated based on the solution results.

8. The method according to claim 7, characterized in that The updating of the Lagrange multipliers for the equality constraints and the Lagrange multipliers for the inequality constraints based on the solution results includes: Determine the value of the difference between the two ends of the equality constraint and the value of the difference between the two ends of the inequality constraint based on the solution result; The Lagrange multiplier for the equality constraint is updated to the product of the difference between the two ends of the equality constraint term and the penalty coefficient for the equality constraint and the sum of the original Lagrange multiplier for the equality constraint; When the product of the difference between the two ends of the inequality constraint term and the penalty coefficient for the inequality constraint is not greater than 0, the Lagrange multiplier for the inequality constraint is updated to the sum of the product of the difference between the two ends of the inequality constraint term and the penalty coefficient for the inequality constraint and the original Lagrange multiplier for the inequality constraint; otherwise, the Lagrange multiplier for the inequality constraint is updated to 0.

9. A multi-layer feedforward neural network training device for an Ising machine, characterized in that: The device comprises: A task building module for modeling supervised learning of multi-layer feedforward quantized neural networks as a quadratic constrained binary optimization problem; A problem conversion module, used for constructing an augmented Lagrangian function based on the quadratic constrained binary optimization problem, reducing the order of the augmented Lagrangian function and converting it into a quadratic unconstrained binary optimization problem; An Ising machine solving module, used for solving the quadratic unconstrained binary optimization problem on an Ising machine; A coefficient updating module is used to update the coefficients in the augmented Lagrangian function based on the solution result, transform and solve a new quadratic unconstrained binary optimization problem, and obtain the optimal solution of the quadratic constrained binary optimization problem after the constraints are satisfied and the objective function converges; The parameter decoding module is used to decode the optimal solution to obtain the parameters of the trained multi-layer feedforward neural network.

10. A multi-layer feedforward neural network training system for an Ising machine, characterized in that: The system comprises: A host, used for modeling the supervised learning of a multi-layer feedforward quantized neural network as a quadratic constrained binary optimization problem; constructing an augmented Lagrangian function based on the quadratic constrained binary optimization problem, reducing the order of the augmented Lagrangian function, and converting it into a quadratic unconstrained binary optimization problem; sending the quadratic unconstrained binary optimization problem to be solved to an Ising machine for solving; receiving the solution result sent by the Ising machine, updating the coefficients in the augmented Lagrangian function based on the solution result, converting it into a new quadratic unconstrained binary optimization problem and sending it to the Ising machine again for solving, iterating the above steps, and obtaining the optimal solution of the quadratic constrained binary optimization problem after the constraints are satisfied and the objective function converges; decoding the optimal solution to obtain the parameters of the trained multi-layer feedforward neural network; The Ising machine is used to solve the quadratic unconstrained binary optimization problem sent by the host and send the solution results to the host.

11. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the method described in any one of claims 1 to 9 when executing the instructions stored in the memory.

12. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.

13. A computer program product comprising computer readable code, or a non-volatile computer readable storage medium carrying computer readable code, characterized in that: When the computer readable code runs in a processor of an electronic device, the processor in the electronic device executes the method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Method and system for quickly partitioning power network after power failure based on coherent Isin machine

    CN119761058A

  • Coherent Isin machine, model parameter optimization method and device thereof, medium and product

    CN120745864A

  • Multi-layer feedforward neural network training method and system for ising machine

    WO2025087062A1