Stay organized with collections
Save and categorize content based on your preferences.
The discriminator in a GAN is simply a classifier. It tries to distinguish real
data from the data created by the generator. It could use any network
architecture appropriate to the type of data it's classifying.
Figure 1: Backpropagation in discriminator training.
Discriminator Training Data
The discriminator's training data comes from
two sources:
Real data instances, such as real pictures of people. The discriminator
uses these instances as positive examples during training.
Fake data instances created by the generator. The discriminator uses
these instances as negative examples during training.
In Figure 1, the two "Sample" boxes represent these two data sources feeding
into the discriminator. During discriminator training the generator does not
train. Its weights remain constant while it produces examples for the
discriminator to train on.
Training the Discriminator
The discriminator connects to two loss
functions. During discriminator training, the discriminator ignores the
generator loss and just uses the discriminator loss. We use the generator loss
during generator training, as described in the next section.
During discriminator training:
The discriminator classifies both real data and fake data from the generator.
The discriminator loss penalizes the discriminator for misclassifying a real
instance as fake or a fake instance as real.
The discriminator updates its weights through
backpropagation
from the discriminator loss through the discriminator
network.
In the next section we'll see why the generator loss connects to the
discriminator.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThe discriminator in a GAN is a classifier that distinguishes real data from fake data generated by the generator.\u003c/p\u003e\n"],["\u003cp\u003eDiscriminator training involves using real and fake data to update its weights through backpropagation and minimize the discriminator loss.\u003c/p\u003e\n"],["\u003cp\u003eDuring discriminator training, the generator's weights remain constant, and the generator loss is ignored.\u003c/p\u003e\n"]]],[],null,["# The Discriminator\n\n\u003cbr /\u003e\n\nThe discriminator in a GAN is simply a classifier. It tries to distinguish real\ndata from the data created by the generator. It could use any network\narchitecture appropriate to the type of data it's classifying.\n\n**Figure 1: Backpropagation in discriminator training.**\n\nDiscriminator Training Data\n---------------------------\n\nThe discriminator's training data comes from\ntwo sources:\n\n- **Real data** instances, such as real pictures of people. The discriminator uses these instances as positive examples during training.\n- **Fake data** instances created by the generator. The discriminator uses these instances as negative examples during training.\n\nIn Figure 1, the two \"Sample\" boxes represent these two data sources feeding\ninto the discriminator. During discriminator training the generator does not\ntrain. Its weights remain constant while it produces examples for the\ndiscriminator to train on.\n\nTraining the Discriminator\n--------------------------\n\nThe discriminator connects to two [loss](/machine-learning/glossary#loss)\nfunctions. During discriminator training, the discriminator ignores the\ngenerator loss and just uses the discriminator loss. We use the generator loss\nduring generator training, as described in [the next section](/machine-learning/gan/generator).\n\nDuring discriminator training:\n\n1. The discriminator classifies both real data and fake data from the generator.\n2. The discriminator loss penalizes the discriminator for misclassifying a real instance as fake or a fake instance as real.\n3. The discriminator updates its weights through [backpropagation](https://developers.google.com/machine-learning/glossary/#b) from the discriminator loss through the discriminator network.\n\nIn the next section we'll see why the generator loss connects to the\ndiscriminator."]]