HyperGAN
  • About
  • Getting started
  • CLI guide
  • Configurations
    • Configurable Parameters
  • Showcase
    • AI Explorer for Android
    • Youtube, Twitter, Discord +
  • Examples
    • 2D
    • Text
    • Classification
    • Colorizer
    • Next Frame (video)
  • Tutorials
    • Training a GAN
    • Pygame inference
    • Creating an image dataset
    • Searching for hyperparameters
  • Components
    • GAN
      • Aligned GAN
      • Aligned Interpolated GAN
      • Standard GAN
    • Generator
      • Configurable Generator
      • DCGAN Generator
      • Resizable Generator
    • Discriminator
      • DCGAN Discriminator
      • Configurable Discriminator
    • Layers
      • add
      • cat
      • channel_attention
      • ez_norm
      • layer
      • mul
      • multi_head_attention
      • operation
      • pixel_shuffle
      • residual
      • resizable_stack
      • segment_softmax
      • upsample
    • Loss
      • ALI Loss
      • F Divergence Loss
      • Least Squares Loss
      • Logistic Loss
      • QP Loss
      • RAGAN Loss
      • Realness Loss
      • Softmax Loss
      • Standard Loss
      • Wasserstein Loss
    • Latent
      • Uniform Distribution
    • Trainer
      • Alternating Trainer
      • Simultaneous Trainer
      • Balanced Trainer
      • Accumulate Gradient Trainer
    • Optimizer
    • Train Hook
      • Adversarial Norm
      • Weight Constraint
      • Stabilizing Training
      • JARE
      • Learning Rate Dropout
      • Gradient Penalty
      • Rolling Memory
    • Other GAN implementations
Powered by GitBook
On this page
  • examples
  • options

Was this helpful?

  1. Components
  2. Loss

RAGAN Loss

PreviousQP LossNextRealness Loss

Last updated 4 years ago

Was this helpful?

  • Adapted from

  • Source:

# wasserstein type
cr = torch.mean(d_real,0)
cf = torch.mean(d_fake,0)
d_loss = -(d_real-cf) + (d_fake-cr)
g_loss = -(d_fake-cr)

examples

  • Configurations:

{
  "class": "function:hypergan.losses.ragan_loss.RaganLoss",
  "type": "hinge"
}

options

attribute

description

type

type

least_squares,hinge,wasserstein or standard. Defaults to standard

string (optional)

rgan

rgan does not average over batch. Defaults to false

boolean (optional)

labels

[a,b,c]. Defaults to [-1,1,1]. Only used in least_squares type

array of floats (optional)

https://arxiv.org/abs/1807.00734
/losses/ragan_loss.py
/losses/ragan_loss/