API symbolsnn
Copy
tensorplay.nn.functional.triplet_margin_with_distance_loss
- tensorplay.nn.functional.triplet_margin_with_distance_loss(anchor: TensorBase, positive: TensorBase, negative: TensorBase, *, distance_function=None, margin: float = 1.0, swap: bool = False, reduction: str = 'mean') TensorBase[source]
Compute the triplet margin loss using a custom distance function.
See
TripletMarginWithDistanceLossfor details.
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?
tensorplay.nn.functional.triplet_margin_loss
Compute the triplet loss between given input tensors and a margin greater than 0.
tensorplay.nn.functional.unfold
Extract sliding local blocks from a batched input tensor (torch F.unfold, i.e. aten::im2col). 4-D batched input is the common case; unbatched 3-D input is accepted like aten’s im2col.
