RElbers / info-nce-pytorch

PyTorch implementation of the InfoNCE loss for self-supervised learning.
MIT License
445 stars 37 forks source link

Contribute to PyTorch? #10

Closed adamjstewart closed 1 year ago

adamjstewart commented 1 year ago

Have you ever considered contributing this loss function to PyTorch? TorchGeo would love to use it for SimCLR/MoCo SSL but we are trying to avoid adding yet another dependency. If it was built into PyTorch, it would be much easier to use.

RElbers commented 1 year ago

I understand the desire to limit the number of dependencies. I'll see what I can do.

adamjstewart commented 1 year ago

We ended up using the lightly implementation because we needed it anyway for other SSL features. I'll close this since I personally no longer have a need for this, but I still think it would be cool if this loss was in PyTorch someday.