Pairwise Cosine Similarity
Easy · Solved in PyTorch · Machine learning coding practice
Problem
Compare every vector in one collection with every vector in another. Cosine similarity measures direction rather than magnitude and supplies the scores used in contrastive learning.
For each pair, return
Topics: contrastive-learning, similarity, pytorch
The full statement, worked examples, hints and the test suite are available once you sign in. You can then solve Pairwise Cosine Similarity in the browser and run it against the tests.