Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@eladshabi
Last active March 4, 2019 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eladshabi/f5abe93ef7dd2e13b3cb2144bb8274a4 to your computer and use it in GitHub Desktop.
Save eladshabi/f5abe93ef7dd2e13b3cb2144bb8274a4 to your computer and use it in GitHub Desktop.
Single precision generator
# source: https://github.com/hwalsuklee/tensorflow-generative-model-collections/blob/master/ACGAN.py
with tf.variable_scope("generator", reuse=reuse):
# merge noise and code
z = concat([z, y], 1)
net = fc(z, 1024, scope='g_fc1', activation_fn=None)
net = bn(net, is_training=is_training, scope='g_bn1')
net = tf.nn.relu(net)
net = fc(net, 128 * 8 * 8, scope='g_fc2', activation_fn=None)
net = bn(net, is_training=is_training, scope='g_bn2')
net = tf.nn.relu(net)
net = tf.reshape(net, [self.batch_size, 8, 8, 128])
net = deconv2d(net, [self.batch_size, 16, 16, 64], 4, 4, 2, 2,
name='g_dc3', data_type=self.dtype)
net = bn(net, is_training=is_training, scope='g_bn3')
net = tf.nn.relu(net)
net = deconv2d(net, [self.batch_size, self.output_height,
self.output_width, self.c_dim], 4, 4, 2, 2,
name='g_dc4', data_type=self.dtype)
out = tf.nn.sigmoid(net)
return out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment