Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

How to change MSN loss to PMSN loss? (from paper "The Hidden Uniform Cluster Prior in Self-Supervised Learning") #20

Open
faris-k opened this issue Feb 8, 2023 · 1 comment

Comments

@faris-k
Copy link

faris-k commented Feb 8, 2023

I couldn't find an official code release for this paper arxiv.org/abs/2210.07277, in which an extension is proposed to MSN to allow arbitrary feature priors.

It looks like the main difference is a change of a single term in the loss function. Is that correct? How would I implement the changes mentioned in the PMSN paper?

Previous MSN loss:

image

New loss: Prior Matching for Siamese Networks, PMSN:

image

@faris-k
Copy link
Author

faris-k commented Mar 26, 2023

In case anyone stumbles upon this, the lightly package has a nice implementation of PMSN. I believe they're using a regularization weight of $\lambda = 1$.

https://github.com/lightly-ai/lightly/blob/ddfed3c4dc03a8d2722df24bfa537d24ac80bde6/examples/pytorch_lightning/pmsn.py

https://github.com/lightly-ai/lightly/blob/ddfed3c4dc03a8d2722df24bfa537d24ac80bde6/lightly/loss/pmsn_loss.py

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant