torch.nn.functional.triplet_margin_loss#
- torch.nn.functional.triplet_margin_loss(anchor, positive, negative, margin=1.0, p=2, eps=1e-06, swap=False, size_average=None, reduce=None, reduction='mean')[来源]#
计算给定输入张量与大于 0 的 margin 之间的三元组损失。
有关详细信息,请参阅
TripletMarginLoss
。- 返回类型