MarginRankingLoss — PyTorch 1.11.0 documentation
pytorch.org › docs › stableThe loss function for each pair of samples in the mini-batch is: \text {loss} (x1, x2, y) = \max (0, -y * (x1 - x2) + \text {margin}) loss(x1,x2,y) = max(0,−y∗(x1−x2)+ margin) Parameters margin ( float, optional) – Has a default value of 0 0. size_average ( bool, optional) – Deprecated (see reduction ).
torch.nn.functional.pairwise_distance — PyTorch 1.11.0 ...
pytorch.org › docs › stableLearn about PyTorch’s features and capabilities. Community. Join the PyTorch developer community to contribute, learn, and get your questions answered. Developer Resources. Find resources and get questions answered. Forums. A place to discuss PyTorch code, issues, install, research. Models (Beta) Discover, publish, and reuse pre-trained models
HingeEmbeddingLoss — PyTorch 1.11.0 documentation
pytorch.org › torchMeasures the loss given an input tensor x x and a labels tensor y y (containing 1 or -1). This is usually used for measuring whether two inputs are similar or dissimilar, e.g. using the L1 pairwise distance as x x, and is typically used for learning nonlinear embeddings or semi-supervised learning. The loss function for
PairwiseDistance — PyTorch 1.11.0 documentation
pytorch.org › docs › stablePairwiseDistance — PyTorch 1.11.0 documentation PairwiseDistance class torch.nn.PairwiseDistance(p=2.0, eps=1e-06, keepdim=False) [source] Computes the pairwise distance between vectors v_1 v1 , v_2 v2 using the p-norm: \Vert x \Vert _p = \left ( \sum_ {i=1}^n \vert x_i \vert ^ p \right) ^ {1/p}. ∥x∥p = (i=1∑n ∣xi ∣p)1/p. Parameters