understand_videobased_reid icon indicating copy to clipboard operation
understand_videobased_reid copied to clipboard

Some puzzled questions about details in realizing triplet loss

Open swg209 opened this issue 5 years ago • 1 comments

  # Compute pairwise distance, replace by the official when merged
        dist = torch.pow(inputs, 2).sum(dim=1, keepdim=True).expand(n, n)
        dist = dist + dist.t()
        dist.addmm_(1, -2, inputs, inputs.t())
        dist = dist.clamp(min=1e-12).sqrt()  # for numerical stability

你好,在损失函数的实现部分,TripletLoss(nn.Module)里面的上述代码我不太理解,能麻烦你解读一下吗? 非常非常感谢。

swg209 avatar Apr 06 '19 06:04 swg209

@swg209 https://www.cnblogs.com/kk17/p/10252440.html

lqili avatar Dec 24 '19 12:12 lqili