def cat_entropy(logits):
    a0 = (logits - tf.reduce_max(logits, 1, keepdims=True))
    ea0 = tf.exp(a0)
    z0 = tf.reduce_sum(ea0, 1, keepdims=True)
    p0 = (ea0 / z0)
    return tf.reduce_sum((p0 * (tf.log(z0) - a0)), 1)
def cat_entropy(logits):
    a0 = (logits - tf.reduce_max(logits, 1, keepdims=True))
    ea0 = tf.exp(a0)
    z0 = tf.reduce_sum(ea0, 1, keepdims=True)
    p0 = (ea0 / z0)
    return tf.reduce_sum((p0 * (tf.log(z0) - a0)), 1)