How to use L1 loss in the DCGAN?

Hello all, I am looking for the way to use L1 loss in DCGAN. Currently, DCGAN in the pytorch example uses BCELoss.

criterion = nn.BCELoss()
errD_real = criterion(output, label)

As mentioned in the DCGAN paper :“L1 loss does very well at low frequencies (I think this means general tonal-distribution/contrast, color-blotches, etc) but fails at high frequencies (crispness/edge/detail) (thus you get blurry images).”. Thus, I would like to apply L1 loss instead of BCELoss. Have any one success to use L1 loss in DCGAN? How do you use it? Thanks
This is my current solution but I am not sure if it works?

criterion = nn.L1Loss()
errD_real = criterion(output, label)

l2 loss (i.e., LS-GAN) arguably is better than l1.

1 Like

Is BCELoss() L2 loss? Thanks

l2 loss is mse (mean squared error)

1 Like

Thanks. But dcgan used bceloss. What is type of bceloss ? Could I use bceloss and mse loss together in dcgan?

bce is the original gan loss, which is essentially log probability.