rosinality/progressive-gan-pytorch

Discriminator Loss Formula

Opened this issue · 1 comments

Thanks for your nice and clean work!

When I tried to understand your code, I found that

b_size = real_image.size(0)
        real_image = real_image.to(device)
        label = label.to(device)
        real_predict = encoder(
            real_image, step=step, alpha=alpha)
        real_predict = real_predict.mean() \
                       - 0.001 * (real_predict ** 2).mean() 

I don't quite understand why the variable real_predict needs to be modified to eal_predict.mean() \- 0.001 * (real_predict ** 2).mean(). Why don't we just modify the discriminator to output a single value? and how do you come out of this formula?

Again, many thanks for your excellent work. I am new to deep learning and GAN so sorry for any inconvenience caused.

@IcecreamArtist I'm also stuck in this problem, do you figure out the reason of this design and willing to share with me?