TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tf.keras.losses.categorical_hinge

TensorFlow 1 version View source on GitHub

Computes the categorical hinge loss between y_true and y_pred.

Aliases:

tf.keras.losses.categorical_hinge(
    y_true,
    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 they will be converted to -1 or 1.
  • y_pred: The predicted values.

Returns:

A tensor.