CN111814907A - Quantum generation countermeasure network algorithm based on condition constraint - Google Patents

Quantum generation countermeasure network algorithm based on condition constraint Download PDF

Info

Publication number
CN111814907A
CN111814907A CN202010734916.5A CN202010734916A CN111814907A CN 111814907 A CN111814907 A CN 111814907A CN 202010734916 A CN202010734916 A CN 202010734916A CN 111814907 A CN111814907 A CN 111814907A
Authority
CN
China
Prior art keywords
quantum
training
discriminator
generator
countermeasure network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010734916.5A
Other languages
Chinese (zh)
Other versions
CN111814907B (en
Inventor
刘文杰
张颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Information Science and Technology
Original Assignee
Nanjing University of Information Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Information Science and Technology filed Critical Nanjing University of Information Science and Technology
Priority to CN202010734916.5A priority Critical patent/CN111814907B/en
Publication of CN111814907A publication Critical patent/CN111814907A/en
Application granted granted Critical
Publication of CN111814907B publication Critical patent/CN111814907B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0852Quantum cryptography
    • H04L9/0858Details about key distillation or coding, e.g. reconciliation, error correction, privacy amplification, polarisation coding or phase coding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Health & Medical Sciences (AREA)
  • Geometry (AREA)
  • Electromagnetism (AREA)
  • Computer Security & Cryptography (AREA)
  • Medical Informatics (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Complex Calculations (AREA)

Abstract

The invention discloses a quantum generation countermeasure network algorithm based on condition constraint, which comprises the following steps: firstly, preparing a real sample, introducing appropriate condition constraints according to the target of a generated task and the characteristics of data, and forming a training data set of a network together; secondly, designing a proper quantum circuit to carry out quantum state coding on the classical training sample according to the numerical characteristics of the training data set; then, designing a construction condition to generate a parameterized quantum circuit of a quantum generator G and a quantum discriminator D of the countermeasure network; and finally, cascading the quantum generator G and the quantum discriminator D, formulating a training strategy to perform countermeasure training, and performing measurement sampling on the trained quantum generator G to generate a data result which can be fitted with a real sample and accords with conditional constraints. The invention can effectively guide the network to generate the data meeting the specific requirements according to the setting of the condition constraint, thereby increasing the controllability of the training process and improving the quality of the generated data.

Description

Quantum generation countermeasure network algorithm based on condition constraint
Technical Field
The invention belongs to a quantum machine learning algorithm, and particularly relates to a quantum generation confrontation network algorithm based on condition constraint.
Background
Goodfellow firstly proposes generation of a confrontation Network (GAN) in 2014, and combines a discriminant model and a Generative model which are the most important algorithm models in the field of artificial intelligence to obtain a new deep neural Network algorithm framework. The main idea is that the generator learns the characteristics of training sample data and generates false samples, the discriminator judges the authenticity of input samples, and through the alternate training of the generator and the discriminator, a better generator is obtained for generating data which can be matched with real samples. Subsequently, the countermeasure training idea is widely applied to solving various generation and classification problems, and particularly, GAN shows great potential in the task of learning to generate real pictures and audio data samples.
On the basis of GAN idea, Mehdi Mirza in the same year proposes a conditional generation countermeasure network (CGAN), which adds conditional constraints to both the generator and the discriminator, i.e. some extra information related to the conditional constraint characterization data. In the training process, the added condition constraint can guide the generator to generate data which accords with the additional information characteristics, and the mode of simulation in the training is prevented from being too free. The CGAN can be used not only to generate data for specific conditions, but also to image transformation and style migration.
Lloyd in 2018 proposes a concept related to Quantum generation countermeasure networks (QGAN), and skillfully combines the classical generation countermeasure network with Quantum computing. The QGAN algorithm-based pure quantum scheme is verified by physical experiments of a superconducting circuit, and the mixed classical-quantum scheme is verified by relevant numerical simulation, so that the QGAN is expected to become one of machine learning algorithms which are most suitable to be realized by using recent quantum equipment. However, similar to the GAN classical scheme, the quantum scheme also has the problem that the training process is too free because data distribution does not need to be assumed in advance, and it is difficult to control the generation of data with large information amount.
Disclosure of Invention
The purpose of the invention is as follows: the invention aims to provide a quantum generation countermeasure network algorithm based on conditional constraint, which effectively guides a network to generate data meeting specific requirements by setting the conditional constraint, increases the controllability of a training process and improves the quality of the generated data.
The technical scheme is as follows: the quantum generation countermeasure network algorithm based on the condition constraint comprises the following steps:
(1) preparing a real sample, introducing appropriate condition constraints according to a target of a generated task and numerical characteristics of sample data, wherein the sample data and condition variables jointly form a training data set for generating the countermeasure network;
(2) preparing data pairs in the training dataset into quantum states; redesigning the parameterized quantum circuit of the quantum generator G and setting the corresponding hyperparameters
Figure BDA0002604599270000021
(3) Designing parameterized quantum circuit of quantum discriminator D and setting corresponding hyper-parameters
Figure BDA0002604599270000022
(4) Setting relevant parameters of the confrontation training;
(5) fixing a parameter θ of a quantum generator GGCalculating the gradient of the loss function of the quantum discriminator D for the parameter thetaDOptimizing;
(6) fixing the parameter θ of the Quantum discriminator DDCalculating the gradient of the loss function of the quantum generator G for the parameter thetaGOptimizing;
(7) step (5) and step (6) complete the parameter alternation optimization of a training period, calculate the loss function of the quantum generator G and the quantum discriminator D under the current parameter, judge whether the generated countermeasure network reaches Nash balance;
(8) and after the training is finished, obtaining a quantum generator G with the capability of generating data in a classified manner, selecting a corresponding conditional constraint value according to the target, inputting the conditional constraint value into the trained quantum generator G, and measuring the final state of the quantum generator G to obtain new data meeting the conditional constraint characteristics.
In the step (4), the setting of the parameters related to the countermeasure training is specifically that all sample data are trained by generating the countermeasure networkThe times are recorded as epochs, and the times of evolution of a packet content discriminator D in each epoch are recorded as DstepThe number of times of G evolution of the content molecule generator in each epoch is GstepSelecting the minimum batch of real samples as m when updating the parameters of the quantum discriminator D each timeb
In the step (5), the parameter θ of the quantum generator G is fixedGThen, m is randomly extracted from the training data setbPreparing real sample data pair into quantum state | r>Will | r>Measuring an output of the quantum discriminator D as an input of the quantum discriminator D; then cascade the quantum generator G and the quantum discriminator D to convert | z>|y>As an input to the quantum generator G, the output of the quantum discriminator D is measured.
The calculation formula of the input | r > of the quantum discriminator D is as follows:
Figure BDA0002604599270000023
in the formula, xi∈X;ci∈y;i=1,2,…,mb(ii) a X represents a sample data set; y represents the conditional constraints introduced according to the goal of the generating task and the numerical characteristics of the sample data.
The calculation formula of the input | z > | y > of the quantum generator G is as follows:
Figure BDA0002604599270000024
in the formula (I), the compound is shown in the specification,
Figure BDA0002604599270000031
1/αjrepresents the conditional probability p (x | y)j) And satisfies the normalization condition
Figure BDA0002604599270000032
NxExpressed as preparing true sample data xiThe maximum number of quantum bits required.
Calculating the loss function of the quantum discriminator D from the two measured outputs of the quantum discriminator DLDA gradient of (a); loss function L of quantum discriminator DDComprises the following steps:
Figure BDA0002604599270000033
in step (6), the loss function L of the quantum generator GGThe calculation formula of (2) is as follows:
LGG)=Ezlog(D(G(|z>||y>)))。
in the step (7), if the generated countermeasure network reaches the Nash equilibrium state, the training is ended in advance; otherwise, the iterative optimization of the next training period is carried out until the generated countermeasure network reaches Nash balance or the iterative training of the whole training period is completed.
In step (1), the condition variable is derived from a category label, partial data for image inpainting, or other data from different modalities.
And designing the parameterized quantum circuits of the quantum generator G and the quantum discriminator D according to the quantum resources N and the corresponding quantum circuit templates.
Has the advantages that: compared with the prior art, the invention has the beneficial effects that: by adding condition constraints on a training data set on a network input layer, the network is effectively guided to generate data meeting specific requirements, controllability of a training process is improved, and fitting degree of the generated data to real data is improved.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a diagram of a quantum wire for preparing an entangled state of N particles W in the present invention;
FIG. 3 is a schematic diagram of qubit connectivity for a quantum generator G in accordance with the present invention;
FIG. 4 is a template diagram of a quantum wire of a quantum generator G according to the present invention;
FIG. 5 is a template diagram of a quantum wire of a quantum discriminator D according to the present invention;
FIG. 6 is a diagram of a quantum wire for preparing a W state of 3 particles in accordance with the present invention;
FIG. 7 is a circuit diagram of a quantum generator G according to the present invention;
fig. 8 is a circuit diagram of a quantum discriminator D according to the present invention.
Detailed Description
The invention is described in further detail below with reference to specific embodiments and the attached drawings.
As shown in fig. 1, the quantum generation countermeasure network algorithm based on conditional constraints of the present invention includes the following steps:
(1) preparing a real sample, and recording a sample data set as X ═ X1,x2,…,xnBelongs to R, and the data set conforms to an unknown probability distribution rhodata. Introducing appropriate conditional constraints according to the target of the generated task and the numerical characteristics of the sample data, and recording as y ═ y1,y2,…,ym}; the sample data and the condition variables together form a training data set for generating the countermeasure network, and the training data set is marked as { (x)1,c1),…,(xi,ci),…,(xn,cn)}(xi∈X,ci∈y);
(2) Preparing a quantum generation model: the data pairs in the training dataset are prepared into quantum states. Preparing a condition information quantum state input to a quantum generator G, and encoding a condition variable y into a quantum superposition state according to the probability distribution of a real sample:
Figure BDA0002604599270000041
the input of the quantum generator G is
Figure BDA0002604599270000042
The quantum state is prepared by N quantum bitsx+NyIn which N isxFor preparing true sample data xiMaximum number of quantum bits required, NyFor preparing the condition variable yjThe maximum number of quantum bits required. Then, the parameterized quantum circuit of the quantum generator G is designed according to the quantum resource N required by the quantum circuit and the circuit template, and the corresponding hyper-parameter is set
Figure BDA0002604599270000043
(3) Preparation of a quantum countermeasure model: designing the circuit of the quantum discriminator D also requires quantum resource N, designing the parameterized quantum circuit of the quantum discriminator D according to the corresponding quantum circuit template, and setting the corresponding hyper-parameter
Figure BDA0002604599270000044
(4) Setting relevant parameters of the confrontation training: the training times of all sample data after the generation of the countermeasure network are epochs, and the evolution times of a discriminator contained in each epoch are dstepThe number of generator evolutions contained in each epoch is gstepSelecting the minimum batch of real samples as m when updating the parameters of the discriminator each timeb
(5) Training a discriminator: fixing a parameter θ of a quantum generator GGRandomly extracting m from the training data setbA true pair of sample data (x)i,ci)(i=1,2,…,mb;ciE.y) into a quantum state | r>Will | r>Measuring an output of the quantum discriminator D as an input of the quantum discriminator D; then cascade the quantum generator G and the quantum discriminator D to convert | z>|y>As an input to the quantum generator G, the output of the quantum discriminator D is measured. Calculating the gradient of the loss function of the quantum discriminator D, for the parameter theta of the quantum discriminator DDAnd (6) optimizing. The iteration optimization times of the quantum discriminator D is DstepNext, the process is carried out.
The equation for the input | r > of quantum discriminator D is:
Figure BDA0002604599270000045
in the formula, xi∈X;ci∈y;i=1,2,…,mb(ii) a X represents a sample data set; y represents the conditional constraints introduced according to the goal of the generating task and the numerical characteristics of the sample data.
The formula for the input | z > | y > of the quantum generator G is:
Figure BDA0002604599270000051
in the formula (I), the compound is shown in the specification,
Figure BDA0002604599270000052
1/αjrepresents the conditional probability p (x | y)j) And satisfies the normalization condition
Figure BDA0002604599270000053
NxExpressed as preparing true sample data xiThe maximum number of quantum bits required.
After two measurements, the two measured outputs of the quantum discriminator D are added to obtain the loss function L of the quantum discriminator DDA gradient of (a); loss function L of quantum discriminator DDComprises the following steps:
Figure BDA0002604599270000054
(6) training and training generator: fixing the parameter θ of the Quantum discriminator DDThe quantum generator G and the quantum discriminator D are cascaded,
Figure BDA0002604599270000055
and a condition variable y>The combined input to the generator G measures the final state of the quantum discriminator D and converts the final state into a scalar, which is used for representing the judgment of the quantum discriminator D on the truth of the input data and whether the data is matched with the condition information. Calculating the gradient of the loss function of the quantum generator G for the parameter theta of the quantum generator GGAnd (6) optimizing. The number of times of iterative optimization of the quantum generator G is GstepNext, the process is carried out. Wherein the loss function L of the quantum generator GGThe calculation formula of (2) is as follows:
LGG)=Ezlog(D(G(|z>||y>)))。
(7) judging whether training is continued: after the step (5) and the step (6) finish the alternate optimization in an epoch, calculating the loss functions of the quantum generator G and the quantum discriminator D under the current parameters, and judging whether the generated countermeasure network reaches Nash balance or not. If the generation of the countermeasure network reaches the Nash equilibrium state, the training is ended in advance; otherwise, entering next epoch iterative optimization until the generated countermeasure network reaches Nash balance or completes all epoch iterative training times.
(8) The expected results were obtained: after training, a quantum generator G which accords with a learning task (namely has the capability of classifying and generating data) is obtained, and a corresponding conditional constraint value | y is selected according to a targetc>Will be
Figure BDA0002604599270000056
Inputting the measured data into a trained quantum generator G, and measuring the final state of the quantum generator G to obtain the condition-constrained yc>New data of the features, i.e. as the final result of the generation of the task based on the conditional constraints.
In step (1), the condition variable y may be based on a variety of information, such as a category label, partial data for image inpainting, or other data from different modalities.
In step (2), condition variables based on class labels are most common, in which case the constructed conditional generation countermeasure network can be used to accomplish the task of generating classification data. The category labels are generally uniformly encoded using a one-hot method. Assuming that three different types of data subject to uniform distribution are to be generated, the sample can be labeled with three conditional constraints. Represented by classical binary data bits: 001,010,100, exactly corresponding to the three-particle W state | W in quantum computing>3=1/3(|001>+|010>+|100>) And correspondingly. Thus, the step of "encoding the condition variables y into quantum superposition states according to the true sample probability distribution" generally involves how to prepare the multi-particle W state, with a quantum wire template as shown in fig. 2. According to the cascade operation rule of the quantum circuit and the probability amplitude of the final state expected to be obtained, parameter values in the quantum circuit can be solved through an equation set mode.
Quantum generator G requires quantum resources using N qubits, where NxAn input of a channel is
Figure BDA0002604599270000061
NyThe channels are used for receiving label information. In order to ensure the expressive ability of the quantum generator G, N is required to be ensured when a parameterized quantum circuit of the quantum generator G is designedxThe qubits being completely connected, NxConnectivity among quantum bits is shown in fig. 3, and line templates and arrangement rules of the rotating layer and the entangled layer of the corresponding parameterized quantum circuit are shown in fig. 4. In fig. 4, "XX" indicates an operation involving two qubits, one bit being a control bit and the other bit being a target bit, and when the control bit is "0" or "1", a corresponding operation is performed on the target bit.
In step (3), quantum arbiter D requires quantum resources to be used for N qubits, where N isxOne channel receives data information, NyEach lane receives tag information. There is no strict constraint on the design of the parameterized quantum circuit of the quantum discriminator D, but the use of the parameterized quantum gates should be reduced on the premise of ensuring entanglement, so as to avoid the training speed of the network from being reduced accordingly. The present invention provides a generic template of a discriminator D quantum wire, as shown in fig. 5, where the operation denoted by "XX" is consistent with the implications of fig. 4.
The invention combines the conditional generation countermeasure network algorithm and the quantum computing idea, and constructs the quantum generation countermeasure network algorithm based on the conditional constraint. By adding condition constraints on a training data set on a network input layer, the network is effectively guided to generate data meeting specific requirements, controllability of a training process is improved, and fitting degree of the generated data to real data is improved.
The following embodiment assumes that the learning task of generating the countermeasure network is to generate BAS maps of 2 × 2 pixels (the BAS maps constituting the horizontal stripe pattern or the vertical stripe pattern are considered to be valid), and the six valid BAS maps are divided into three types according to the characteristics of the data set and encoded by a one-hot method. A training data set containing six valid BAS maps evenly distributed was constructed:
Figure BDA0002604599270000062
the first 4 data bits are binary codes of pixel values, the value of 1 represents coloring the pixel point, and the value of 0 represents keeping the pixel point blank; the last 3 data bits represent the one-hot encoding of the condition variable.
The data pairs in the training dataset are prepared as quantum states, respectively |1100001>,|0011001>And 0101010, |1010010 >, |0000100 >, |1111100 >. The quantum wires of both the quantum discriminator D and the quantum generator G require 7 qubits of N to process the information, where N isx4 qubits for processing BAS image pixel correlation data, Ny3 qubits are used to process data relevant to conditional constraints.
Since the three BAS graphs in the training set are uniformly distributed, 3-particle W states are required to be prepared for the quantum generator G to provide information on the condition variables, i.e., y > W3=1/3(|001>+|010>+|100>). As shown in fig. 2, a template of a quantum wire in N-particle W state is prepared, and is designed to prepare a quantum wire in 3-particle W state, as shown in fig. 6. Wherein:
Figure BDA0002604599270000071
Figure BDA0002604599270000072
the 3 particle W state contains only three states entangled with each other, so the qubit | BC is rotated by adjusting the angle of the single qubit rotating gate in the first step>Is prepared in a special state comprising only three terms, i.e.
Figure BDA0002604599270000073
According to the rule of quantum line cascade operation:
Figure BDA0002604599270000074
a system of equations for the quantum wire parameters is obtained:
Figure BDA0002604599270000075
solving the equation system to obtain parameter values: theta1=θ3=0.55357436,θ2=-0.36486383。
The second step in preparing the W state is to entangle the three qubits into a 3-particle W state using quantum gate design lines without parameters. According to | BC>And | W>3The difference in (1) can be that the quantum bits B and C are first subjected to a not-gate (Pauli X gate) operation, then the toffil gate is applied to set the quantum bit a to 1 when the quantum bits B and C are both 1, and finally the quantum bits B and C are subjected to the not-gate operation again to restore the entangled state at the end of the first step. So far, the initial state |000 can be obtained>Is prepared into | W>3
As shown in fig. 3 to 5, a quantum circuit suitable for this task is designed using a parameterized quantum circuit template of the given quantum generator G and quantum discriminator D. As shown in fig. 7, the quantum generator G has 14 parameters to be trained, and CRZ gates are selected to realize entanglement between quantum bits. The circuit is only provided with a rotating layer and a full-connection layer, and because 4 quantum bits for processing data information are fully connected, experiments prove that even shallow quantum circuits can achieve better performance. As shown in fig. 8, the quantum discriminator D has 21 parameters to be trained, and selects to use the CRZ gate to realize entanglement between quantum bits.
Randomly generating the parameter theta of the array pair quantum line which accords with normal distribution and has the average value of 4/piGAnd thetaDInitialization is performed. Making a training strategy, and setting parameters: epoch is 50 gstep=dstep=200、mbAt 30, it is ensured that every epoch can traverse all the data of the training set. The Adam optimization algorithm is adopted for updating circuit parameters, and the learning rate uses a default value alphalr=0.001。
Firstly fixing the parameter theta during the confrontation trainingGRandomly selecting 30 pixel values and condition variable data pairs from the training set to prepare quantum state
Figure BDA0002604599270000081
Inputting the measured data into a quantum discriminator D, measuring the output of the quantum discriminator D and calculating
Figure BDA0002604599270000082
Then cascade the quantum generator G and the quantum discriminator D to convert | z>|y>=|0000>|y>As input to the quantum generator G, the output of the quantum discriminator D is measured and E is calculatedzlog(1-D(G(|z>||y>))). The sum of the two calculation results is the loss function of the discriminator D, and the gradient of the loss function is calculated to update the parameter thetaD
Completion parameter θDAfter updating, the parameter theta is fixed againDInvariably, will | z>|y>=|0000>|y>Acting as initial state on the quantum wire of the quantum generator G, measuring the output of the quantum generator G and calculating Ezlog(D(G(|z>||y>))). Calculating a loss function LGIs used to update the parameter thetaG
Alternate training arbiter and generator gstep=dstep200 times, an epoch alternative optimization task is completed. At this time, |0000>|y>As input to the quantum generator G, the output of the quantum generator G was measured and examined: firstly, generating pixel data as the accuracy of the BAS image; generating the matching degree of the pixel data and the condition information; and thirdly, whether the generated pixel data accord with uniform distribution or not. Since the training process for generating the countermeasure network has relative instability, the quality of the generator is considered at the end of each epoch training, and the training can be selected to be terminated early if the accuracy reaches a preset threshold. If the threshold value can not be reached all the time, repeating the alternating training process for epoch times, and then carrying out systematic investigation on the convergence condition of the loss function of the whole training process.
And obtaining the quantum generator G with classification data generation capability after training is finished. Set |0000 according to demand>And different condition variables yj>As input to the trained generator G, e.g. input |0000>|001>Measuring the final state of the generator results in that the pixel data constitutes a 2 x 2BAS map comprising only one horizontal stripe, and two different stripe mapsConsistent with uniform distribution.

