simplegan.losses¶
The losses
sub-module provides users with useful loss functions which can be used to train their models.
GAN losses¶
InfoGAN losses¶
-
class
simplegan.losses.
auxillary_loss
[source]¶ Parameters: - disc_target (tensor) – a tensor representing the discriminator target ouput
- disc_preds (tensor) – a tensor representing the prediction of discriminator
- cont_trg (tensor) – a tensor representing the content of the target
- cont_pred (tensor) – a tensor representing the predicted content
Returns: a tensor representing the auxillary loss
Pix2Pix losses¶
-
class
simplegan.losses.
pix2pix_discriminator_loss
[source]¶ Parameters: - disc_real_output (tensor) – A tensor representing the real logits of the discriminator
- disc_fake_output (tensor) – A tensor representing the fake logits of the discriminator
Returns: total loss of discriminator
-
class
simplegan.losses.
pix2pix_generator_loss
[source]¶ Parameters: - disc_fake_output (tensor) – A tensor representing the fake logits of discriminator
- fake (tensor) – A tensor representing the values from the generator
- real (tensor) – A tensor representing the real values
- l (int) – An integer to scale the l1 loss
Returns: total loss of generator, total loss of GAN and L1 loss