Stay organized with collections
Save and categorize content based on your preferences.
A generative adversarial network (GAN) has two parts:
The generator learns to generate plausible data. The generated instances
become negative training examples for the discriminator.
The discriminator learns to distinguish the generator's fake data from
real data. The discriminator penalizes the generator for producing
implausible results.
When training begins, the generator produces obviously fake data, and the
discriminator quickly learns to tell that it's fake:
As training progresses, the generator gets closer to producing output that
can fool the discriminator:
Finally, if generator training goes well, the discriminator gets worse at
telling the difference between real and fake. It starts to classify fake data as
real, and its accuracy decreases.
Here's a picture of the whole system:
Both the generator and the discriminator are neural networks. The generator
output is connected directly to the discriminator input. Through
backpropagation, the
discriminator's classification provides a signal that the generator uses to
update its weights.
Let's explain the pieces of this system in greater detail.
[[["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\u003eGANs consist of two neural networks: a generator creating data and a discriminator evaluating its authenticity.\u003c/p\u003e\n"],["\u003cp\u003eThe generator and discriminator are trained against each other, with the generator aiming to produce realistic data and the discriminator aiming to identify fake data.\u003c/p\u003e\n"],["\u003cp\u003eThrough continuous training, the generator improves its ability to create realistic data, while the discriminator struggles more with differentiation.\u003c/p\u003e\n"],["\u003cp\u003eThe ultimate goal is for the generator to create data so realistic that the discriminator cannot distinguish it from real data.\u003c/p\u003e\n"]]],[],null,["# Overview of GAN Structure\n\n\u003cbr /\u003e\n\nA generative adversarial network (GAN) has two parts:\n\n- The **generator** learns to generate plausible data. The generated instances become negative training examples for the discriminator.\n- The **discriminator** learns to distinguish the generator's fake data from real data. The discriminator penalizes the generator for producing implausible results.\n\nWhen training begins, the generator produces obviously fake data, and the\ndiscriminator quickly learns to tell that it's fake:\n\nAs training progresses, the generator gets closer to producing output that\ncan fool the discriminator:\n\nFinally, if generator training goes well, the discriminator gets worse at\ntelling the difference between real and fake. It starts to classify fake data as\nreal, and its accuracy decreases.\n\nHere's a picture of the whole system:\n\nBoth the generator and the discriminator are neural networks. The generator\noutput is connected directly to the discriminator input. Through\n[backpropagation](/machine-learning/glossary#backpropagation), the\ndiscriminator's classification provides a signal that the generator uses to\nupdate its weights.\n\nLet's explain the pieces of this system in greater detail."]]