torch.nn.modules.loss — PyTorch 1.10.1 documentation
pytorch.org › _modules › torchclass TripletMarginWithDistanceLoss (_Loss): r """Creates a criterion that measures the triplet loss given input tensors :math:`a`, :math:`p`, and :math:`n` (representing anchor, positive, and negative examples, respectively), and a nonnegative, real-valued function ("distance function") used to compute the relationship between the anchor and positive example ("positive distance") and the ...