Data processing method for neural network training, and quantum computing device and medium
Patent Information
- Application Number
- PCT/CN2025/096296
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-06
- Filing Date
- 2025-05-21
- Publication Date
- 2025-12-11
Smart Images

Figure CN2025096296_11122025_PF_FP_ABST
Abstract
Description
Data processing method for neural network training, quantum computing device and medium TECHNICAL FIELD
[0001] The present application belongs to the technical field of quantum computing and artificial intelligence, and specifically relates to a data processing method for neural network training, a quantum computing device and a computer readable storage medium. BACKGROUND
[0002] In existing neural network training techniques, the processing method for any activation function and loss function mainly relies on the back propagation algorithm and the gradient descent technique or its variants. The selection of the activation function and the loss function has an important influence on the performance of the network and the training process. The nonlinear transformation of the activation function helps the network to learn and represent complex data patterns. The loss function measures the deviation between the predicted value and the actual value, and is the target to be minimized in the training process.
[0003] Regardless of the type of activation function and loss function used, the core technology of training is usually back propagation and gradient descent. The back propagation algorithm propagates errors through the network layers in reverse, calculating the contribution of each weight to the final output error, while the gradient descent is used to update the weights according to these gradients. A training method based on quantum computing is to generate a deep belief network (DBN) for generative training, train a generative DBN model using techniques such as contrastive divergence (CD), and then fine-tune the weights using methods such as back propagation. The existing method significantly increases the required computing resources and training time when processing large data sets and complex network structures, resulting in a large amount of computation and low efficiency. SUMMARY
[0004] In view of the above analysis, the embodiments of the present application aim to provide a data processing method for neural network training, a quantum computing device and a computer readable storage medium to solve the problem of low efficiency caused by large computation in existing neural network training.
[0005] In a first aspect of the present application, a data processing method for neural network training is provided, comprising:
[0006] dividing the activation function and the loss function in the neural network into multiple segments, each segment being represented by a corresponding piecewise polynomial function;
[0007] discretizing the continuous parameters in the neural network into a combination of binary variables;
[0008] constructing an objective function based on the piecewise polynomial function, the objective function being a quadratic function with respect to the binary variables, and constructing a QUBO model for the neural network training problem;
[0009] transforming a constraint condition in the neural network training into a penalty function, adding the penalty function into the objective function, and transforming the problem with constraints into an unconstrained 0-1 programming problem;
[0010] solving the QUBO model to obtain a solution of the neural network training problem.
[0011] Optionally, the solving the QUBO model to obtain a solution of the neural network training problem comprises:
[0012] transforming the QUBO model into an Ising model and a maximum cut problem;
[0013] obtaining a ground state of the Ising model by quantum computing, finding a solution of the maximum cut problem, and obtaining a solution of the neural network training problem.
[0014] Optionally, the solving the QUBO model to obtain a solution of the neural network training problem comprises:
[0015] solving the QUBO model by a data processing apparatus for neural network training to obtain a solution of the neural network training problem.
[0016] Optionally, the data processing apparatus for neural network training is a computer.
[0017] Optionally, the computer is a quantum computer.
[0018] The quantum computer is an optical quantum computer.
[0019] Optionally, the quantum computer is a coherent Ising machine.
[0020] Optionally, the coherent Ising machine is implemented by a hybrid quantum computing system of a degenerate optical parametric oscillator, and the hybrid quantum computing system comprises an optical part and an electrical part.
[0021] The optical part comprises a laser, an amplifier, a periodically poled lithium niobate crystal, and an optical fiber loop; the laser light emitted by the laser is amplified by the amplifier, and then frequency-doubled by the periodically poled lithium niobate crystal to serve as a pump source to synchronously pump the optical fiber loop to form a degenerate optical parametric oscillator; the electrical part comprises an FPGA, a digital-analog / analog-digital converter, and a phase detector; the laser light output from the optical fiber loop and the laser light of the base frequency are measured by the phase detector to test the phase of the output light; the FPGA and the digital-analog / analog-digital converter are used for measuring and feedback controlling the optical pulse.
[0022] The pump light is incident on a nonlinear optical crystal to divide into two beams of light, the polarization directions of the two beams of light are the same, the frequencies of the two beams of light are half of the pump light, and the two beams of light are in a squeezed state as a quantum bit; the power of the pump light is gradually increased, and when the power exceeds an oscillation threshold, the generated light becomes a coherent state, and the phase of the light is divided into two states: a phase 0 state and a pi state, and the phase is set as the spin +1 and-1 to solve an optimization problem.
[0023] Optionally, the solving the QUBO model to obtain a solution to the neural network training problem comprises:
[0024] The QUBO model is solved by using a QAOA quantum circuit to obtain a solution to the neural network training problem.
[0025] Optionally, the solving the QUBO model to obtain a solution to the neural network training problem comprises:
[0026] A QAOA quantum circuit is built, and the circuit contains parameters of training; the quantum circuit includes two types of unitary transformations: U(C, gamma) = e -iγC and U(B, beta) = e -iβB ; C represents a Hamiltonian, gamma represents a real number parameter related to the Hamiltonian, B represents a driving Hamiltonian, and beta represents a real number parameter related to the driving Hamiltonian.
[0027] The parameters in the circuit are initialized; and a quantum state is initialized.
[0028] The quantum circuit is run to obtain a quantum state.
[0029] The quantum state is used to calculate a target function value and an expected value of the Hamiltonian.
[0030] For the same set of parameters gamma and beta, the quantum state is repeatedly measured multiple times to obtain a distribution of the quantum state.
[0031] After obtaining the distribution of the quantum state, an optimized parameter combination is selected.
[0032] Based on a quantum measurement result obtained based on the optimized parameter combination, a solution to the neural network training problem is obtained.
[0033] Optionally, the segment is a linear segment, and the piecewise polynomial function is a piecewise linear function.
[0034] Optionally, the target function is a quadratic function with respect to the binary variable, and the neural network training problem is constructed into a QUBO model by constructing the target function based on the piecewise polynomial function.
[0035] The optimization problem is represented as:
[0036] wherein, denotes the output of the Lth (last) layer at training sample x;
[0037] denotes the output of the jth neuron of the lth layer at training sample x;
[0038] M i denotes the end point of the segment; y x denotes the target output value;
[0039] C(M i ,y x ) denotes the loss function, and denotes the approximation of the loss between the output of the last layer and the label y i if the output of the last layer is in the ith segment; x
[0040] For any variable τ, let β τ denote the 0-1 variable whether β τ is in the segment [M i , M i+1 ], then β τ satisfies the constraint condition:
[0041] denotes the binary variable when τ is ; and denotes the binary variable when τ is ; and
[0042] denotes the input of the jth neuron of the lth layer, and σ(·) denotes the activation function, denotes the input vector of the lth layer at training sample x, w l denotes the weight matrix, denotes the output vector of the lth-1 layer, and b l denotes the bias vector.
[0043] Optionally, the converting the constraint condition in the neural network training into a penalty function and adding the penalty function into the objective function to convert the constrained problem into an unconstrained 0-1 programming problem comprises:
[0044] The penalty function is used to convert the constrained problem into an unconstrained 0-1 programming problem, which is denoted as:
[0045] wherein the binary variable is denoted as:
[0046] wherein, denotes the index of the bit, denote the binary representation of the corresponding subscript variable, denote the output of the jth neuron of the lth layer at the training sample x, denote the input of the jth neuron of the lth layer, denote the weight connecting the jth neuron of the (l-1)th layer and the kth neuron of the lth layer, denote the bias of the jth neuron of the lth layer.
[0047] Optionally, the constructing the neural network training problem into a QUBO model comprises:
[0048] When the optimization problem of the neural network contains a high-order polynomial, the high-order polynomial is converted into a quadratic polynomial by using a Rosenberg polynomial;
[0049] For the product of any two 0-1 variables x1, x2, replace x1x2 with y, and add a polynomial 3y+x1x2-2x1y-2x2y in the objective function to ensure y=x1x2.
[0050] Optionally, the neural network is not limited to a binary neural network.
[0051] In a second aspect of the present application, a quantum computing device is provided, comprising: a quantum processing unit, an electronic processing unit, and a storage unit;
[0052] The storage unit stores a computer program, and the computer program is executed by the quantum processing unit and the electronic processing unit to implement the data processing method for neural network training.
[0053] Optionally, the quantum processing unit is a coherent Ising machine, comprising an optical part and an electrical part;
[0054] The optical part comprises a laser, an amplifier, a periodically poled lithium niobate crystal, and an optical fiber loop; the laser emitted by the laser is amplified by the amplifier, and then frequency-doubled by the periodically poled lithium niobate crystal to serve as a pump source to synchronously pump the optical fiber loop to form a degenerate optical parametric oscillation; the electrical part comprises an FPGA, a digital-analog / digital-analog conversion, and a phase detector; the laser output from the optical fiber loop and the laser of the base frequency are measured by the phase detector to test the phase of the output light; the FPGA and the digital-analog / digital-analog conversion are used for measuring and feedback controlling the optical pulse;
[0055] The pump light is incident on the nonlinear optical crystal to divide into two beams of light, the polarization directions of the two beams of light are same, the frequencies of the two beams of light are half of the pump light, and the two beams of light are in a squeezed state as a quantum bit; the power of the pump light is gradually increased, and when the power exceeds an oscillation threshold, the generated light becomes a coherent state, and the phase of the light is divided into two states: a phase 0 state and a pi state, and the phase is set as the spin +1 and-1 to solve an optimization problem.
[0056] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data processing method for neural network training.
[0057] The data processing method for neural network training provided in the present application divides the activation function and the loss function in the neural network into multiple segments, and each segment is represented by a corresponding segmented polynomial function; the continuous parameters in the neural network are discretized into a combination of binary variables; a target function is constructed based on the segmented polynomial function, the target function is a quadratic function with respect to the binary variables, and the neural network training problem is constructed as a QUBO model; a constraint condition in the neural network training is converted into a penalty function, the penalty function is added to the target function, and the constrained problem is converted into an unconstrained 0-1 programming problem; the QUBO model is solved to obtain a solution to the neural network training problem. The method uses a segmented polynomial function to fit the activation function and the loss function, simplifies the calculation of the activation and loss functions, reduces the computational burden in the training process, and greatly improves the training efficiency. In addition, the present application also provides a quantum computing device and a computer-readable storage medium with the above technical effects. BRIEF DESCRIPTION OF DRAWINGS
[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art based on these drawings.
[0059] FIG. 1 is a flowchart of a specific embodiment of the data processing method for neural network training provided in the present application;
[0060] FIG. 2 is a process flowchart of solving the QUBO model by using the QAOA quantum circuit in the present application;
[0061] FIG. 3 is a structural block diagram of the quantum computing device provided in the present application. DETAILED DESCRIPTION
[0062] To make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. It should be noted that the embodiments and the features in the embodiments in the present disclosure can be combined, separated, interchanged and / or rearranged without conflict, if possible. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative labor fall within the scope of protection of the present application.
[0063] The terms used herein are for the purpose of describing specific embodiments and are not intended to be limiting. As used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Furthermore, to the extent that the terms "including" and / or "comprising" and variations thereof are used in either the detailed description or the claims, such terms are intended to be inclusive in a manner similar to the term "comprising" as an open transition term without precluding any additional or other elements.
[0064] A flowchart of one specific implementation of the data processing method for neural network training provided by the present application is shown in FIG. 1. The method includes:
[0065] S101: Divide the activation function and the loss function in the neural network into multiple segments, and each segment is represented by a corresponding piecewise polynomial function.
[0066] The activation function and the loss function in the neural network are divided into multiple segments, and a piecewise polynomial function is used to fit any activation function and loss function. As one specific implementation, the piecewise polynomial function is a piecewise linear function. The activation function and the loss function in the neural network can be divided into multiple linear segments, and a piecewise linear function is used to fit the activation function and the loss function to obtain a piecewise interpolation activation function. The specific method is to divide the function into multiple small straight line segments on the domain, and each small straight line segment is approximated by a linear function.
[0067] After the complex nonlinear function is divided into a combination of linear functions in a small range, the problem of additional bit number increase caused by high-order terms and order reduction in polynomial fitting can be avoided, thereby reducing the computational complexity. A good balance between computational efficiency and accuracy is achieved. In particular, when the activation function is a special case of the piecewise linear function such as Sign and ReLU, the fitting error is zero.
[0068] Further, the use of computing power is reduced in the quantum computing process, and the computing efficiency is improved.
[0069] S102: Discretize the continuous parameters in the neural network into combinations of binary variables.
[0070] Express the parameters of the neural network with binary variables. Each parameter (weight and bias) is discretized into several binary variables. In this way, a continuous optimization problem is transformed into an optimization problem containing only binary variables, thus adapting the format of the QUBO model.
[0071] S103: Construct a target function based on the piecewise polynomial function, which is a quadratic function with respect to the binary variables, and construct the neural network training problem into a QUBO model.
[0072] Express the loss function of the neural network with a quadratic polynomial. Specifically, assuming that the loss function can be decomposed into a linear combination of the weighted input and activation value of each layer, these combination terms can be expressed as a quadratic polynomial by introducing additional binary variables.
[0073] S104: Convert the constraint conditions in the neural network training into a penalty function, add the penalty function to the target function, and convert the constrained problem into an unconstrained 0-1 programming problem.
[0074] In order to ensure that the combination of binary variables meets the parameter range and connection relationship of the neural network, constraint conditions are introduced. These constraint conditions can also be expressed as a quadratic polynomial, and they are combined into the target function through the penalty function method.
[0075] S105: Solve the QUBO model to obtain the solution of the neural network training problem.
[0076] The present application can use a data processing device for neural network training to solve the QUBO model. The data processing device for neural network training can be a computer. As an optional implementation manner, the computer can be a quantum computer. The quantum computer can be implemented by using an optical quantum computer or a coherent Ising machine. It can be understood that other quantum computers can also be used for solving. Of course, the QAOA quantum circuit can also be used to solve the QUBO model, which does not affect the implementation of the present application.
[0077] The application adopts a segmented polynomial function to fit the activation function and the loss function, simplifies the calculation of the activation and loss functions, reduces the calculation burden in the training process, and greatly improves the training efficiency. Under this fitting method, each linear segment can be represented by a simple linear function, avoiding the appearance of higher-order terms in polynomial fitting and the increase in additional bit number caused by order reduction. When the activation function is in the form of Sign and ReLU, etc., these functions are special cases of segmented linear functions, and the fitting error brought by segmented linear fitting is 0.
[0078] In addition, the application converts the training problem of the neural network into a QUBO model, which can be further calculated by quantum computing, combining quantum computing with machine learning.
[0079] The problem model to be solved when training the neural network is as follows: the activation value of the jth neuron in the lth layer is related to the activation value of the (l-1)th layer through the following formula:
[0080] Here, σ ( · ) is the activation function, and the summation is performed on all neurons in the (l-1)th layer. In order to rewrite this expression in matrix form, define a weight matrix w l for each layer l. The elements of the weight matrix w l are exactly the weights connected to the neurons in the lth layer. More precisely, the element in the jth row and the kth column is Similarly, for each layer l, define a bias vector bl . Introduce a vectorization function σ ( · ) , which represents the application of a function to each element of a vector. Therefore, this equation can be expressed in the following concise matrix form: a l =σ(w l a l-1 +b l )
[0081] Introduce an intermediate quantity z l , which represents the weighted input of the neurons in the lth layer, z l =w l a l-1 +b l
[0082] wherein the jth element of z is
[0083] The training process of a neural network involves finding suitable values for the weights w and biases b, enabling the network to accurately predict or classify input data. The goal of training is to minimize a loss function C(·), which measures the difference between the network's output and the actual target. This optimization problem is formulated as follows:
[0084] Among them, let For input, y x The target output is x.
[0085] This application transforms the neural network training problem into a QUBO model. Using... These represent the lower and upper bounds of the input and output, respectively. This application can define the interval... Divided into:
[0086] Within each small segment, a linear function is used to approximate the activation function and the loss function. More specifically, for an arbitrary function f(·), a point (a, b) in a two-dimensional plane coordinate system is used. i ,f(a i )) and point (a i+1 ,f(a i+1 The line segments connecting the two sides are used to approximate f(·) in the interval [a]. i ,a i+1 The value of ] can be taken on the . Therefore, the optimization problem can be transformed into the following form:
[0087] in, This represents the output of the Lth (last) layer under training sample x;
[0088] This represents the output of the j-th neuron in the l-th layer under training sample x;
[0089] M i Indicates the endpoints of the segmented interval; y x Indicates the target output value;
[0090] C(M i ,y x ) represents the loss function, indicating that if the output of the last layer is in the i-th interval, then M is used. i and tag y x Approximate representation of the loss between;
[0091] For any variable τ, use the 0-1 variable β τ Indicates β τ Is it in the interval [M]? i M i+1 In the context of ], then βτ satisfying the constraint condition:
[0092] denotes a binary variable that τ is ; denotes a binary variable that τ is ;
[0093] denotes the input of the jth neuron of the lth layer, σ(·) denotes an activation function, denotes the input vector of the lth layer under the training sample x, w l denotes a weight matrix, denotes the output vector of the (l-1)th layer, b l denotes a bias vector.
[0094] The constraint term and the objective function in the above optimization problem are both polynomial functions of 0-1 variables. The present application converts the constraint condition in neural network training into a penalty function, and adds the penalty function to the objective function, thereby converting the constrained problem into an unconstrained 0-1 programming problem.
[0095] The penalty function is used to convert the constrained problem into an unconstrained 0-1 programming problem, which is represented as:
[0096] where the binary variables are as follows:
[0097] wherein, denotes the index of the bit, denotes the binary representation of the corresponding subscript variable, respectively, denotes the output of the jth neuron of the lth layer under the training sample x, denotes the input of the jth neuron of the lth layer, denotes the weight connecting the jth neuron of the (l-1)th layer and the kth neuron of the lth layer, denotes the bias of the jth neuron of the lth layer.
[0098] When the optimization problem of the neural network contains a high-order polynomial, the high-order polynomial is converted into a quadratic polynomial by using the Rosenberg polynomial.
[0099] The reduction of the order of the high-order optimization problem to quadratic by using the Rosenberg polynomial can be achieved by introducing auxiliary variables and constructing appropriate constraint polynomials. This process enables the high-order optimization problem to be represented by the QUBO model.
[0100] Specifically, for the product of any two 0-1 variables x1, x2, replace x1x2 with y, and add the polynomial 3y+x1x2-2x1y-2x2y to the objective function to ensure y=x1x2. This constraint is added to the objective function in the form of a penalty function, ensuring that y correctly reflects the value of x1x2 during optimization. This allows the original optimization problem containing high-order terms to be converted into a quadratic unconstrained binary optimization (QUBO) problem, which can be solved using QUBO solving methods.
[0101] It can be understood that the neural network in the present application is not limited to binary neural networks, and is applicable to neural networks with any activation function and loss function, expanding the application range of quantum computing in machine learning.
[0102] Solving the QUBO model to obtain a solution to the neural network training problem can specifically be: converting the QUBO model into an Ising model and a maximum cut problem; using quantum computing to obtain the ground state of the Ising model, finding the optimal solution to the maximum cut problem, and obtaining a solution to the neural network training problem.
[0103] Combining quantum computing with traditional machine learning methods can improve computational efficiency and solve complex problems. In this field, the advantages of quantum computing are introduced into machine learning models such as neural networks, providing new possibilities for solving large-scale data processing and optimization problems.
[0104] As a specific implementation, a quantum computer can be used to solve the QUBO model to obtain a solution to the neural network training problem. The quantum computer can be implemented using an optical quantum computer or a coherent Ising machine. It can be understood that other quantum computers can also be used for solving.
[0105] The coherent Ising machine is implemented by a hybrid quantum computing system of a degenerate optical parametric oscillator (DOPO), and the hybrid quantum computing system includes an optical part and an electrical part.
[0106] The optical part includes a laser, an amplifier, a periodically poled lithium niobate (PPLN) crystal, and an optical fiber loop. The laser is a femtosecond pulse fiber laser, the emitted laser is amplified by the amplifier, and then the frequency is doubled by the periodically poled lithium niobate crystal, which is used as a pump source to synchronously pump the optical fiber loop to form a degenerate optical parametric oscillation. There are hundreds of oscillation pulses in the optical fiber loop. The electrical part includes an FPGA (Field Programmable Gate Array), a digital-to-analog / analog-to-digital converter, and a phase detector. The output laser of the optical fiber loop and the base frequency laser are measured by the phase detector to test the phase of the output light. The FPGA and the digital-to-analog / analog-to-digital converter are used for measuring and feedback controlling the optical pulse.
[0107] The pump light is incident on the nonlinear optical crystal to divide into two beams, the polarization directions of the two beams are the same, the frequency is half of the pump light, and the two beams are in a squeezed state as a quantum bit; the power of the pump light is gradually increased, and when the power exceeds the oscillation threshold, the generated light becomes a coherent state, and the phase of the light is divided into two states: phase 0 state and π state. The phase is set as ±1 of the spin to solve the optimization problem.
[0108] As another specific embodiment, solving the QUBO model to obtain a solution of the neural network training problem includes: solving the QUBO model by using a QAOA quantum circuit to obtain a solution of the neural network training problem.
[0109] Specifically, the QUBO model is converted into an Ising model and a corresponding maximum cut problem. The objective function can be represented as maximizing Two rotation unitary matrices are defined: U(C, γ) = e -iγC and U(B, β) = e -iβB ; C represents a Hamiltonian, γ represents a real number parameter related to the Hamiltonian, B represents a driving Hamiltonian, and β represents a real number parameter related to the driving Hamiltonian. After repeating the operation p times, a new state can be obtained as follows:
[0110] |ψ(γ, β)> = |γ, β> = U(B, β p )U(Cγ p )…U(B, β2)U(C, γ2)U(B, β1)U(C, γ1)|ψ>
[0111] Referring to FIG. 2, the process flow diagram of the process of solving the QUBO model by using the QAOA quantum circuit according to the present application, the process includes the following steps:
[0112] S201: build a QAOA quantum circuit, wherein the circuit contains trained parameters.
[0113] S202: initialize the parameters in the circuit; initialize the quantum state.
[0114] Select initial parameter values γ and β. These parameters can be randomly selected or based on empirical initial values. Initialize all qubits to a uniform superposition state.
[0115] S203: run the quantum circuit to obtain a quantum state.
[0116] S204: use the quantum state to calculate the objective function value and the expected value of the Hamiltonian.
[0117] S205: repeat the measurement multiple times for the same set of parameters γ, β to obtain the distribution of quantum states.
[0118] Repeat steps S202-S204 several times, i.e. measure multiple times for the same set of parameters γ, β, to obtain the distribution of quantum states. Through multiple measurements and calculation of expected values, evaluate the optimization effect of the current parameters.
[0119] S206: after obtaining the distribution of quantum states, select the optimal parameter combination.
[0120] Optimize the parameters in the circuit using grid search. For a new set of parameters γ, β, repeat the results of steps S202-S205. After obtaining the distribution of quantum states, select the one with the maximum target value as the optimal parameter combination.
[0121] S207: based on the quantum measurement results obtained based on the optimized parameter combination, obtain the solution to the neural network training problem.
[0122] Using QAOA can effectively solve complex combinatorial optimization problems and provide approximate optimal solutions.
[0123] In addition, the present application also provides a quantum computing device, as shown in the structure block diagram of the quantum computing device provided by the present application, the device specifically comprises: a quantum processing unit 301, an electronic processing unit 302, and a storage unit 303.
[0124] The storage unit 303 stores a computer program, and the computer program is executed by the quantum processing unit 301 and the electronic processing unit 302 to realize the neural network training data processing method described above.
[0125] As a specific implementation, the quantum processing unit 301 can be a coherent Ising machine, including an optical part and an electrical part.
[0126] The optical part includes a laser, an amplifier, a periodically poled lithium niobate crystal and an optical fiber loop; the laser emitted by the laser is amplified by the amplifier, and then is doubled by the periodically poled lithium niobate crystal, and then is used as a pump source to synchronously pump the optical fiber loop to form a degenerate optical parametric oscillation; the electrical part includes an FPGA, a digital analog / analog-digital conversion and a phase detector; the laser output from the optical fiber loop and the laser of the base frequency are measured by the phase detector to test the phase of the output light; the FPGA and the digital analog / analog-digital conversion are used for measuring and feedback controlling the optical pulse.
[0127] The pump light is incident on the nonlinear optical crystal to divide into two beams of light, the polarization directions of the two beams of light are the same, the frequencies of the two beams of light are half of the pump light, and the two beams of light are in a squeezed state and are used as a quantum bit; the power of the pump light is gradually increased, and when the power exceeds an oscillation threshold, the generated light becomes a coherent state, and the phase of the light is divided into two states: a phase 0 state and a pi state; the phase is set as the spin +1 and-1 to solve an optimization problem.
[0128] The QUBO model optimization provided in the application, especially the implementation on a quantum computing platform, can effectively avoid the local minimum problem commonly found in traditional gradient methods. Quantum computing or special discrete optimization algorithms can improve the speed and efficiency of solving, especially greatly improving the computing efficiency when dealing with large-scale problems.
[0129] In addition, the application further provides a computer readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the neural network training data processing method described above.
[0130] It can be understood that the specific implementation process of the quantum computing device and the computer readable storage medium provided by the application is described above, and will not be repeated here.
[0131] Computer-readable storage media includes permanent and non-permanent, removable and non-removable media implemented by any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carriers.
[0132] The skilled person should further appreciate that the units and algorithm steps of various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of various examples have been described in general terms above as being functionally related. Whether the functions are performed in hardware or software depends on the particular application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0133] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.
[0134] The above specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A data processing method of neural network training, characterized by, The method comprises the following steps: dividing activation functions and loss functions in a neural network into multiple segments, each segment being represented by a corresponding piecewise polynomial function; discretizing continuous parameters in the neural network into combinations of binary variables; constructing an objective function based on the piecewise polynomial function, the objective function being a quadratic function with respect to the binary variables, and constructing a neural network training problem as a QUBO model; transforming constraint conditions in neural network training into penalty functions, adding the penalty functions to the objective function, and transforming the problem with constraints into an unconstrained 0-1 programming problem; solving the QUBO model to obtain a solution to the neural network training problem. 2.The data processing method of neural network training according to claim 1, characterized in that, The step of solving the QUBO model to obtain a solution to the neural network training problem comprises the following steps: transforming the QUBO model into an Ising model and a maximum cut problem; obtaining a ground state of the Ising model by quantum computing, finding a solution to the maximum cut problem, and obtaining a solution to the neural network training problem. 3.The data processing method of neural network training according to claim 1, characterized in that, The step of solving the QUBO model to obtain a solution to the neural network training problem comprises the following steps: using a data processing device for neural network training to solve the QUBO model and obtain a solution to the neural network training problem. 4.The data processing method of neural network training according to claim 3, characterized in that, The data processing device for neural network training is a computer.
5. The data processing method of neural network training according to claim 4, characterized in that, The computer is a quantum computer.
6. The data processing method of neural network training according to claim 5, wherein, The quantum computer is an optical quantum computer.
7. The data processing method of neural network training according to claim 5, wherein, The quantum computer is a coherent Ising machine.
8. The data processing method of neural network training according to claim 7, characterized in that, The coherent Ising machine is implemented by a hybrid quantum computing system of a degenerate optical parametric oscillator, and the hybrid quantum computing system comprises an optical part and an electrical part. The optical part comprises a laser, an amplifier, a periodically poled lithium niobate crystal, and an optical fiber loop; the laser light emitted by the laser is amplified by the amplifier, frequency-doubled by the periodically poled lithium niobate crystal, and then used as a pump source to synchronously pump the optical fiber loop to form a degenerate optical parametric oscillator; the electrical part comprises an FPGA, a digital-to-analog / analog-to-digital converter, and a phase detector; the laser light output from the optical fiber loop and the laser light of the base frequency are measured by the phase detector to test the phase of the output light; the FPGA and the digital-to-analog / analog-to-digital converter are used for measuring and feedback controlling the optical pulses; When pump light is incident on a nonlinear optical crystal, two beams of light are split from the pump light, the polarization directions of the two beams of light are the same, the frequencies of the two beams of light are half of the frequency of the pump light, and the two beams of light are in a squeezed state and serve as a quantum bit; the power of the pump light is gradually increased, and when the power exceeds an oscillation threshold, the generated light becomes a coherent state, and the phase of the light is divided into two states: a phase 0 state and a pi state; the phase is set as ±1 of a spin to solve an optimization problem. 9.The data processing method of neural network training according to claim 1, characterized in that, The step of solving the QUBO model to obtain a solution to the neural network training problem comprises the following steps: using a QAOA quantum circuit to solve the QUBO model and obtain a solution to the neural network training problem.
10. The data processing method of neural network training according to claim 9, characterized in that, The step of using a QAOA quantum circuit to solve the QUBO model and obtain a solution to the neural network training problem comprises the following steps: building a QAOA quantum circuit, wherein the circuit contains trained parameters; the quantum circuit includes two types of unitary transformations: U(C, γ) = e -iγC and U(B, β) = e -iβB ; C represents a Hamiltonian, γ represents a real number parameter related to the Hamiltonian, B represents a driving Hamiltonian, and β represents a real number parameter related to the driving Hamiltonian; initializing parameters in the circuit; initializing a quantum state; running the quantum circuit to obtain a quantum state; calculating an objective function value and an expected value of a Hamiltonian by using the quantum state; For the same set of parameters γ, β, multiple measurements are repeated to obtain the distribution of quantum states; After obtaining the distribution of quantum states, an optimized parameter combination is selected; Based on the quantum measurement result obtained by the optimized parameter combination, a solution to the neural network training problem is obtained.
11. The data processing method of neural network training according to any one of claims 1 to 10, characterized in that, The segment is a linear segment, and the piecewise polynomial function is a piecewise linear function.
12. The data processing method of neural network training according to any one of claims 1 to 10, characterized in that, The target function is a quadratic function with respect to the binary variable, and the neural network training problem is constructed as a QUBO model. The optimization problem is represented as: wherein represents the output of the Lth (last) layer under the training sample x; represents the output of the jth neuron of the lth layer under the training sample x; M i denotes the interval end point of a segment; y x denotes the target output value; C(M i ,y x ) represents a loss function that approximates the loss between the output of the last layer when it is in the i-th interval, M i , and the label y x . For any variable τ, let β τ denote a 0-1 variable representing whether β τ is in the interval [M i , M i+1 ]. Then β τ satisfies the constraint: represents τ is a binary variable for the time of day; represents τ is the binary variable when denotes the input of the jth neuron of the ith layer, and σ(·) denotes an activation function, denotes the input vector of the l-th layer under the training sample x, w l denotes the weight matrix, denotes the output vector of the l-1th layer, b l denotes the bias vector.
13. The data processing method of neural network training according to claim 12, characterized in that, The constraint condition in the neural network training is converted into a penalty function, and the penalty function is added to the target function, so that the constrained problem is converted into an unconstrained 0-1 programming problem. The penalty function is used to transform the constrained problem into an unconstrained 0-1 programming problem, which is expressed as: where the binary representation of the following variables are as follows: wherein an index representing a bit, respectively denote the binary representation of the corresponding subscript variable, denotes the output of the jth neuron of the lth layer at the training sample x, represents the input of the jth neuron of the ith layer, denotes the weight connecting the jth neuron of the (l-1)th layer and the kth neuron of the lth layer, represents the bias of the jth neuron of the lth layer.
14. The data processing method of neural network training according to claim 13, characterized in that, The neural network training problem is constructed as a QUBO model, which includes: When the optimization problem of the neural network contains a high-order polynomial, the high-order polynomial is converted into a quadratic polynomial by using the Rosenberg polynomial; For the product of any two 0-1 variables x1 and x2, replace x1x2 with y, and add the polynomial 3y+x1x2-2x1y-2x2y to the target function to ensure that y=x1x2.
15. The data processing method of neural network training according to any one of claims 1 to 10, characterized in that, The neural network is not limited to a binary neural network.
16. A quantum computing device, comprising: It includes: a quantum processing unit, an electronic processing unit, and a storage unit; The storage unit stores a computer program, which is executed by the quantum processing unit and the electronic processing unit to realize the data processing method for neural network training according to any one of claims 1-15.
17. The quantum computing device of claim 16, wherein, The quantum processing unit is a coherent Ising machine, which includes an optical part and an electrical part; The optical part includes a laser, an amplifier, a periodically poled lithium niobate crystal, and an optical fiber loop; the laser emitted by the laser is amplified by the amplifier, and then frequency-doubled by the periodically poled lithium niobate crystal to serve as a pump source to synchronously pump the optical fiber loop to form a degenerate optical parametric oscillation; the electrical part includes an FPGA, a digital-to-analog / analog-to-digital converter, and a phase detector; the laser output from the optical fiber loop and the laser of the base frequency are measured by the phase detector to test the phase of the output light; the FPGA and the digital-to-analog / analog-to-digital converter are used for measuring and feedback controlling the optical pulse; When the pump light is incident on the nonlinear optical crystal, two beams of light are emitted, the polarization directions of the two beams of light are the same, the frequency is half of the pump light, and the state is a squeezed state, which serves as a quantum bit; gradually increase the power of the pump light, and when it exceeds the oscillation threshold, the generated light becomes a coherent state, and the phase of the light is divided into two states: phase 0 state and π state, which are set as ±1 of the spin to solve the optimization problem.
18. A computer-readable storage medium, characterized in that, The storage unit stores a computer program, which is executed by the processor to realize the data processing method for neural network training according to any one of claims 1-15.
Citation Information
Patent Citations
Activation function constructed by smooth and continuous segments
CN112183720A
Multilayer feedforward neural network training method for Isin machine
CN117313819A
Data processing method for neural network training, quantum computing device and medium
CN118966298A
Method and System for Solving QUBO Problems with Hybrid Classical-Quantum Solvers
US20240013048A1
Neural network model training method, data processing method, and apparatus
US20240078428A1