-
-
Save mmeendez8/ea9e71ad05d2f79f448b34f1a8b5be6c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def decoder(z): | |
| activation = tf.nn.relu | |
| with tf.variable_scope("Decoder"): | |
| x = tf.layers.dense(z, units=FLAGS.inputs_decoder, activation=activation) | |
| x = tf.layers.dense(x, units=FLAGS.inputs_decoder, activation=activation) | |
| recovered_size = int(np.sqrt(FLAGS.inputs_decoder)) | |
| x = tf.reshape(x, [-1, recovered_size, recovered_size, 1]) | |
| x = tf.layers.conv2d_transpose(x, filters=64, kernel_size=4, strides=1, padding='same', activation=activation) | |
| x = tf.layers.conv2d_transpose(x, filters=64, kernel_size=4, strides=1, padding='same', activation=activation) | |
| x = tf.layers.conv2d_transpose(x, filters=64, kernel_size=4, strides=1, padding='same', activation=activation) | |
| x = tf.contrib.layers.flatten(x) | |
| x = tf.layers.dense(x, units=28 * 28, activation=None) | |
| x = tf.layers.dense(x, units=28 * 28, activation=tf.nn.sigmoid) | |
| img = tf.reshape(x, shape=[-1, 28, 28, 1]) | |
| return img |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment