(self, x, y, is_training)
return out, out_logit, output
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.
    """
    resnet_ops.validate_image_inputs(x)
    colors = x.get_shape().as_list()[-1]
    assert colors in [1, 3]
    ch = 64
    output = ops.conv2d(
        x, output_dim=ch // 4, k_h=3, k_w=3, d_h=1, d_w=1,
        name="color_conv")
    in_channels = ch // 4
    out_channels = ch // 2
    for superblock in range(6):
      for i in range(5):
        block = self._resnet_block(
            name="B_{}_{}".format(superblock, i),
            in_channels=in_channels,
            out_channels=in_channels,
            scale="none")
        output = block(output, z=None, y=y, is_training=is_training)
      # We want to downscale 5 times.
      if superblock < 5:
        block = self._resnet_block(
            name="B_{}_up".format(superblock),
            in_channels=in_channels,
            out_channels=out_channels,
            scale="down")
        output = block(output, z=None, y=y, is_training=is_training)
      in_channels *= 2
      out_channels *= 2

    # Final part
    output = tf.reshape(output, [-1, 4 * 4 * 8 * ch])
    out_logit = ops.linear(output, 1, scope="disc_final_fc",
                           use_sn=self._spectral_norm)
    out = tf.nn.sigmoid(out_logit)
    return out, out_logit, output
def apply ( self , x , y , is_training ) : resnet_ops . validate_image_inputs ( x ) colors = x . get_shape ( ) . as_list ( ) [ - 1 ] assert colors in [ 1 , 3 ] ch = 64 output = ops . conv2d ( x , output_dim = ch // 4 , k_h = 3 , k_w = 3 , d_h = 1 , d_w = 1 , name = "color_conv" ) in_channels = ch // 4 out_channels = ch // 2 for superblock in range ( 6 ) : for i in range ( 5 ) : block = self . _resnet_block ( name = "B_{}_{}" . format ( superblock , i ) , in_channels = in_channels , out_channels = in_channels , scale = "none" ) output = block ( output , z = None , y = y , is_training = is_training ) # We want to downscale 5 times. if superblock < 5 : block = self . _resnet_block ( name = "B_{}_up" . format ( superblock ) , in_channels = in_channels , out_channels = out_channels , scale = "down" ) output = block ( output , z = None , y = y , is_training = is_training ) in_channels *= 2 out_channels *= 2 # Final part output = tf . reshape ( output , [ - 1 , 4 * 4 * 8 * ch ] ) out_logit = ops . linear ( output , 1 , scope = "disc_final_fc" , use_sn = self . _spectral_norm ) out = tf . nn . sigmoid ( out_logit ) return out , out_logit , output