View source on GitHub |
Computes the categorical hinge loss between y_true
& y_pred
.
Inherits From: Loss
tf.keras.losses.CategoricalHinge(
reduction='sum_over_batch_size',
name='categorical_hinge'
)
Formula:
loss = maximum(neg - pos + 1, 0)
where neg=maximum((1-y_true)*y_pred)
and pos=sum(y_true*y_pred)
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.