Architecture of GANs
A Generative Adversarial Network (GAN) is composed of two primary parts, which are the Generator and the Discriminator.
Generator Model
A key element responsible for creating fresh, accurate data in a Generative Adversarial Network (GAN) is the generator model. The generator takes random noise as input and converts it into complex data samples, such text or images. It is commonly depicted as a deep neural network.
The training data’s underlying distribution is captured by layers of learnable parameters in its design through training. The generator adjusts its output to produce samples that closely mimic real data as it is being trained by using backpropagation to fine-tune its parameters.
The generator’s ability to generate high-quality, varied samples that can fool the discriminator is what makes it successful.
Generator Loss
The objective of the generator in a GAN is to produce synthetic samples that are realistic enough to fool the discriminator. The generator achieves this by minimizing its loss function [Tex]J_G[/Tex]. The loss is minimized when the log probability is maximized, i.e., when the discriminator is highly likely to classify the generated samples as real. The following equation is given below:
[Tex]J_{G} = -\frac{1}{m} \Sigma^m _{i=1} log D(G(z_{i}))
[/Tex]
Where,
- [Tex]J_G[/Tex] measure how well the generator is fooling the discriminator.
- log [Tex]D(G(z_i) )[/Tex]represents log probability of the discriminator being correct for generated samples.
- The generator aims to minimize this loss, encouraging the production of samples that the discriminator classifies as real [Tex](log D(G(z_i))[/Tex], close to 1.
Discriminator Model
An artificial neural network called a discriminator model is used in Generative Adversarial Networks (GANs) to differentiate between generated and actual input. By evaluating input samples and allocating probability of authenticity, the discriminator functions as a binary classifier.
Over time, the discriminator learns to differentiate between genuine data from the dataset and artificial samples created by the generator. This allows it to progressively hone its parameters and increase its level of proficiency.
Convolutional layers or pertinent structures for other modalities are usually used in its architecture when dealing with picture data. Maximizing the discriminator’s capacity to accurately identify generated samples as fraudulent and real samples as authentic is the aim of the adversarial training procedure. The discriminator grows increasingly discriminating as a result of the generator and discriminator’s interaction, which helps the GAN produce extremely realistic-looking synthetic data overall.
Discriminator Loss
The discriminator reduces the negative log likelihood of correctly classifying both produced and real samples. This loss incentivizes the discriminator to accurately categorize generated samples as fake and real samples with the following equation:
[Tex]J_{D} = -\frac{1}{m} \Sigma_{i=1}^m log\; D(x_{i}) – \frac{1}{m}\Sigma_{i=1}^m log(1 – D(G(z_{i}))
[/Tex]
- [Tex]J_D[/Tex] assesses the discriminator’s ability to discern between produced and actual samples.
- The log likelihood that the discriminator will accurately categorize real data is represented by [Tex]logD(x_i)[/Tex].
- The log chance that the discriminator would correctly categorize generated samples as fake is represented by [Tex]log(1-D(G(z_i)))[/Tex].
- The discriminator aims to reduce this loss by accurately identifying artificial and real samples.
MinMax Loss
In a Generative Adversarial Network (GAN), the minimax loss formula is provided by:
[Tex]min_{G}\;max_{D}(G,D) = [\mathbb{E}_{x∼p_{data}}[log\;D(x)] + \mathbb{E}_{z∼p_{z}(z)}[log(1 – D(g(z)))]
[/Tex]
Where,
- G is generator network and is D is the discriminator network
- Actual data samples obtained from the true data distribution [Tex]p_{data}(x) [/Tex] are represented by x.
- Random noise sampled from a previous distribution [Tex]p_z(z) [/Tex](usually a normal or uniform distribution) is represented by z.
- D(x) represents the discriminator’s likelihood of correctly identifying actual data as real.
- D(G(z)) is the likelihood that the discriminator will identify generated data coming from the generator as authentic.
Generative Adversarial Network (GAN)
GAN(Generative Adversarial Network) represents a cutting-edge approach to generative modeling within deep learning, often leveraging architectures like convolutional neural networks. The goal of generative modeling is to autonomously identify patterns in input data, enabling the model to produce new examples that feasibly resemble the original dataset.
This article covers everything you need to know about GAN, the Architecture of GAN, the Workings of GAN, and types of GAN Models, and so on.
Table of Content
- What is a Generative Adversarial Network?
- Types of GANs
- Architecture of GANs
- How does a GAN work?
- Implementation of a GAN
- Application Of Generative Adversarial Networks (GANs)
- Advantages of GAN
- Disadvantages of GAN
- GAN(Generative Adversarial Network)- FAQs