Answers.Body: <p>Answers:  </p>
  
  <ol>
  <li>No, generally GANs model the joint distribution of pixel space. The space is so entangled that it would be very difficult to model a singular pixels PDF.  </li>
  <li>This question doesn't make sense given the first question's answer. You do <strong>NOT</strong> sample singular pixels, you sample the joint.  </li>
  <li><span class="math-container">$P_g$</span> is trying to model <span class="math-container">$P_{data}$</span>, so that's your goal, so <strong>yes</strong> it will find features in the training set. Ideally, though it can extrapolate usage of the features to generate new images. But, yes depending on your setup you can end up with overfitting or mode-collapse where you really only generate a small subset of images that trick the discriminator. So I would say, no, the GAN doesn't know what its doing (since its just a minimax optimization of a loss you setup), so your goal is to tell it what to do in a way to achieve your best result.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-19T13:56:28.237Z
Answers.LastActivityDate: 2019-07-19T17:42:03.033Z
Answers.LastEditDate: 2019-07-19T17:42:03.033Z
Answers.UserDisplayName: mshlis
Body: <p>Referring to the blog, <a href="http://bamos.github.io/2016/08/09/deep-completion/#step-1-interpreting-images-as-samples-from-a-probability-distribution" rel="nofollow noreferrer">Image Completion with Deep Learning in TensorFlow</a>, it clearly says that we would want a generator <span class="math-container">$g$</span> whose modeled distribution fits our dataset <span class="math-container">$data$</span>, in other words, <span class="math-container">$P_{data}=P_g$</span>. </p>
  
  <p>But, as described earlier in the blog, the space <span class="math-container">$P_{data}$</span> is in is a higher-dimensional space, where a dimension represents a particular pixel in an image, making it a <span class="math-container">$64*64*3$</span> dimensional space (in this case). I have a few questions regarding this  </p>
  
  <ol>
  <li>Since each pixel here will have an intensity value, will the pdf try to encapsulate a unique pdf for each pixel?</li>
  <li>If we sample the most likely pixel value for each pixel, considering the distributions need not be the same for each pixel, is it not quite likely that the most probabilistic generated image is just noise apart from things like a common background or so?</li>
  <li>If <span class="math-container">$P_g$</span> is trying to replicate <span class="math-container">$P_{data}$</span> only, does that mean a GAN only tries to learn lower level features that are common in the training set? Are GANs clueless about what its doing?</li>
  </ol>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-19T11:24:27.120Z
Comments.Text: Addition to Q2 - If not noise should it not produce the exact same image if that image with highest probabilities happens to exist?
Comments.UserDisplayName: ashenoy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-19T11:25:12.077Z
Comments.Text: General Addition - Is my understanding even in the right direction in the first place?
Comments.UserDisplayName: ashenoy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-20T13:40:20.143Z
Comments.Text: Hi. Please, next time ask one question per post!
Comments.UserDisplayName: nbro
Tags: <deep-learning><convolutional-neural-networks><generative-adversarial-networks><generative-model><image-generation>
Title: If the goal of training of a GAN is to have $P_g=P_{data}$, shouldn't this produce the exact same images?
UserDisplayName: ashenoy
ThreadText: # If the goal of training of a GAN is to have $P_g=P_{data}$, shouldn't this produce the exact same images?
  
  (Asked by: username_0 on 2019-07-19)
  
  Referring to the blog, [Image Completion with Deep Learning in TensorFlow](http://bamos.github.io/2016/08/09/deep-completion/#step-1-interpreting-images-as-samples-from-a-probability-distribution), it clearly says that we would want a generator $g$ whose modeled distribution fits our dataset $data$, in other words, $P\_{data}=P\_g$.
  
  But, as described earlier in the blog, the space $P\_{data}$ is in is a higher-dimensional space, where a dimension represents a particular pixel in an image, making it a $64\*64\*3$ dimensional space (in this case). I have a few questions regarding this
  
  1. Since each pixel here will have an intensity value, will the pdf try to encapsulate a unique pdf for each pixel?
  2. If we sample the most likely pixel value for each pixel, considering the distributions need not be the same for each pixel, is it not quite likely that the most probabilistic generated image is just noise apart from things like a common background or so?
  3. If $P\_g$ is trying to replicate $P\_{data}$ only, does that mean a GAN only tries to learn lower level features that are common in the training set? Are GANs clueless about what its doing?
  
  **Tags:** deep-learning, convolutional-neural-networks, generative-adversarial-networks, generative-model, image-generation
  
  > **Comments:**
  > **username_0**: Addition to Q2 - If not noise should it not produce the exact same image if that image with highest probabilities happens to exist?  
  > **username_0**: General Addition - Is my understanding even in the right direction in the first place?  
  > **username_1**: Hi. Please, next time ask one question per post!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-07-19. Score: 0 | Accepted answer
  
  Answers:
  
  1. No, generally GANs model the joint distribution of pixel space. The space is so entangled that it would be very difficult to model a singular pixels PDF.
  2. This question doesn't make sense given the first question's answer. You do **NOT** sample singular pixels, you sample the joint.
  3. $P\_g$ is trying to model $P\_{data}$, so that's your goal, so **yes** it will find features in the training set. Ideally, though it can extrapolate usage of the features to generate new images. But, yes depending on your setup you can end up with overfitting or mode-collapse where you really only generate a small subset of images that trick the discriminator. So I would say, no, the GAN doesn't know what its doing (since its just a minimax optimization of a loss you setup), so your goal is to tell it what to do in a way to achieve your best result.
  
  
  ---
  
  