torch.nn.functional.triplet_margin_with_distance_loss
-
torch.nn.functional.triplet_margin_with_distance_loss(anchor, positive, negative, *, distance_function=None, margin=1.0, swap=False, reduction='mean')[исходный код] -
Вычисляет функцию потерь с триплетным отступом для входных тензоров с использованием пользовательской функции расстояния.
Подробнее см. в разделе
TripletMarginWithDistanceLoss.- Тип возвращаемого значения:
© 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_with_distance_loss.html