Claims (10)

1. A quantum generation countermeasure network algorithm based on conditional constraints, comprising the steps of:
(1) preparing a real sample, introducing appropriate condition constraints according to a target of a generated task and numerical characteristics of sample data, wherein the sample data and condition variables jointly form a training data set for generating the countermeasure network;
(2) preparing data pairs in the training dataset into quantum states; redesigning the parameterized quantum circuit of the quantum generator G and setting the corresponding hyperparameters
Figure FDA0002604599260000011
(3) Designing parameterized quantum circuit of quantum discriminator D and setting corresponding hyper-parameters
Figure FDA0002604599260000012
(4) Setting relevant parameters of the confrontation training;
(5) fixing a parameter θ of a quantum generator GGCalculating the gradient of the loss function of the quantum discriminator D for the parameter thetaDOptimizing;
(6) fixing the parameter θ of the Quantum discriminator DDCalculating the gradient of the loss function of the quantum generator G for the parameter thetaGOptimizing;
(7) after the step (5) and the step (6) complete the parameter alternation optimization of a training period, calculating the loss functions of the quantum generator G and the quantum discriminator D under the current parameters, and judging whether the generated countermeasure network reaches Nash balance;
(8) and after the training is finished, obtaining a quantum generator G with the capability of generating data in a classified manner, selecting a corresponding conditional constraint value according to the target, inputting the conditional constraint value into the trained quantum generator G, and measuring the final state of the quantum generator G to obtain new data meeting the conditional constraint characteristics.
2. According to the rightThe quantum generation countermeasure network algorithm based on conditional constraints of claim 1, characterized in that: in the step (4), the parameters related to the countermeasure training are specifically set as the times of training all sample data by generating the countermeasure network are recorded as epochs, and the times of evolution of the content sub-discriminator D in each epoch are recorded as DstepThe number of times of G evolution of the content molecule generator in each epoch is GstepSelecting the minimum batch of real samples as m when updating the parameters of the quantum discriminator D each timeb
3. The quantum generation countermeasure network algorithm based on conditional constraints of claim 1, wherein: in the step (5), the parameter θ of the quantum generator G is fixedGThen, m is randomly extracted from the training data setbPreparing real sample data pair into quantum state | r>Will | r>Measuring an output of the quantum discriminator D as an input of the quantum discriminator D; then cascade the quantum generator G and the quantum discriminator D to convert | z>|y>As an input to the quantum generator G, the output of the quantum discriminator D is measured.
4. The quantum generation countermeasure network algorithm based on conditional constraints of claim 3, wherein: the calculation formula of the input | r > of the quantum discriminator D is as follows:
Figure FDA0002604599260000013
in the formula, xi∈X;ci∈y;i=1,2,…,mb(ii) a X represents a sample data set; y represents the conditional constraints introduced according to the goal of the generating task and the numerical characteristics of the sample data.
5. The quantum generation countermeasure network algorithm based on conditional constraints of claim 3, wherein: the calculation formula of the input | z > | y > of the quantum generator G is as follows:
Figure FDA0002604599260000021
in the formula (I), the compound is shown in the specification,
Figure FDA0002604599260000022
1/αjrepresents the conditional probability p (x | y)j) And satisfies the normalization condition
Figure FDA0002604599260000023
NxExpressed as preparing true sample data xiThe maximum number of quantum bits required.
6. The quantum generation countermeasure network algorithm based on conditional constraints of claim 3, wherein: calculating a loss function L of the quantum discriminator D from the twice measured outputs of the quantum discriminator DDA gradient of (a); loss function L of quantum discriminator DDComprises the following steps:
Figure FDA0002604599260000024
7. the quantum generation countermeasure network algorithm based on conditional constraints of claim 1, wherein: in step (6), the loss function L of the quantum generator GGThe calculation formula of (2) is as follows:
LGG)=Ezlog(D(G(|z>||y>)))。
8. the quantum generation countermeasure network algorithm based on conditional constraints of claim 1, wherein: in the step (7), if the generated countermeasure network reaches the Nash equilibrium state, the training is ended in advance; otherwise, the iterative optimization of the next training period is carried out until the generated countermeasure network reaches Nash balance or the iterative training of the whole training period is completed.
9. The quantum generation countermeasure network algorithm based on conditional constraints of claim 1, wherein: in step (1), the condition variable is derived from a category label, partial data for image inpainting, or other data from different modalities.
10. The quantum generation countermeasure network algorithm based on conditional constraints of claim 1, wherein: and designing the parameterized quantum circuits of the quantum generator G and the quantum discriminator D according to the quantum resources N and the corresponding quantum circuit templates.
CN202010734916.5A 2020-07-28 2020-07-28 Quantum generation countermeasure network algorithm based on condition constraint Active CN111814907B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010734916.5A CN111814907B (en) 2020-07-28 2020-07-28 Quantum generation countermeasure network algorithm based on condition constraint

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010734916.5A CN111814907B (en) 2020-07-28 2020-07-28 Quantum generation countermeasure network algorithm based on condition constraint

