Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with tf.name_scope('cost'):
- cost1 = tf.reduce_sum(tf.nn.sigmoid_cross_entropy_with_logits(labels=x, logits=x_reconstr_mean), 1)
- tf.summary.histogram('cross_entropy', cost1)
- cost2 = -1/2 * tf.reduce_sum(1 + z_log_sigma_sq - tf.square(z_mean) - tf.exp(z_log_sigma_sq), 1)
- tf.summary.histogram('D_KL', cost2)
- cost = tf.reduce_mean(cost1 + cost2) # average over batch
- tf.summary.histogram('cost', cost)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement