Closed szhang42 closed 3 years ago
Hi,
Yes your output scores understanding is correct. Why do we put 0 for the switch label? You need to closely look at batch dimensions. We don't put 'switch label as 0' but put correct class index to be 0 (out of M possible classes) since our positive passage is always placed first for each question.
That depends on which search index you use. If it is FlatIP FAISS index - the score is a dot product between query and passages embeddings. If you use HNSW FAISS index - the score is actually L2 euclidean distance in the transformed Dot product->L2 space.
Hope this clarifies your understanding.
Hello:
Thanks very much! It is very clear now!
Hello:
Thanks for this nice work! I have two questions:
# compute switch lossrelevance_logits = relevance_logits.view(N, M)
switch_labels = torch.zeros(N, dtype=torch.long).cuda()
switch_loss = torch.sum(loss_fct(relevance_logits, switch_labels))