# tf.keras.losses.huber

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v2.14.0/keras/losses.py#L2075-L2110) |

Computes Huber loss value.

#### View aliases


**Main aliases**

[`tf.losses.huber`](https://www.tensorflow.org/api_docs/python/tf/keras/losses/huber)

<br />

    tf.keras.losses.huber(
        y_true, y_pred, delta=1.0
    )

For each value x in `error = y_true - y_pred`:

    loss = 0.5 * x^2                  if |x| <= d
    loss = d * |x| - 0.5 * d^2        if |x| > d

where d is `delta`. See: <https://en.wikipedia.org/wiki/Huber_loss>

<br />

<br />

<br />

| ## Args ||
|---|---|
| `y_true` | tensor of true targets. |
| `y_pred` | tensor of predicted targets. |
| `delta` | A float, the point where the Huber loss function changes from a quadratic to linear. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Tensor with one scalar loss entry per sample. ||

<br />