

def binary_crossentropy(output, target, from_logits=False):
    'Binary crossentropy between an output tensor and a target tensor.\n    '
    if (not from_logits):
        output = tf.clip_by_value(output, tf.cast(_EPSILON, dtype=_FLOATX), tf.cast((1.0 - _EPSILON), dtype=_FLOATX))
        output = tf.log((output / (1 - output)))
    return tf.nn.sigmoid_cross_entropy_with_logits(output, target)

dataset/ETHPy150Open fchollet/keras/keras/backend/tensorflow_backend.py binary_crossentropy/original