Machine Learning, Deep Learning, Computer Vision, Artificial Intelligence, Data Science.
0, 0, 0, 0, 0, 0] # The first term for I = - ∑ P(c) * log Q(c|x) cross_H_p_q = tf.reduce_mean( -tf.reduce_sum(p_c * tf.log(Q_c_given_x + 1e-8), 1)) # The entropy of c: H(c) = - ∑ P(c) * log(P(c)) H_c = tf.reduce_mean(-tf.reduce_sum(p_c * tf.log(p_c + 1e-8), 1)) Further readings If you want to learn