Exemplo n.º 1
0
 def build_loss(self):
     with tf.name_scope('Loss'):
         g_loss, d_loss = loss_wgan(*self.d_outputs)
         with tf.variable_scope(self.name, reuse=True):
             gp = gradient_penalty(*self.g_outputs, self.D, lamb=10)
         d_loss += gp
         self._build_loss(g_loss, d_loss)
Exemplo n.º 2
0
 def build_loss(self):
     with tf.name_scope('Loss'):
         g_loss, d_loss = loss_relative_bce_gan(*self.d_outputs,
                                                average=True)
         with tf.variable_scope(self.name, reuse=True):
             gp = gradient_penalty(*self.g_outputs,
                                   graph_fn=self.D,
                                   lamb=10)
         d_loss += gp
         self._build_loss(g_loss, d_loss)