Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neural representation similarities #683

Open
domenicoMuscill0 opened this issue Feb 13, 2024 · 7 comments
Open

Neural representation similarities #683

domenicoMuscill0 opened this issue Feb 13, 2024 · 7 comments

Comments

@domenicoMuscill0
Copy link
Contributor

Will you consider to add to this library some similarities among neural network representations? Like CCA or CKA for example.

@KevinMusgrave
Copy link
Owner

KevinMusgrave commented Feb 14, 2024

Can you provide links to the relevant papers or code?

I'm wondering if it's out of the scope of this library, or if there is an existing library that already serves this purpose well.

@domenicoMuscill0
Copy link
Contributor Author

CKA and CCA similarities have been implemented by jayroxis and moskomule. However the second link is a library with other neural network representation similarities i am not sure it is mantained anymore, but there are tests and pytorch implementation to which compare in the tests of a future implementation.

@KevinMusgrave
Copy link
Owner

Does it make sense to apply CKA and CCA to embeddings?

@domenicoMuscill0
Copy link
Contributor Author

I think it depends on the task. It may be used in some application to NAS or in some other model that could benefit from these similarities

@KevinMusgrave
Copy link
Owner

I mean can they be used as a drop-in replacement for any existing losses, like the contrastive loss?

@domenicoMuscill0
Copy link
Contributor Author

Probably not. For CKA one uses the data matrix X (num_examples x num_features), computes a Gram matrix with it (in the link they either use linear or rbf kernels, but i think any other similarity between embeddings can be adopted) and then compares it with another Gram matrix from another batch of data. I think it qualifies best as a network comparison method rather than a true similarity measure as it is intended in this library.

@KevinMusgrave
Copy link
Owner

Ok let's leave it out for now, unless other people express interest.

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

No branches or pull requests

2 participants