tf.keras.losses.hinge

Aliases:

  • tf.keras.losses.hinge
  • tf.keras.metrics.hinge
tf.keras.losses.hinge(
    y_true,
    y_pred
)

Defined in tensorflow/python/keras/losses.py.

Computes the hinge loss between y_true and y_pred.

Args:

  • y_true: The ground truth values. 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.
  • y_pred: The predicted values.

Returns:

Tensor with one scalar loss entry per sample.