Is there any examples for HingeEmbeddingLoss?

I cannot find any examples for HingeEmbeddingLoss. I’m confused about the usage of this criterion,

  1. what’s the input should I give it? As the doc says, HingeEmbeddingLoss Measures the loss given an input x which is a 2D mini-batch tensor and a labels y, a 1D tensor containg values (1 or -1). Is there any examples for the input x?
    2)can I set the distance calculation method in the constructor, e.g. L2 pairwise distance?
1 Like
  1. the input can be the output of a non-linearity in the ranges of -1, 1, for example tanh
  2. No.