Closed sarrbranka closed 3 years ago
Hi. I think the statement "the ideal output of D from real images to be 1 and from fake images to be 0" is not a necessity. For a discriminator, all we hope it can do is to distinguish the real/fake images. I.e. D's output value does not need to fall into a certain range, as long as D gives real images with a score towards one direction while gives fake images a score towards an opposite direction, then it's fine. The two values can be [-1,1], can be [0,1], also can be [-inf, inf]. It simply depends on what equation you use to wrap the idea of the loss. For example, if you wrap a sigmoid function, it of course restricts the D output to [0, 1].
Could you help me understand the relationship with the code *err = F.relu( torch.rand_like(pred) 0.2 + 0.8 + pred).mean()** and the d loss in the paper?
Why is the loss D for fake images min(0,-1-d(x_fake)) not min(0,-d(x_fake))? I feel like min(0,-1-d(x_fake)) can try to converge to -1 when the D is fed fake images. I thought the ideal output of D from real images to be 1 and from fake images to be 0.