(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.
    """
    del is_training, y
    use_sn = self._spectral_norm
    # In compare gan framework, the image preprocess normalize image pixel to
    # range [0, 1], while author used [-1, 1]. Apply this trick to input image
    # instead of changing our preprocessing function.
    x = x * 2.0 - 1.0
    net = conv2d(x, 64, 3, 3, 1, 1, name="d_conv1", use_sn=use_sn)
    net = lrelu(net, leak=0.1)
    net = conv2d(net, 128, 4, 4, 2, 2, name="d_conv2", use_sn=use_sn)
    net = lrelu(net, leak=0.1)
    net = conv2d(net, 128, 3, 3, 1, 1, name="d_conv3", use_sn=use_sn)
    net = lrelu(net, leak=0.1)
    net = conv2d(net, 256, 4, 4, 2, 2, name="d_conv4", use_sn=use_sn)
    net = lrelu(net, leak=0.1)
    net = conv2d(net, 256, 3, 3, 1, 1, name="d_conv5", use_sn=use_sn)
    net = lrelu(net, leak=0.1)
    net = conv2d(net, 512, 4, 4, 2, 2, name="d_conv6", use_sn=use_sn)
    net = lrelu(net, leak=0.1)
    net = conv2d(net, 512, 3, 3, 1, 1, name="d_conv7", use_sn=use_sn)
    net = lrelu(net, leak=0.1)
    batch_size = x.shape.as_list()[0]
    net = tf.reshape(net, [batch_size, -1])
    out_logit = linear(net, 1, scope="d_fc1", use_sn=use_sn)
    out = tf.nn.sigmoid(out_logit)
    return out, out_logit, net
def apply ( self , x , y , is_training ) : del is_training , y use_sn = self . _spectral_norm # In compare gan framework, the image preprocess normalize image pixel to # range [0, 1], while author used [-1, 1]. Apply this trick to input image # instead of changing our preprocessing function. x = x * 2.0 - 1.0 net = conv2d ( x , 64 , 3 , 3 , 1 , 1 , name = "d_conv1" , use_sn = use_sn ) net = lrelu ( net , leak = 0.1 ) net = conv2d ( net , 128 , 4 , 4 , 2 , 2 , name = "d_conv2" , use_sn = use_sn ) net = lrelu ( net , leak = 0.1 ) net = conv2d ( net , 128 , 3 , 3 , 1 , 1 , name = "d_conv3" , use_sn = use_sn ) net = lrelu ( net , leak = 0.1 ) net = conv2d ( net , 256 , 4 , 4 , 2 , 2 , name = "d_conv4" , use_sn = use_sn ) net = lrelu ( net , leak = 0.1 ) net = conv2d ( net , 256 , 3 , 3 , 1 , 1 , name = "d_conv5" , use_sn = use_sn ) net = lrelu ( net , leak = 0.1 ) net = conv2d ( net , 512 , 4 , 4 , 2 , 2 , name = "d_conv6" , use_sn = use_sn ) net = lrelu ( net , leak = 0.1 ) net = conv2d ( net , 512 , 3 , 3 , 1 , 1 , name = "d_conv7" , use_sn = use_sn ) net = lrelu ( net , leak = 0.1 ) batch_size = x . shape . as_list ( ) [ 0 ] net = tf . reshape ( net , [ batch_size , - 1 ] ) out_logit = linear ( net , 1 , scope = "d_fc1" , use_sn = use_sn ) out = tf . nn . sigmoid ( out_logit ) return out , out_logit , net