Publications (2)

Publication Number Publication Date
CN111814907A true CN111814907A (en) 2020-10-23
CN111814907B CN111814907B (en) 2024-02-09

Family

ID=72864029

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010734916.5A Active CN111814907B (en) 2020-07-28 2020-07-28 Quantum generation countermeasure network algorithm based on condition constraint

Country Status (1)

Country Link
CN (1) CN111814907B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112541590A (en) * 2020-12-10 2021-03-23 北京百度网讯科技有限公司 Quantum entanglement detection method and device, electronic device and storage medium
CN112561069A (en) * 2020-12-23 2021-03-26 北京百度网讯科技有限公司 Model processing method, device, equipment, storage medium and product
CN112801281A (en) * 2021-03-22 2021-05-14 东南大学 Countermeasure generation network construction method based on quantization generation model and neural network
CN113449468A (en) * 2021-06-22 2021-09-28 北京交通大学 Multi-parameter distribution characteristic modeling and parameter generating method for lithium ion battery pack
CN114819163A (en) * 2022-04-11 2022-07-29 合肥本源量子计算科技有限责任公司 Quantum generation countermeasure network training method, device, medium, and electronic device
CN115311515A (en) * 2022-07-22 2022-11-08 合肥本源量子计算科技有限责任公司 Training method for generating countermeasure network by mixed quantum classical and related equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871995A (en) * 2019-02-02 2019-06-11 浙江工业大学 The quantum optimization parameter adjustment method of distributed deep learning under Spark frame
WO2019177951A1 (en) * 2018-03-11 2019-09-19 President And Fellows Of Harvard College Hybrid quantum-classical generative modes for learning data distributions

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019177951A1 (en) * 2018-03-11 2019-09-19 President And Fellows Of Harvard College Hybrid quantum-classical generative modes for learning data distributions
CN109871995A (en) * 2019-02-02 2019-06-11 浙江工业大学 The quantum optimization parameter adjustment method of distributed deep learning under Spark frame

