# Generative Adversarial networks
Generative Adversarial Networks consist of two networks that are trying to beat each other. One network is trying to fool another network while the other network is learning to differentiate enough so the other network does not fool it.
The two networks are called
- Generator
- Discriminator
```mermaid
graph LR;
a[Noise] --> b[Generator] --> c[Fake Data] --> e((or))
d[Real data] --> e --> f[Discriminator]
style b fill: #d62828
style f fill: #d62828
style b color: #ffffff
style f color: #ffffff
```
The generator never sees the real images. It only sees the noise. It learns from the gradients from the discriminator.
Training happens in two phases
1. Discriminator is first trained with labeled images to discriminate real and fake ( binary classification)
2. Generator is then trained to produce fake images that will fool the discriminator into thinking they were real.
## Selu Activation
Activation called "selu" is used a lot in GANs. Selu stands for self normalizing neural networks.
## Mode Collapse
Discriminator learns to reproduce a small subset of the data to fool the generator rather than everything. For example for MNIST data the generator can learn to produce only 1s and 7s since they are easy ignoring other digits.
## DCGAN
Deep Convolutional GAN