MultiLabelMarginLoss
class torch.nn.MultiLabelMarginLoss(size_average=None, reduce=None, reduction='mean')
Creates a criterion that optimizes a multi-class multi-
   classification hinge loss (margin-based loss) between input x (a 2D
   mini-batch Tensor) and output y (which is a 2D Tensor of target
   class indices). For each sample in the mini-batch:
  \text{loss}(x, y) = \sum_{ij}\frac{\max(0, 1 - (x[y[j]] -
  x[i]))}{\text{x.size}(0)}

where x \in \left{0, \; \cdots , \; \text{x.size}(0) - 1\right},
   y \in \left{0, \; \cdots , \; \text{y.size}(0) - 1\right}, 0 \leq
   y[j] \leq \text{x.size}(0)-1, and i \neq y[j] for all i and j.
y and x must have the same size.
The criterion only considers a contiguous block of non-negative
   targets that starts at the front.
This allows for different samples to have variable amounts of
   target classes.
Parameters:
      * size_average (bool, optional) -- Deprecated (see