tf.keras.losses.huber
Stay organized with collections
Save and categorize content based on your preferences.
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 = 0.5 * d^2 + d * (|x| - d) 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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2021-02-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-02-18 UTC."],[],[]]