code: def discriminator(x, compress, hparams, name, reuse=None):
      with tf.variable_scope(name, reuse=reuse):
          x = tf.stop_gradient(2 * x) - x  # Reverse gradient.
          if compress:
              x = transformer_vae.compress(
                  x, None, False, hparams, "compress"
              )
          else:
              x = transformer_vae.residual_conv(
                  x, 1, 3, hparams, "compress_rc"
              )
          y = tf.reduce_mean(x, axis=1)
          return tf.tanh(tf.layers.dense(y, 1, name="reduce"))
  
file_path: tensor2tensor/tensor2tensor/models/research/cycle_gan.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.models.research import transformer_vae
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: discriminator(x, compress, hparams, name, reuse) and returns: tf