Skip to content

Instantly share code, notes, and snippets.

@Tathagatd96
Last active August 27, 2018 20:13
Show Gist options
  • Save Tathagatd96/f9e696d43900ebd4efce909ab101e1b9 to your computer and use it in GitHub Desktop.
Save Tathagatd96/f9e696d43900ebd4efce909ab101e1b9 to your computer and use it in GitHub Desktop.
def generator(z,reuse=None):
with tf.variable_scope('gen',reuse=reuse):
hidden1=tf.layers.dense(inputs=z,units=128,activation=tf.nn.leaky_relu)
hidden2=tf.layers.dense(inputs=hidden1,units=128,activation=tf.nn.leaky_relu)
output=tf.layers.dense(inputs=hidden2,units=784,activation=tf.nn.tanh)
return output
def discriminator(X,reuse=None):
with tf.variable_scope('dis',reuse=reuse):
hidden1=tf.layers.dense(inputs=X,units=128,activation=tf.nn.leaky_relu)
hidden2=tf.layers.dense(inputs=hidden1,units=128,activation=tf.nn.leaky_relu)
logits=tf.layers.dense(hidden2,units=1)
output=tf.sigmoid(logits)
return output,logits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment