junyanz / pytorch-CycleGAN-and-pix2pix

Image-to-Image Translation in PyTorch
Other
22.8k stars 6.29k forks source link

ls-gan loss #1548

Closed PRigas96 closed 1 year ago

PRigas96 commented 1 year ago

hello i was searching through the code for the lsgan loss and found: if gan_mode == 'lsgan': self.loss = nn.MSELoss() if self.gan_mode in ['lsgan', 'vanilla']: target_tensor = self.get_target_tensor(prediction, target_is_real) loss = self.loss(prediction, target_tensor)

i would be pleased if you could explain how is this equal to: image

for example, where are a,b and c valued.

junyanz commented 1 year ago

b=1, a=0, and c=1. We use MSELoss to implement L2 loss.