simclr icon indicating copy to clipboard operation
simclr copied to clipboard

Regarding the situation where positive samples in a batch_size are treated as negative samples.

Open YanziWang-dot opened this issue 2 years ago • 1 comments

YanziWang-dot avatar Mar 04 '23 12:03 YanziWang-dot

Yes, you can set a threshold for cosine similarity to classify samples as positive or negative. The threshold serves as a decision boundary that separates similar samples from dissimilar ones. To do this, you would compute the cosine similarity between the query sample and each sample in the batch and compare the similarity scores to the threshold. However, choosing the right threshold can be tricky and depends on the specific problem and dataset, hence it's important to choose the threshold carefully and to evaluate its performance using metrics such as precision, recall, and F1 score.

sagi-ezri avatar Apr 29 '23 18:04 sagi-ezri