评价此页

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')[source]#

计算给定输入张量与大于0的margin之间的三元组损失。

详情请参阅 TripletMarginLoss

返回类型

张量