How to use the torchgan.models.AutoEncodingDiscriminator function in torchgan

To help you get started, we’ve selected a few torchgan examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github torchgan / torchgan / torchgan / losses / energybased.py View on Github external
real_inputs,
                device,
                labels,
            )
        else:
            if isinstance(discriminator, AutoEncodingDiscriminator):
                setattr(discriminator, "embeddings", False)
            loss = super(EnergyBasedDiscriminatorLoss, self).train_ops(
                generator,
                discriminator,
                optimizer_discriminator,
                real_inputs,
                device,
                labels,
            )
            if isinstance(discriminator, AutoEncodingDiscriminator):
                setattr(discriminator, "embeddings", True)
            return loss
github torchgan / torchgan / torchgan / losses / energybased.py View on Github external
device,
                batch_size,
                labels,
            )
        else:
            if isinstance(discriminator, AutoEncodingDiscriminator):
                setattr(discriminator, "embeddings", False)
            loss = super(EnergyBasedGeneratorLoss, self).train_ops(
                generator,
                discriminator,
                optimizer_generator,
                device,
                batch_size,
                labels,
            )
            if isinstance(discriminator, AutoEncodingDiscriminator):
                setattr(discriminator, "embeddings", True)
            return loss