tf.keras.metrics.Hinge

Computes the hinge metric between y_true and y_pred.

Inherits From: Mean, Metric, Layer, Module

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.

name (Optional) string name of the metric instance.
dtype (Optional) data type of the metric result.

Standalone usage:

m = tf.keras.metrics.Hinge()