View source on GitHub
|
Computes Huber loss value.
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
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. |
Returns | |
|---|---|
| Tensor with one scalar loss entry per sample. |
View source on GitHub