PyTorch-GAN icon indicating copy to clipboard operation
PyTorch-GAN copied to clipboard

Possible error of relativistic gan

Open gregjohnso opened this issue 5 years ago • 2 comments

in https://github.com/eriklindernoren/PyTorch-GAN/blob/master/implementations/relativistic_gan/relativistic_gan.py

        if opt.rel_avg_gan:
            g_loss = adversarial_loss(fake_pred - real_pred.mean(0, keepdim=True), valid)
        else:
            g_loss = adversarial_loss(fake_pred - real_pred, valid)

        # Loss measures generator's ability to fool the discriminator
        g_loss = adversarial_loss(discriminator(gen_imgs), valid)

        g_loss.backward()
        optimizer_G.step()

Is this expected? Does it look like g_loss is getting overwritten?

gregjohnso avatar May 09 '19 06:05 gregjohnso

Up, error is still there.

I believe you can just discard g_loss = adversarial_loss(discriminator(gen_imgs), valid)

jbdel avatar Aug 14 '19 15:08 jbdel

Why dont author merge this ? I think this is a serious error.

phongnhhn92 avatar Aug 16 '20 13:08 phongnhhn92