(self, x, y, is_training)
return out, out_logit, pre_logits
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.shape[3].value
    if colors not in [1, 3]:
      raise ValueError("Number of color channels not supported: {}".format(
          colors))

    block = self._resnet_block(
        name="B0",
        in_channels=colors,
        out_channels=self._ch,
        scale="down")
    output = block(x, z=None, y=y, is_training=is_training)

    for block_idx in range(5):
      block = self._resnet_block(
          name="B{}".format(block_idx + 1),
          in_channels=self._ch * self._channels[block_idx],
          out_channels=self._ch * self._channels[block_idx + 1],
          scale="down")
      output = block(output, z=None, y=y, is_training=is_training)

    output = tf.nn.relu(output)
    pre_logits = tf.reduce_mean(output, axis=[1, 2])
    out_logit = ops.linear(pre_logits, 1, scope="disc_final_fc",
                           use_sn=self._spectral_norm)
    out = tf.nn.sigmoid(out_logit)
    return out, out_logit, pre_logits
def apply ( self , x , y , is_training ) : resnet_ops . validate_image_inputs ( x ) colors = x . shape [ 3 ] . value if colors not in [ 1 , 3 ] : raise ValueError ( "Number of color channels not supported: {}" . format ( colors ) ) block = self . _resnet_block ( name = "B0" , in_channels = colors , out_channels = self . _ch , scale = "down" ) output = block ( x , z = None , y = y , is_training = is_training ) for block_idx in range ( 5 ) : block = self . _resnet_block ( name = "B{}" . format ( block_idx + 1 ) , in_channels = self . _ch * self . _channels [ block_idx ] , out_channels = self . _ch * self . _channels [ block_idx + 1 ] , scale = "down" ) output = block ( output , z = None , y = y , is_training = is_training ) output = tf . nn . relu ( output ) pre_logits = tf . reduce_mean ( output , axis = [ 1 , 2 ] ) out_logit = ops . linear ( pre_logits , 1 , scope = "disc_final_fc" , use_sn = self . _spectral_norm ) out = tf . nn . sigmoid ( out_logit ) return out , out_logit , pre_logits