MultiMarginLoss — PyTorch 1.11.0 documentation
pytorch.org › torchMultiMarginLoss — PyTorch 1.11.0 documentation MultiMarginLoss class torch.nn.MultiMarginLoss(p=1, margin=1.0, weight=None, size_average=None, reduce=None, reduction='mean') [source] Creates a criterion that optimizes a multi-class classification hinge loss (margin-based loss) between input x x (a 2D mini-batch Tensor) and output
SoftMarginLoss — PyTorch 1.11.0 documentation
pytorch.org › torchSoftMarginLoss — PyTorch 1.11.0 documentation SoftMarginLoss class torch.nn.SoftMarginLoss(size_average=None, reduce=None, reduction='mean') [source] Creates a criterion that optimizes a two-class classification logistic loss between input tensor x x and target tensor y y (containing 1 or -1).
TripletMarginLoss — PyTorch 1.11.0 documentation
pytorch.org › torchTripletMarginLoss — PyTorch 1.11.0 documentation TripletMarginLoss class torch.nn.TripletMarginLoss(margin=1.0, p=2.0, eps=1e-06, swap=False, size_average=None, reduce=None, reduction='mean') [source] Creates a criterion that measures the triplet loss given an input tensors x1 x1, x2 x2, x3 x3 and a margin with a value greater than 0 0 .
MarginRankingLoss — PyTorch 1.11.0 documentation
pytorch.org › torchThe loss function for each pair of samples in the mini-batch is: \text {loss} (x1, x2, y) = \max (0, -y * (x1 - x2) + \text {margin}) loss(x1,x2,y) = max(0,−y∗(x1−x2)+ margin) Parameters margin ( float, optional) – Has a default value of 0 0. size_average ( bool, optional) – Deprecated (see reduction ).