pytorch-metric-learning icon indicating copy to clipboard operation
pytorch-metric-learning copied to clipboard

Example request : VICRegLoss

Open stereomatchingkiss opened this issue 3 years ago • 5 comments

Any plan to include example of this loss function? Thanks

stereomatchingkiss avatar Apr 09 '22 11:04 stereomatchingkiss

Do you mean a jupyter notebook showing how to use VICRegLoss?

KevinMusgrave avatar Apr 11 '22 12:04 KevinMusgrave

Do you mean a jupyter notebook showing how to use VICRegLoss?

Yes, is it possible? Hard to know how to use it just look at the doc.

stereomatchingkiss avatar Apr 11 '22 15:04 stereomatchingkiss

It's possible, but might be lower priority. I'll leave this issue open anyway in case someone wants to make a pull request to add an example notebook.

I think you'll find the official paper implementation helpful: https://github.com/facebookresearch/vicreg

KevinMusgrave avatar Apr 11 '22 15:04 KevinMusgrave

Thank you @KevinMusgrave for such a masterpiece of a library. I have a question relating to the VICRegLoss which I think is what is confusing @stereomatchingkiss as well. I read the paper but I'm a bit confused about it's implementation in PML. Why does the loss not follow the typical (embeddings, labels) arguments like most of the other losses. What is the reference embedding? Why can't that just be a label referring to another embedding?

TKassis avatar Dec 23 '22 19:12 TKassis

Thanks @TKassis 😄

When the implementation was discussed (#372) it seemed like this loss would only ever be used as shown in Figure 1 of the paper:

image

So embeddings and ref_emb are always for the same set of data, but with different data augmentations.

That said, I would prefer if VICRegLoss followed the same format as the other loss functions. I've created a separate issue for this task now (#560).

KevinMusgrave avatar Dec 24 '22 19:12 KevinMusgrave