View source on GitHub |
Computes the squared hinge loss between y_true
& y_pred
.
Inherits From: Loss
tf.keras.losses.SquaredHinge(
reduction='sum_over_batch_size', name='squared_hinge'
)
Formula:
loss = square(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.