Non-Patent Citations (9)

* Cited by examiner, † Cited by third party
Title
CHRISTA ZOUFAL等: "Quantum generative adversarial networks for learning and loading random distributions", 《NPJ QUANTUM INFORMATION》, vol. 2019, no. 5, pages 1 - 9 *
DALLAIRE等: "Quantum generative adversarial networks", 《ARXIV》, pages 1 - 10 *
HAOZHEN SITU等: "Quantum generative adversarial network for generating discrete distribution", 《ARXIV》, pages 1 - 17 *
JINFENG ZENG等: "Learning and inference on generative adversarial quantum circuits", 《PHYSICS REVIEW A》, vol. 99, no. 05, pages 052306 - 1 *
LLOYD等: "Quantum generative adversarial learning", 《ARXIV》, pages 1 - 5 *
MARCELLO BENEDETTI等: "Adversarial quantum circuit learning for pure state approximation", 《ARXIV》, pages 1 - 14 *
MIRZA等: "Conditional generative adversarial nets", 《ARXIV》, pages 1 - 7 *
刘文杰等: "一种量子条件生成对抗网络算法", 《电子学报》, vol. 50, no. 07, pages 1586 - 1593 *
赵胶胶: "基于变分量子电路的量子生成对抗网络研究", 《中国优秀硕士学位论文全文数据库 基础科学辑》, vol. 2022, no. 11, pages 005 - 4 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112541590A (en) * 2020-12-10 2021-03-23 北京百度网讯科技有限公司 Quantum entanglement detection method and device, electronic device and storage medium
CN112541590B (en) * 2020-12-10 2021-09-14 北京百度网讯科技有限公司 Quantum entanglement detection method and device, electronic device and storage medium
CN112561069A (en) * 2020-12-23 2021-03-26 北京百度网讯科技有限公司 Model processing method, device, equipment, storage medium and product
CN112801281A (en) * 2021-03-22 2021-05-14 东南大学 Countermeasure generation network construction method based on quantization generation model and neural network
CN113449468A (en) * 2021-06-22 2021-09-28 北京交通大学 Multi-parameter distribution characteristic modeling and parameter generating method for lithium ion battery pack
CN113449468B (en) * 2021-06-22 2024-03-12 北京交通大学 Multi-parameter distribution characteristic modeling and parameter generation method for lithium ion battery pack
CN114819163A (en) * 2022-04-11 2022-07-29 合肥本源量子计算科技有限责任公司 Quantum generation countermeasure network training method, device, medium, and electronic device
CN114819163B (en) * 2022-04-11 2023-08-08 本源量子计算科技(合肥)股份有限公司 Training method and device for quantum generation countermeasure network, medium and electronic device
CN115311515A (en) * 2022-07-22 2022-11-08 合肥本源量子计算科技有限责任公司 Training method for generating countermeasure network by mixed quantum classical and related equipment

