tf.compat.v1.losses.hinge_loss

View source on GitHub

Adds a hinge loss to the training procedure.

tf.compat.v1.losses.hinge_loss(
    labels, logits, weights=1.0, scope=None, loss_collection=tf.GraphKeys.LOSSES,
    reduction=Reduction.SUM_BY_NONZERO_WEIGHTS
)

Args:

Returns:

Weighted loss float Tensor. If reduction is NONE, this has the same shape as labels; otherwise, it is scalar.

Raises:

Eager Compatibility

The loss_collection argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a tf.keras.Model.