I read the code and found that all the embeddings in the loss function are L2-normalized in the projection head, but regarding the dequeue_and_enqueue function, why are the features normalized again at L122 and L134 in trainer_contrastive.py?
Hi @ccccly, the normalization in L122 is essential since new features are obtained for segments that are not guaranteed to be normalized. The one in L134 is indeed redundant. I wrote this to keep the code more consistent, but anyway it will have no effect. Feel free to remove it.
Dear author,
I read the code and found that all the embeddings in the loss function are L2-normalized in the projection head, but regarding the dequeue_and_enqueue function, why are the features normalized again at L122 and L134 in trainer_contrastive.py?