kaira.losses.adversarial.FeatureMatchingLoss

Inheritance diagram of FeatureMatchingLoss

Inheritance diagram for FeatureMatchingLoss

class kaira.losses.adversarial.FeatureMatchingLoss[source]

Bases: BaseLoss

Feature Matching Loss Module for GANs.

This module implements the feature matching loss for improved GAN training.

Methods

__init__

Initialize the FeatureMatchingLoss module.

forward

Forward pass through the FeatureMatchingLoss module.

__init__()[source]

Initialize the FeatureMatchingLoss module.

forward(real_features: list, fake_features: list) Tensor[source]

Forward pass through the FeatureMatchingLoss module.

Parameters:
  • real_features (list) – List of discriminator features for real data.

  • fake_features (list) – List of discriminator features for fake data.

Returns:

The feature matching loss.

Return type:

torch.Tensor