Creating a neural network discriminator
Machine learning is a growing area in quantum computing. Researchers have been looking at ways to leverage quantum computational techniques in various areas of machine learning, such as generative adversarial networks and supervised learning for regression and classification.
In this section, we will focus on the discriminator model as opposed to the generative model. As a reminder, the discriminator model learns by using conditional probability distribution, whereas the generative model learns via joint probability distribution.
In this section, we will create a PyTorchDiscriminator
class based on PyTorch. This class contains various methods that will allow you to load your model and perform a training step, based on the parameters of your discriminator. Let's get started:
- First, we'll create a
PyTorchDiscriminator
class by specifying the number of features (the dimension of the input data vector) and the dimension of...