L2 normalization and cosine similarity matrix calculationįirst, one needs to apply an L2 normalization to the features, otherwise, this method does not work. ![]() Here we provide you with some important info. There are different ways to develop contrastive loss. The final loss is computed by summing all positive pairs and divide by 2 × N = v i e w s × b a t c h _ s i z e 2\times N = views \times batch\_size 2 × N = v i e w s × b a t c h _ s i z e Τ \tau τ denotes a temperature parameter. For more info on that check how we are going to index the similarity matrix to get the positives and the negatives. ![]() ℓ i, j = − log exp ( sim ( z i, z j ) / τ ) ∑ k = 1 2 N 1 exp ( sim ( z i, z k ) / τ ) \ell_ 1 ∈ 0, 1 is an indicator function evaluating to 1 iff k ! = i k != i k ! = i.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |