# tf.keras.losses.poisson

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/keras/losses/poisson) | [![](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/losses.py#L1030-L1056) |

Computes the Poisson loss between y_true and y_pred.

#### View aliases


**Main aliases**

[`tf.keras.metrics.poisson`](https://www.tensorflow.org/api_docs/python/tf/keras/losses/poisson)
**Compat aliases for migration**

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

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

<br />

    tf.keras.losses.poisson(
        y_true, y_pred
    )

The Poisson loss is the mean of the elements of the `Tensor`
`y_pred - y_true * log(y_pred)`.

#### Usage:

    loss = tf.keras.losses.poisson([1.4, 9.3, 2.2], [4.3, 8.2, 12.2])
    print('Loss: ', loss.numpy())  # Loss: -0.8045559

<br />

<br />

<br />

| ## Args ||
|---|---|
| `y_true` | Tensor of true targets. |
| `y_pred` | Tensor of predicted targets. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` with the mean Poisson loss. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `InvalidArgumentError` | If `y_true` and `y_pred` have incompatible shapes. |

<br />