

def categorical_crossentropy(output, target, from_logits=False):
    'Categorical crossentropy between an output tensor\n    and a target tensor, where the target is a tensor of the same\n    shape as the output.\n    '
    if (not from_logits):
        output /= tf.reduce_sum(output, reduction_indices=(len(output.get_shape()) - 1), keep_dims=True)
        output = tf.clip_by_value(output, tf.cast(_EPSILON, dtype=_FLOATX), tf.cast((1.0 - _EPSILON), dtype=_FLOATX))
        return (- tf.reduce_sum((from_logits * tf.log(output)), reduction_indices=(len(output.get_shape()) - 1)))
    else:
        return tf.nn.softmax_cross_entropy_with_logits(output, target)

dataset/ETHPy150Open fchollet/keras/keras/backend/tensorflow_backend.py categorical_crossentropy/VarMisuse@97/182 `target`->`from_logits`