Body: <p>In Goodfellow's paper, he says:</p>
  
  <blockquote>
    <p>Hence, by inspecting Eq. 4 at <span class="math-container">$D^*_G (\mathbf{x}) = \frac{1}{2}$</span>, we find <span class="math-container">$C(G) = \log \frac{1}{2}+ \log \frac{1}{2} = − \log 4$</span>. To see that this is the best possible value of <span class="math-container">$C(G)$</span></p>
  </blockquote>
  
  <p>i.e. <span class="math-container">$D$</span> and <span class="math-container">$G$</span> loss should converge to <span class="math-container">$\log \frac{1}{2}$</span>. This makes perfect sense. When I train a GAN in PyTorch with BCEloss, the loss for <span class="math-container">$D$</span> and <span class="math-container">$G$</span> converge to <span class="math-container">$\log(2)$</span>, the negative of what Goodfellow states and what I'd expect.</p>
  
  <p>What am I missing?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-27T17:08:11.597Z
Comments.Text: Hi and welcome to AI! $\log 2$ is not the negative of $-\log 4$. Can you clarify this?
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-27T17:19:42.787Z
Comments.Text: Sorry, individual loss for **_D_** and **_G_** are log(½) = -log(2). When added together the total loss is -2log(2) = -log(4), whereas I am getting log(2) + log(2) = log(4)
Comments.UserDisplayName: Oisin Peppard
Tags: <objective-functions><generative-adversarial-networks><papers><pytorch>
Title: Why does GAN loss converge to log(2) and not -log(2)?
UserDisplayName: Oisin Peppard
ThreadText: # Why does GAN loss converge to log(2) and not -log(2)?
  
  (Asked by: username_0 on 2020-03-27)
  
  In Goodfellow's paper, he says:
  
  > Hence, by inspecting Eq. 4 at $D^\*\_G (\mathbf{x}) = \frac{1}{2}$, we find $C(G) = \log \frac{1}{2}+ \log \frac{1}{2} = − \log 4$. To see that this is the best possible value of $C(G)$
  
  i.e. $D$ and $G$ loss should converge to $\log \frac{1}{2}$. This makes perfect sense. When I train a GAN in PyTorch with BCEloss, the loss for $D$ and $G$ converge to $\log(2)$, the negative of what Goodfellow states and what I'd expect.
  
  What am I missing?
  
  **Tags:** objective-functions, generative-adversarial-networks, papers, pytorch
  
  > **Comments:**
  > **username_1**: Hi and welcome to AI! $\log 2$ is not the negative of $-\log 4$. Can you clarify this?  
  > **username_0**: Sorry, individual loss for **_D_** and **_G_** are log(½) = -log(2). When added together the total loss is -2log(2) = -log(4), whereas I am getting log(2) + log(2) = log(4)  
  
  ---
  
  ## 0 answers
  
  