def METHOD_NAME(self):
    """Calculate GAN and L1 loss for the generator"""
    # First, G(A) should fake the discriminator
    fake_AB = torch.cat((self.real_A, self.fake_B), 1)
    pred_fake = self.netD(fake_AB)
    self.loss_G_GAN = self.criterionGAN(pred_fake, True)
    # Second, G(A) = B
    self.loss_G_L1 = self.criterionL1(self.fake_B, self.real_B) * self.opt.lambda_L1
    # combine loss and calculate gradients
    self.loss_G = self.loss_G_L1 + self.loss_G_GAN
    self.loss_G.backward()