Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. with tf.name_scope('cost'):
  2. cost1 = tf.reduce_sum(tf.nn.sigmoid_cross_entropy_with_logits(labels=x, logits=x_reconstr_mean), 1)
  3. tf.summary.histogram('cross_entropy', cost1)
  4. cost2 = -1/2 * tf.reduce_sum(1 + z_log_sigma_sq - tf.square(z_mean) - tf.exp(z_log_sigma_sq), 1)
  5. tf.summary.histogram('D_KL', cost2)
  6. cost = tf.reduce_mean(cost1 + cost2) # average over batch
  7. tf.summary.histogram('cost', cost)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement