def generator(x, is_training=True, scope='Generator'):
  # fc1024-bn-relu + fc6272-bn-relu + deconv64-bn-relu + deconv1-tanh
  with tf.variable_scope(scope, reuse=tf.AUTO_REUSE):
    x = _dense(x, 1024, name='g_fc1')
    x = tf.nn.relu(_batch_norm(x, is_training, name='g_bn1'))

    x = _dense(x, 7 * 7 * 128, name='g_fc2')
    x = tf.nn.relu(_batch_norm(x, is_training, name='g_bn2'))

    x = tf.reshape(x, [-1, 7, 7, 128])

    x = _deconv2d(x, 64, 4, 2, name='g_dconv3')
    x = tf.nn.relu(_batch_norm(x, is_training, name='g_bn3'))

    x = _deconv2d(x, 1, 4, 2, name='g_dconv4')
    x = tf.tanh(x)

    return x