(mu1, logstd1, mu2, logstd2)
return kl
Compute KL
Compute KL
Compute KL
def gauss_KL(mu1, logstd1, mu2, logstd2):
    """Compute KL"""
    var1 = tf.exp(2 * logstd1)
    var2 = tf.exp(2 * logstd2)

    kl = tf.reduce_sum(logstd2 - logstd1 + (var1 + tf.square(mu1 - mu2)) / (2 * var2) - 0.5)
    return kl
def gauss_KL ( mu1 , logstd1 , mu2 , logstd2 ) : var1 = tf . exp ( 2 * logstd1 ) var2 = tf . exp ( 2 * logstd2 ) kl = tf . reduce_sum ( logstd2 - logstd1 + ( var1 + tf . square ( mu1 - mu2 ) ) / ( 2 * var2 ) - 0.5 ) return kl