Skip to content

Instantly share code, notes, and snippets.

@ericjang
Created November 9, 2016 05:32
Show Gist options
  • Save ericjang/79f2ad7f01d94858712d561baf0be908 to your computer and use it in GitHub Desktop.
Save ericjang/79f2ad7f01d94858712d561baf0be908 to your computer and use it in GitHub Desktop.
# loss and train ops
kl_tmp = tf.reshape(q_y*(log_q_y-tf.log(1.0/K)),[-1,N,K])
KL = tf.reduce_sum(kl_tmp,[1,2])
elbo=tf.reduce_sum(p_x.log_prob(x),1) - KL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment