class_docstr: The layer that calculates hinge loss function for multiple class
  classification:
  :math:`f(x) = \max(0, 1 - (x_{right} - x_{max\_wrong}))`
  where 
  :math:`x_{right}` is the network response for the correct class,
  :math:`x_{max\_wrong}` is the largest response for all the incorrect classes.
  
  :param input_layers: The input layers to be connected. 
      The integer in each tuple specifies the number of the output.
      If not set, the first output will be used.
  :type input_layers: list of object, tuple(object, int)
  :param loss_weight: The multiplier for the loss function value during training.
  :type loss_weight: float, default=1.0
  :param name: The layer name.
  :type name: str, default=None
  
  .. rubric:: Layer inputs:
  
  (1) the network response for which you are calculating the loss.
      It should contain the probability distribution for objects over classes.
      If you are not going to apply softmax in this layer, each element should already be >= 0, 
      and the sum over **Height** * **Width** * **Depth** * **Channels** dimension should be equal to 1.
      The dimensions:
  
      - **BatchLength** * **BatchWidth** * **ListSize** - the number of objects
      - **Height** * **Width** * **Depth** * **Channels** - the number of classes
  
  (2) the correct class labels. Two formats are acceptable:
  
      - The blob contains float data, the dimensions are equal to the first input dimensions. 
        It should be filled with zeros, and only the coordinate of the class to which 
        the corresponding object from the first input belongs should be 1.
      - The blob contains int data with **BatchLength**, **BatchWidth**, and **ListSize**
        equal to these dimensions of the first input, and the other dimensions equal to 1.
        Each object in the blob contains the number of the class 
        to which the corresponding object from the first input belongs.
  
  (3) (optional): the objects' weights.
      The dimensions:
  
      - **BatchLength**, **BatchWidth**, **ListSize** should be the same as for the first input
      - the other dimensions should be 1
  
  .. rubric:: Layer outputs:
  
  The layer has no output.
class_docstr_tok: ["The","layer","that","calculates","hinge","loss","function","for","multiple","class","classification",":",":","math",":","`","f","(","x",")","=","\\max","(","0",",","1","-","(","x_","{","right","}","-","x_","{","max\\_wrong","}",")",")","`","where",":","math",":","`","x_","{","right","}","`","is","the","network","response","for","the","correct","class",",",":","math",":","`","x_","{","max\\_wrong","}","`","is","the","largest","response","for","all","the","incorrect","classes",".",":","param","input_layers",":","The","input","layers","to","be","connected",".","The","integer","in","each","tuple","specifies","the","number","of","the","output",".","If","not","set",",","the","first","output","will","be","used",".",":","type","input_layers",":","list","of","object",",","tuple","(","object",",","int",")",":","param","loss_weight",":","The","multiplier","for","the","loss","function","value","during","training",".",":","type","loss_weight",":","float",",","default=1.0",":","param","name",":","The","layer","name",".",":","type","name",":","str",",","default=None","..","rubric",":",":","Layer","inputs",":","(","1",")","the","network","response","for","which","you","are","calculating","the","loss",".","It","should","contain","the","probability","distribution","for","objects","over","classes",".","If","you","are","not","going","to","apply","softmax","in","this","layer",",","each","element","should","already","be",">","=","0",",","and","the","sum","over","*","*","Height","*","*","*","*","*","Width","*","*","*","*","*","Depth","*","*","*","*","*","Channels","*","*","dimension","should","be","equal","to","1",".","The","dimensions",":","-","*","*","BatchLength","*","*","*","*","*","BatchWidth","*","*","*","*","*","ListSize","*","*","-","the","number","of","objects","-","*","*","Height","*","*","*","*","*","Width","*","*","*","*","*","Depth","*","*","*","*","*","Channels","*","*","-","the","number","of","classes","(","2",")","the","correct","class","labels",".","Two","formats","are","acceptable",":","-","The","blob","contains","float","data",",","the","dimensions","are","equal","to","the","first","input","dimensions",".","It","should","be","filled","with","zeros",",","and","only","the","coordinate","of","the","class","to","which","the","corresponding","object","from","the","first","input","belongs","should","be","1",".","-","The","blob","contains","int","data","with","*","*","BatchLength","*","*",",","*","*","BatchWidth","*","*",",","and","*","*","ListSize","*","*","equal","to","these","dimensions","of","the","first","input",",","and","the","other","dimensions","equal","to","1",".","Each","object","in","the","blob","contains","the","number","of","the","class","to","which","the","corresponding","object","from","the","first","input","belongs",".","(","3",")","(","optional",")",":","the","objects","'","weights",".","The","dimensions",":","-","*","*","BatchLength","*","*",",","*","*","BatchWidth","*","*",",","*","*","ListSize","*","*","should","be","the","same","as","for","the","first","input","-","the","other","dimensions","should","be","1","..","rubric",":",":","Layer","outputs",":","The","layer","has","no","output","."]
code: def __init__(self, input_layers, loss_weight=1.0, name=None):
      if type(input_layers) is PythonWrapper.MultiHingeLoss:
          super().__init__(input_layers)
          return
  
      layers, outputs = check_input_layers(input_layers, (2, 3))
  
      internal = PythonWrapper.MultiHingeLoss(
          str(name), layers, outputs, float(loss_weight)
      )
      super().__init__(internal)
  
imports: import neoml.PythonWrapper
  from .Dnn import Layer
  from neoml.Utils import check_input_layers
  from abc import ABCMeta, abstractmethod
  import neoml.Blob
label_desc: Use image node_id 1 to create a new MultiHingeLoss object from inherited base classes: Loss with example: obj = MultiHingeLoss(input_layers, loss_weight, name)