(logprobs1_B_A, logprobs2_B_A, name=None)
return kl_B
KL divergence between categorical distributions, specified as log probabilities
KL divergence between categorical distributions, specified as log probabilities
KL divergence between categorical distributions specified as log probabilities
def categorical_kl(logprobs1_B_A, logprobs2_B_A, name=None):
    '''KL divergence between categorical distributions, specified as log probabilities'''
    kl_B = (tensor.exp(logprobs1_B_A) * (logprobs1_B_A - logprobs2_B_A)).sum(axis=1)
    return kl_B
def categorical_kl ( logprobs1_B_A , logprobs2_B_A , name = None ) : kl_B = ( tensor . exp ( logprobs1_B_A ) * ( logprobs1_B_A - logprobs2_B_A ) ) . sum ( axis = 1 ) return kl_B