a-PyTorch-Tutorial-to-Super-Resolution icon indicating copy to clipboard operation
a-PyTorch-Tutorial-to-Super-Resolution copied to clipboard

There is a mistake in the file trian_srgan.py.

Open xygo567 opened this issue 2 years ago • 1 comments

To the beginning, thanks a lot to the author. I find a small mistake in the code. I hope the author could correct it. In the Line 192 of the file trian_srgan.py, the input for adversarial_loss_criterion should be sr_discriminated and torch.zeros_like(sr_discriminated).

xygo567 avatar Nov 21 '23 04:11 xygo567

Hi @xygo567, that is correct, is it not?

In the adversarial loss, we give the wrong labels to the discriminator's loss function in order to obtain gradient information to change the generator's parameters in a way that pushes the discriminator to make wrong predictions. Because we want to the discriminator to be wrong (i.e. fooled by the generator's output).

sgrvinod avatar Nov 22 '23 23:11 sgrvinod