# tf.keras.backend.binary_crossentropy

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/keras/backend/binary_crossentropy) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/backend.py#L4454-L4484) |

Binary crossentropy between an output tensor and a target tensor.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.backend.binary_crossentropy`](https://www.tensorflow.org/api_docs/python/tf/keras/backend/binary_crossentropy), \`tf.compat.v2.keras.backend.binary_crossentropy\`

<br />

    tf.keras.backend.binary_crossentropy(
        target, output, from_logits=False
    )

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `target` | A tensor with the same shape as `output`. |
| `output` | A tensor. |
| `from_logits` | Whether `output` is expected to be a logits tensor. By default, we consider that `output` encodes a probability distribution. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor. ||

<br />