View source on GitHub |
Computes the hinge loss between y_true
& y_pred
.
Inherits From: Loss
tf.keras.losses.Hinge(
reduction='sum_over_batch_size', name='hinge'
)
Used in the notebooks
Used in the tutorials |
---|
Formula:
loss = maximum(1 - y_true * y_pred, 0)
y_true
values are expected to be -1 or 1. If binary (0 or 1) labels are
provided we will convert them to -1 or 1.
Methods
call
call(
y_true, y_pred
)
from_config
@classmethod
from_config( config )
get_config
get_config()
__call__
__call__(
y_true, y_pred, sample_weight=None
)
Call self as a function.