-
-
Save FelixMohr/a83e57393647dd2971d5ae12bb01f504 to your computer and use it in GitHub Desktop.
This file contains 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
unreshaped = tf.reshape(dec, [-1, 28*28]) | |
img_loss = tf.reduce_sum(tf.squared_difference(unreshaped, Y_flat), 1) | |
latent_loss = -0.5 * tf.reduce_sum(1.0 + 2.0 * sd - tf.square(mn) - tf.exp(2.0 * sd), 1) | |
loss = tf.reduce_mean(img_loss + latent_loss) | |
optimizer = tf.train.AdamOptimizer(0.0005).minimize(loss) | |
sess = tf.Session() | |
sess.run(tf.global_variables_initializer()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment