Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import tensorflow as tf
import hyperchamber as hc
from hypergan.losses.base_loss import BaseLoss
class WassersteinLoss(BaseLoss):
def _create(self, d_real, d_fake):
config = self.config
print("Initializing Wasserstein loss", config.reverse)
if(config.reverse):
d_loss = -d_real + d_fake
g_loss = -d_fake
else:
d_loss = d_real - d_fake
g_loss = d_fake
return [d_loss, g_loss]