- class QGAN(data, bounds=None, num_qubits=None, batch_size=500, num_epochs=3000, seed=7, discriminator=None, generator=None, tol_rel_ent=None, snapshot_dir=None, quantum_instance=None, penalty=False)¶
The Quantum Generative Adversarial Network algorithm.
The qGAN  is a hybrid quantum-classical algorithm used for generative modeling tasks.
This adaptive algorithm uses the interplay of a generative
GenerativeNetworkand a discriminative
DiscriminativeNetworknetwork to learn the probability distribution underlying given training data.
These networks are trained in alternating optimization steps, where the discriminator tries to differentiate between training data samples and data samples from the generator and the generator aims at generating samples which the discriminator classifies as training data samples. Eventually, the quantum generator learns the training data's underlying probability distribution. The trained quantum generator loads a quantum state which is a model of the target distribution.
-  Zoufal et al.,
batch_size (int) -- Batch size, has a min. value of 1.
num_epochs (int) -- Number of training epochs
seed (int) -- Random number seed
discriminator (DiscriminativeNetwork | None) -- Discriminates between real and fake data samples
generator (GenerativeNetwork | None) -- Generates 'fake' data samples
tol_rel_ent (float | None) -- Set tolerance level for relative entropy. If the training achieves relative entropy equal or lower than tolerance it finishes.
snapshot_dir (str | None) -- Directory in to which to store cvs file with parameters, if None (default) then no cvs file is created.
penalty (bool | None) -- enable or not the gradient penalty in the discriminator
- उभारता है :
QiskitMachineLearningError -- invalid input
Returns discriminator loss
Returns generator loss
Returns penalty parameter for the discriminator training
Returns quantum instance.
Return a numpy random.
Returns relative entropy between target and trained distribution
Returns random seed
Returns tolerance for relative entropy
Get relative entropy between target and trained distribution
Execute the algorithm with selected backend.
Sets backend with configuration.
Train the qGAN