What is a good cca, cka library for pytorch that works (ideally with GPU)?

I found:

but it doesn’t seem to work reliably (or is it documented).

Is there a standard library pytorch peeps use for cca, cka, neural net comparison analysis that actually works? (ideally on gpu)

Hi,

I am not sure if it has all you need but https://captum.ai/ seems to be similar?

that looks promising! Do they have CCA and CKA? I couldn’t find them in their library :frowning:


reddit crosspost: https://www.reddit.com/r/pytorch/comments/ksocf8/what_is_a_good_cca_cka_library_for_pytorch_that/


link to captum github page: GitHub - pytorch/captum: Model interpretability and understanding for PyTorch

Perhaps you could try this one? GitHub - AntixK/PyTorch-Model-Compare: Compare neural networks by their feature similarity

It seems to work reasonably well, especially for the same model measured against itself which generates a nice diagonal line. However, for two different models, e.g. ResNet18 vs ResNet101, I haven’t had much luck in uncovering any distinct similarity patterns using CKA. I’m not sure if there is a bug in the CKA code or if the two networks just learn very differently.