Closed LukasMut closed 7 months ago
Just wondering while you're "in the zone" with refactoring CKA, maybe you can add the debiased version of CKA? It's an alteration of HSIC and only a minor change, already given in the PyTorch implementation of Simon's notebook demo:
https://github.com/google-research/google-research/blob/master/representation_similarity/Demo.ipynb
I have some recent work looking at some issues with the regular formulation of CKA and that the debiased/unbiased version might actually be what people need to be looking at in some cases:
https://openreview.net/forum?id=E1NRrGtIHG
Super, super busy at the moment otherwise I would add it. I still might, if you can't, but the changes to be made are in the notebook above and should only require an extra parameter to the CKA call.
Just wondering while you're "in the zone" with refactoring CKA, maybe you can add the debiased version of CKA? It's an alteration of HSIC and only a minor change, already given in the PyTorch implementation of Simon's notebook demo:
https://github.com/google-research/google-research/blob/master/representation_similarity/Demo.ipynb
I have some recent work looking at some issues with the regular formulation of CKA and that the debiased/unbiased version might actually be what people need to be looking at in some cases:
https://openreview.net/forum?id=E1NRrGtIHG
Super, super busy at the moment otherwise I would add it. I still might, if you can't, but the changes to be made are in the notebook above and should only require an extra parameter to the CKA call.
Done. I just added it. See most recent pushes.
Attention: Patch coverage is 81.28655%
with 32 lines
in your changes are missing coverage. Please review.
Project coverage is 74.37%. Comparing base (
a467d0f
) to head (f4ea770
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Great! Thanks for adding that. Code looks nice!
Great! Thanks for adding that. Code looks nice!
No worries. Glad to hear you like the code! @Alxmrphi Could you approve the PR?
torch>=2.0.0
andtorchvision=0.15.*
(fixes issue #165)get_cka
where user can setbackend
(torch
ornumpy
)