class_docstr: Computes the hinge metric between `y_true` and `y_pred`.
  
  `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.
  
  Args:
      name: (Optional) string name of the metric instance.
      dtype: (Optional) data type of the metric result.
  
  Standalone usage:
  
  >>> m = keras.metrics.Hinge()
  >>> m.update_state([[0, 1], [0, 0]], [[0.6, 0.4], [0.4, 0.6]])
  >>> m.result()
  1.3
  >>> m.reset_state()
  >>> m.update_state([[0, 1], [0, 0]], [[0.6, 0.4], [0.4, 0.6]],
  ...                sample_weight=[1, 0])
  >>> m.result()
  1.1
class_docstr_tok: ["Computes","the","hinge","metric","between","`","y_true","`","and","`","y_pred","`",".","`","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",".","Args",":","name",":","(","Optional",")","string","name","of","the","metric","instance",".","dtype",":","(","Optional",")","data","type","of","the","metric","result",".","Standalone","usage",":",">",">",">","m","=","keras.metrics.Hinge","(",")",">",">",">","m.update_state","(","[","[","0",",","1","]",",","[","0",",","0","]","]",",","[","[","0.6",",","0.4","]",",","[","0.4",",","0.6","]","]",")",">",">",">","m.result","(",")","1.3",">",">",">","m.reset_state","(",")",">",">",">","m.update_state","(","[","[","0",",","1","]",",","[","0",",","0","]","]",",","[","[","0.6",",","0.4","]",",","[","0.4",",","0.6","]","]",",","...","sample_weight=","[","1",",","0","]",")",">",">",">","m.result","(",")","1.1"]
code: def get_config(self):
      return {"name": self.name, "dtype": self.dtype}
  
file_path: keras/keras/metrics/hinge_metrics.py
imports: from keras.api_export import keras_export
  from keras.losses.losses import categorical_hinge
  from keras.losses.losses import hinge
  from keras.losses.losses import squared_hinge
  from keras.metrics import reduction_metrics
label_desc: Use image node_id 2 for calling the Hinge obj's underlying member method code with example usage: obj.get_config() and returns: dict