Also Published As

Publication number Publication date
CN111814907B (en) 2024-02-09

Similar Documents

Publication Publication Date Title
CN111814907A (en) Quantum generation countermeasure network algorithm based on condition constraint
Jethani et al. Fastshap: Real-time shapley value estimation
CN108182456B (en) Target detection model based on deep learning and training method thereof
Sun et al. Automatically evolving cnn architectures based on blocks
CN111814871A (en) Image classification method based on reliable weight optimal transmission
CN109977094B (en) Semi-supervised learning method for structured data
CN111242233B (en) Alzheimer disease classification method based on fusion network
CN111368920A (en) Quantum twin neural network-based binary classification method and face recognition method thereof
CN110490247B (en) Image processing model generation method, image processing method and device and electronic equipment
Wu et al. Enhancing TripleGAN for semi-supervised conditional instance synthesis and classification
Ning et al. Input perturbation reduces exposure bias in diffusion models
CN113743474A (en) Digital picture classification method and system based on cooperative semi-supervised convolutional neural network
CN111340069A (en) Incomplete data fine modeling and missing value filling method based on alternate learning
CN114036992A (en) High-dimensional data abnormal subspace detection method based on self-encoder and genetic algorithm
Costa et al. Neuroevolution of generative adversarial networks
CN111310722A (en) Power equipment image fault identification method based on improved neural network
CN117036760A (en) Multi-view clustering model implementation method based on graph comparison learning
Li et al. Interpreting the latent space of gans via measuring decoupling
CN117437494A (en) Image classification method, system, electronic equipment and storage medium
CN111797935B (en) Semi-supervised depth network picture classification method based on group intelligence
CN116341666A (en) Quantum convolution neural network design method and system based on quantum circuit
CN112488238B (en) Hybrid anomaly detection method based on countermeasure self-encoder
Qiu et al. Semantic-visual Guided Transformer for Few-shot Class-incremental Learning
Roth et al. Mask mining for improved liver lesion segmentation
CN115545210A (en) Method and related apparatus for quantum computing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant