Answers.Body: <blockquote>
  <p>Discriminator in the original GAN is a regressor</p>
  </blockquote>
  <p>No, it is a classifier. It classifies an image as &quot;real&quot; or &quot;fake&quot;, with the output usually being probability that the image is &quot;real&quot; (you could reverse this and use generated images as the target class, provided you change the generator training to match).</p>
  <blockquote>
  <p>Is it true with most of the (advanced or) contemporary GANs?</p>
  </blockquote>
  <p><a href="https://machinelearningmastery.com/how-to-code-a-wasserstein-generative-adversarial-network-wgan-from-scratch/" rel="nofollow noreferrer">In WGANs the W stands for Wasserstein</a>, and these GANs use Wassersten loss, which measures the distance in &quot;realness&quot; between real and fake images. This measure of realness is a regression problem, with the caveat that there is no true measure of realness for any images that you can train with separately. The architecture of the critic, which plays the same role as discriminator for classic GANs, is the same as a neural network used for regression.</p>
  <p>In general, if you see the term &quot;discriminator&quot;, you can assume a classifier is being used. If you see the term &quot;critic&quot;, you can assume a regressor. This may not be true for everything published about GANs, as some authors may use the terms loosely, but it is reasonable to expect if you are reading original papers or learning from a course.</p>
  <p>As far as I can tell, <a href="https://github.com/NVlabs/stylegan2" rel="nofollow noreferrer">StyleGAN2</a>, which produces state-of-the-art results, uses a standard discriminator/classifier setup. There are plenty of other architectural details in the discriminator that contribute to the performance of the GAN. There is a link to the paper describing these from the linked Github implementation.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-29T07:31:34.733Z
Answers.LastActivityDate: 2021-08-29T07:31:34.733Z
Answers.UserDisplayName: Neil Slater
Body: <p>GAN has two components: generator and discriminator.</p>
  <p>Discriminator in the original GAN is a regressor and always gives value in <span class="math-container">$[0, 1]$</span>. You can read it in original paper</p>
  <blockquote>
  <p><span class="math-container">$D(x)$</span> represents the <strong>probability</strong> that <span class="math-container">$x$</span> came from the data rather
  than <span class="math-container">$p_g$</span></p>
  </blockquote>
  <p>Is it true with most of the (advanced or) contemporary GANs? Or the do nature of discriminator, either as a regressor or as a classifier entirely depends on the context?</p>
  
Tags: <generative-adversarial-networks><discriminator>
Title: Is discriminator a regressor or classifier in implementations?
UserDisplayName: hanugm
ThreadText: # Is discriminator a regressor or classifier in implementations?
  
  (Asked by: username_0 on 2021-08-29)
  
  GAN has two components: generator and discriminator.
  
  Discriminator in the original GAN is a regressor and always gives value in $[0, 1]$. You can read it in original paper
  
  > $D(x)$ represents the **probability** that $x$ came from the data rather
  > than $p\_g$
  
  Is it true with most of the (advanced or) contemporary GANs? Or the do nature of discriminator, either as a regressor or as a classifier entirely depends on the context?
  
  **Tags:** generative-adversarial-networks, discriminator
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-08-29. Score: 2
  
  > Discriminator in the original GAN is a regressor
  
  No, it is a classifier. It classifies an image as "real" or "fake", with the output usually being probability that the image is "real" (you could reverse this and use generated images as the target class, provided you change the generator training to match).
  
  > Is it true with most of the (advanced or) contemporary GANs?
  
  [In WGANs the W stands for Wasserstein](https://machinelearningmastery.com/how-to-code-a-wasserstein-generative-adversarial-network-wgan-from-scratch/), and these GANs use Wassersten loss, which measures the distance in "realness" between real and fake images. This measure of realness is a regression problem, with the caveat that there is no true measure of realness for any images that you can train with separately. The architecture of the critic, which plays the same role as discriminator for classic GANs, is the same as a neural network used for regression.
  
  In general, if you see the term "discriminator", you can assume a classifier is being used. If you see the term "critic", you can assume a regressor. This may not be true for everything published about GANs, as some authors may use the terms loosely, but it is reasonable to expect if you are reading original papers or learning from a course.
  
  As far as I can tell, [StyleGAN2](https://github.com/NVlabs/stylegan2), which produces state-of-the-art results, uses a standard discriminator/classifier setup. There are plenty of other architectural details in the discriminator that contribute to the performance of the GAN. There is a link to the paper describing these from the linked Github implementation.
  
  
  ---
  
  