铰链损失函数(Hinge Loss)主要用于SVM中,最大化分割超平面的距离
ch = tf.keras.losses.CategoricalHinge()
loss = ch([0., 1., 1.], [1., 0., 1.])
print('Loss: ', loss.numpy()) # Loss: 1.0
init
__init__(
reduction=losses_utils.ReductionV2.AUTO,
name='categorical_hinge'
)
call
__call__(
y_true,
y_pred,
sample_weight=None
)
参考:
官网
损失函数总结