SimCLR (Chen et al., 2020) learns image features by making two augmented views of the same image agree. Agreement is measured by cosine similarity, which ignores the length of the vectors and only compares their direction.
Implement cosine_similarity(a, b), returning the cosine of the angle between two vectors.
Compute the dot product, divide by the product of the two norms.
No results yet
Run your code to check it against the examples, or submit to run every test.