(self, x, y, is_training)
return out, out_logit, net
Apply the discriminator on a input.

    Args:
      x: `Tensor` of shape [batch_size, ?, ?, ?] with real or fake images.
      y: `Tensor` of shape [batch_size, num_classes] with one hot encoded
        labels.
      is_training: Boolean, whether the architecture should be constructed for
        training or inference.

    Returns:
      Tuple of 3 Tensors, the final prediction of the discriminator, the logits
      before the final output activation function and logits form the second
      last layer.
Apply the discriminator on a input.
Apply the discriminator on a input .
def apply(self, x, y, is_training):
    """Apply the discriminator on a input.

    Args:
      x: `Tensor` of shape [batch_size, ?, ?, ?] with real or fake images.
      y: `Tensor` of shape [batch_size, num_classes] with one hot encoded
        labels.
      is_training: Boolean, whether the architecture should be constructed for
        training or inference.

    Returns:
      Tuple of 3 Tensors, the final prediction of the discriminator, the logits
      before the final output activation function and logits form the second
      last layer.
    """
    bs = x.shape[0].value
    df_dim = 64  # Dimension of filters in the first convolutional layer.
    net = lrelu(conv2d(x, df_dim, 5, 5, 2, 2, name="d_conv1",
                       use_sn=self._spectral_norm))
    net = conv2d(net, df_dim * 2, 5, 5, 2, 2, name="d_conv2",
                 use_sn=self._spectral_norm)

    net = self.batch_norm(net, y=y, is_training=is_training, name="d_bn1")
    net = lrelu(net)
    net = conv2d(net, df_dim * 4, 5, 5, 2, 2, name="d_conv3",
                 use_sn=self._spectral_norm)

    net = self.batch_norm(net, y=y, is_training=is_training, name="d_bn2")
    net = lrelu(net)
    net = conv2d(net, df_dim * 8, 5, 5, 2, 2, name="d_conv4",
                 use_sn=self._spectral_norm)

    net = self.batch_norm(net, y=y, is_training=is_training, name="d_bn3")
    net = lrelu(net)
    out_logit = linear(
        tf.reshape(net, [bs, -1]), 1, scope="d_fc4", use_sn=self._spectral_norm)
    out = tf.nn.sigmoid(out_logit)
    return out, out_logit, net
def apply ( self , x , y , is_training ) : bs = x . shape [ 0 ] . value df_dim = 64 # Dimension of filters in the first convolutional layer. net = lrelu ( conv2d ( x , df_dim , 5 , 5 , 2 , 2 , name = "d_conv1" , use_sn = self . _spectral_norm ) ) net = conv2d ( net , df_dim * 2 , 5 , 5 , 2 , 2 , name = "d_conv2" , use_sn = self . _spectral_norm ) net = self . batch_norm ( net , y = y , is_training = is_training , name = "d_bn1" ) net = lrelu ( net ) net = conv2d ( net , df_dim * 4 , 5 , 5 , 2 , 2 , name = "d_conv3" , use_sn = self . _spectral_norm ) net = self . batch_norm ( net , y = y , is_training = is_training , name = "d_bn2" ) net = lrelu ( net ) net = conv2d ( net , df_dim * 8 , 5 , 5 , 2 , 2 , name = "d_conv4" , use_sn = self . _spectral_norm ) net = self . batch_norm ( net , y = y , is_training = is_training , name = "d_bn3" ) net = lrelu ( net ) out_logit = linear ( tf . reshape ( net , [ bs , - 1 ] ) , 1 , scope = "d_fc4" , use_sn = self . _spectral_norm ) out = tf . nn . sigmoid ( out_logit ) return out , out_logit , net