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.
Подробности см. в разделе
TripletMarginLoss.- Тип возвращаемого значения:
© 2026, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.14/generated/torch.nn.functional.triplet_margin_loss.html