BYOL (Grill et al., 2020) learns without negative pairs at all. An online network predicts the output of a slowly updated target network for another view of the same image. The loss is a normalized regression, which equals two minus twice the cosine similarity.
Implement byol_loss(p, z), returning 2 - 2 cos(p, z).
Compute the cosine similarity of the two vectors and apply 2 - 2 cos.
No results yet
Run your code to check it against the examples, or submit to run every test.