Open chobao opened 2 years ago
There are two things to note here: first, during a training of a GAN, you want to reach the saddle point where the Discriminator cannot distinguish between a real and fake image. Secondly, the output of StyleGAN is no longer a probability or anything related to it, but a score ever since WGAN, so the probabilities you obtained (via passing them through a sigmoid function) are incorrect.
In the end, I think you won't get what you want from the Discriminator of a fully trained GAN, perhaps of one at the beginning of training, sure, as then the distinction between a real and a fake image is much more apparent. Hope this helped!
Oh, Thanks @PDillis for replying to my naive question. I am new to styleGAN. As you commented, the output of styleGAN discriminator is just a score that the higher one is real and the lower one is fake. Besides, it seems that the value x
to distinguish between real and fake (the score higher than $x$ is real, otherwise is fake) differs in each model and is not obvious to obtain.
Therefore, pre-trained styleGAN discriminator is useless and I have to train my own discriminator to supervise my image generation network.
No problem. However, I disagree with D being useless: after all, you are trying to use a network trained for one purpose for another completely different one. What you could do to use D is to use its intermediate layers as these most likely contain key features of what makes up a car. This is what I do here, though the code needs a bit of revision.
@PDillis I am not sure that the Discriminator of a fully trained GAN cannot distinguish between a real and fake image. The fact that the Discriminator can not distinguish fake at the end of the training should be that the Generator produces images that are realistic, and therefore the Discriminator cannot tell the difference. However, it will still be useful for "fake" images as shown in this thread
Hi, I came across the problem when using pre-trained styleGAN2 discriminator. I use discriminator of
stylegan2-car-config-f.pkl
as the supervision for training another image generation network. However, the pre-trained discriminator can not distinguish the real and fake images.Here are my test codes:
Here are my test results: real image,
probability: 0.00916453, score:-4.6878304
real image,
probability: 0.004, score:-5.490464
fake image,
probability: 0.006, score:-5.0358
fake image,
probability: 0.006, score:-4.994