Answers.Body: <p>GANs were invented in a bar somewhere in Montreal, Canada. At said bar, the idea was that neural networks could be used for generating new examples from an existing distribution. This was the problem:</p>
  <blockquote>
  <p>Given an input set <span class="math-container">$X$</span>, can we make a new <span class="math-container">$x'$</span> that looks like it should be in <span class="math-container">$X$</span>?</p>
  </blockquote>
  <p>The classic description of a GAN is a counterfeiter (generator) and a cop (discriminator). The counterfeiter has the same problem, make a piece of paper look like a real currency.</p>
  <p>In training a GAN, the input to the generator is random noise, a starting seed so that no 2 results are the same. The generator then makes a new <span class="math-container">$x'$</span>. The input to the discriminator alternates between an actual <span class="math-container">$x$</span> and an <span class="math-container">$x'$</span> that the generator made. The discriminator then takes the <span class="math-container">$x'$</span> and decides whether it is part of the set <span class="math-container">$X$</span>. The discriminator is then trained using its answer to ensure that it can properly tell the difference between bad counterfeits and elements of <span class="math-container">$X$</span>. When the discriminator makes a decision on an <span class="math-container">$x'$</span> that the generator made, the generator is updated as well, in order to increase its ability to make new <span class="math-container">$x'$</span>s that the discriminator will think are in <span class="math-container">$X$</span>.</p>
  <p>Using this simple framework, these 2 networks work against each other (adversarially) to train each other until the generator is making <span class="math-container">$x'$</span>s so well that the discriminator can't tell the difference between them and the real thing. At this point, the generator can be used to make new pictures of cats or whatever was the goal in the first place.</p>
  <p>The primary usage of <span class="math-container">$D$</span> is training <span class="math-container">$G$</span> in a (sorta) supervised way but after <span class="math-container">$G$</span> is trained, it isn't needed for generation. That's not to say having a good discriminator isn't useful. There are many applications where that's exactly what you'd want, but, if the goal is generation, then probably not. The generator is trained in a (sorta) supervised fashion because there is actually a label associated with the <span class="math-container">$x'$</span> it generates (whether the discriminator could detect that it was a counterfeit or not).  Unsupervised methods are used when there are no labels and one wants to understand how their data either by clustering or finding a good distance function. Refer to <a href="https://ai.stackexchange.com/q/4706/2444">this answer</a> to see the difference between supervised and unsupervised.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-22T12:17:24.440Z
Answers.Text: You could actually say that GANs are trained in a **self-supervised** way, so you may want to edit this answer to add this info. See [this post](https://ai.stackexchange.com/q/10623/2444). Moreover, you should probably cite the article, paper, etc., that states that GANs were invented in a bar. Sure, that story may be true (and I think I already heard of it before), but I think you should link to such original source that talks about it.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-01-29T10:33:14.103Z
Answers.LastActivityDate: 2020-11-22T12:15:35.953Z
Answers.LastEditDate: 2020-11-22T12:15:35.953Z
Answers.UserDisplayName: Jaden Travnik
Body: <p>The Generative Adversarial Network (GAN) is composed of a generator <span class="math-container">$G$</span> and a discriminator <span class="math-container">$D$</span>. How do these two components interact? What is the intuition behind the GAN, its purpose, and how it is trained?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-22T12:35:13.067Z
Comments.Text: [Here](https://ai.stackexchange.com/q/2211/2444) is a question asking about how GANs and, in particular, the discriminator are trained.
Comments.UserDisplayName: nbro
Tags: <deep-learning><generative-adversarial-networks><generative-model><self-supervised-learning>
Title: What is the purpose of the GAN?
UserDisplayName: XL _At_Here_There
ThreadText: # What is the purpose of the GAN?
  
  (Asked by: username_0 on 2018-01-29)
  
  The Generative Adversarial Network (GAN) is composed of a generator $G$ and a discriminator $D$. How do these two components interact? What is the intuition behind the GAN, its purpose, and how it is trained?
  
  **Tags:** deep-learning, generative-adversarial-networks, generative-model, self-supervised-learning
  
  > **Comments:**
  > **username_1**: [Here](https://ai.stackexchange.com/q/2211/2444) is a question asking about how GANs and, in particular, the discriminator are trained.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-01-29. Score: 3 | Accepted answer
  
  GANs were invented in a bar somewhere in Montreal, Canada. At said bar, the idea was that neural networks could be used for generating new examples from an existing distribution. This was the problem:
  
  > Given an input set $X$, can we make a new $x'$ that looks like it should be in $X$?
  
  The classic description of a GAN is a counterfeiter (generator) and a cop (discriminator). The counterfeiter has the same problem, make a piece of paper look like a real currency.
  
  In training a GAN, the input to the generator is random noise, a starting seed so that no 2 results are the same. The generator then makes a new $x'$. The input to the discriminator alternates between an actual $x$ and an $x'$ that the generator made. The discriminator then takes the $x'$ and decides whether it is part of the set $X$. The discriminator is then trained using its answer to ensure that it can properly tell the difference between bad counterfeits and elements of $X$. When the discriminator makes a decision on an $x'$ that the generator made, the generator is updated as well, in order to increase its ability to make new $x'$s that the discriminator will think are in $X$.
  
  Using this simple framework, these 2 networks work against each other (adversarially) to train each other until the generator is making $x'$s so well that the discriminator can't tell the difference between them and the real thing. At this point, the generator can be used to make new pictures of cats or whatever was the goal in the first place.
  
  The primary usage of $D$ is training $G$ in a (sorta) supervised way but after $G$ is trained, it isn't needed for generation. That's not to say having a good discriminator isn't useful. There are many applications where that's exactly what you'd want, but, if the goal is generation, then probably not. The generator is trained in a (sorta) supervised fashion because there is actually a label associated with the $x'$ it generates (whether the discriminator could detect that it was a counterfeit or not). Unsupervised methods are used when there are no labels and one wants to understand how their data either by clustering or finding a good distance function. Refer to [this answer](https://ai.stackexchange.com/q/4706/2444) to see the difference between supervised and unsupervised.
  
  > **Comments:**
  > **username_1**: You could actually say that GANs are trained in a **self-supervised** way, so you may want to edit this answer to add this info. See [this post](https://ai.stackexchange.com/q/10623/2444). Moreover, you should probably cite the article, paper, etc., that states that GANs were invented in a bar. Sure, that story may be true (and I think I already heard of it before), but I think you should link to such original source that talks about it.  
  
  ---
  
  