Pix2PixLoss¶
Inheritance Diagram

-
class
ashpy.losses.gan.Pix2PixLoss(l1_loss_weight=100.0, adversarial_loss_weight=1.0, feature_matching_weight=10.0, adversarial_loss_type=<AdversarialLossType.GAN: 1>, use_feature_matching_loss=False)[source]¶ Bases:
ashpy.losses.executor.SumExecutorPix2Pix Loss.
Weighted sum of
ashpy.losses.gan.GeneratorL1,ashpy.losses.gan.AdversarialLossGandashpy.losses.gan.FeatureMatchingLoss.Used by Pix2Pix [1] and Pix2PixHD [2]
- 1
Image-to-Image Translation with Conditional Adversarial Networks https://arxiv.org/abs/1611.07004
- 2
High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs https://arxiv.org/abs/1711.11585
Methods
__init__([l1_loss_weight, …])Initialize the loss.
Attributes
executorsReturn the List of Executors.
fnReturn the Keras loss function to execute.
global_batch_sizeGlobal batch size comprises the batch size for each cpu.
weightReturn the loss weight.
-
__init__(l1_loss_weight=100.0, adversarial_loss_weight=1.0, feature_matching_weight=10.0, adversarial_loss_type=<AdversarialLossType.GAN: 1>, use_feature_matching_loss=False)[source]¶ Initialize the loss.
Weighted sum of
ashpy.losses.gan.GeneratorL1,ashpy.losses.gan.AdversarialLossGandashpy.losses.gan.FeatureMatchingLoss.- Parameters
l1_loss_weight (
ashpy.ashtypes.TWeight) – Weight of L1 loss.adversarial_loss_weight (
ashpy.ashtypes.TWeight) – Weight of adversarial loss.feature_matching_weight (
ashpy.ashtypes.TWeight) – Weight of the feature matching loss.adversarial_loss_type (
ashpy.losses.gan.AdversarialLossType) – Adversarial loss type (ashpy.losses.gan.AdversarialLossType.GANorashpy.losses.gan.AdversarialLossType.LSGAN).use_feature_matching_loss (bool) – if True use also uses
ashpy.losses.gan.FeatureMatchingLoss.
- Return type