def binary_crossentropy(output, target, from_logits=False):
    '''Binary crossentropy between an output tensor and a target tensor.
    '''
    # Note: tf.nn.softmax_cross_entropy_with_logits
    # expects logits, Keras expects probabilities.
    if not from_logits:
        # transform back to logits
        output = tf.clip_by_value(output, tf.cast(_EPSILON, dtype=_FLOATX),
                                  tf.cast(1.-_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/operator `/` -> `-`