What Does Generative Adversarial Network Mean?
A generative adversarial network (GAN) is a machine learning framework that consists of two neural networks: a generator and a discriminator. The generator’s role is to generate synthetic data (such as images, text, or audio), while the discriminator tries to distinguish between the synthetic data and real data from a training set.
During training, the generator learns to produce increasingly realistic outputs by trying to fool the discriminator, and the discriminator learns to improve its ability to correctly identify synthetic data. This adversarial process encourages both networks to improve over time.
The ultimate goal of a GAN is to generate synthetic data that is indistinguishable from real data.
GANs are also used to create deep fake content.
How a GAN Works
The two networks compete against each other in a zero-sum game. The objective of the game is for the generator to improve its ability to produce synthetic data that appears to be real — while at the same time, the discriminator improves its ability to correctly classify data as being either real or synthetic. The game ends when the discriminator network is not able to distinguish the generative network’s synthetic data from real data.
GANs are specifically designed for unsupervised machine learning tasks and each round of the zero-sum game the two networks play is actually a training session.
During each iteration of the game, the generator feeds a batch of real data samples and an equal-sized batch of generated data samples to the discriminator network. The discriminator is tasked with assigning high probabilities to real data and low probabilities to synthetic data and sharing this information with the generator. The generator uses this feedback to adjust its parameters and they play again.
The zero-sum game creates a competitive dynamic that helps the generator network capture statistical patterns from the training data and use deep learning to generate new samples that exhibit similar characteristics. At the same time, it helps the discriminator network learn more about the underlying distribution of the real training data and become better at classifying the new data it receives.
As the game progresses the generator continually adjusts parameters to try and produce realistic data – while at the same time, the discriminator continually adjusts its own parameters to become more accurate in its predictions.
The game continues until the discriminator network is not able to distinguish between real and generated samples. At this point, the two networks have reached convergence and training is stopped.