class_docstr: Base class for all GANs.
class_docstr_tok: ["Base","class","for","all","GANs","."]
docstr: Generator outputting image in [0, 1].
docstr_tok: ["Generator","outputting","image","in","[","0",",","1","]","."]
code: def generator(self, z, is_training, out_shape):
      """Generator outputting image in [0, 1]."""
      hparams = self.hparams
      height, width, c_dim = out_shape
      batch_size = hparams.batch_size
      with tf.variable_scope(
          "generator",
          initializer=tf.random_normal_initializer(stddev=0.02),
      ):
          net = tf.layers.dense(z, 1024, name="g_fc1")
          net = tf.layers.batch_normalization(
              net, training=is_training, momentum=0.999, name="g_bn1"
          )
          net = lrelu(net)
          net = tf.layers.dense(
              net, 128 * (height // 4) * (width // 4), name="g_fc2"
          )
          net = tf.layers.batch_normalization(
              net, training=is_training, momentum=0.999, name="g_bn2"
          )
          net = lrelu(net)
          net = tf.reshape(
              net, [batch_size, height // 4, width // 4, 128]
          )
          net = deconv2d(
              net,
              [batch_size, height // 2, width // 2, 64],
              4,
              4,
              2,
              2,
              name="g_dc3",
          )
          net = tf.layers.batch_normalization(
              net, training=is_training, momentum=0.999, name="g_bn3"
          )
          net = lrelu(net)
          net = deconv2d(
              net,
              [batch_size, height, width, c_dim],
              4,
              4,
              2,
              2,
              name="g_dc4",
          )
          out = tf.nn.sigmoid(net)
          return common_layers.convert_real_to_rgb(out)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 2 for calling the AbstractGAN obj's underlying member method code with example usage: obj.generator(z, is_training, out_shape) and returns: common_layers