moskomule / anatome

Ἀνατομή is a PyTorch library to analyze representation of neural networks
MIT License
61 stars 6 forks source link

Is the way to calculate similarity just by doing 1 minus the values your library gives? #6

Closed brando90 closed 3 years ago

brando90 commented 3 years ago

asking because

  1. it seems the original paper for CKA gives the values in terms of similarities and not distances so I don't understand why the library here gives them in distances
  2. make sure I don't do 1 - cca and make mistakes/is valid.

I see that you have a bunch of 1 - value except for CKA, is that a bug?

https://github.com/moskomule/anatome/blob/57f34fa796ffcff0ba37b5fa5142018e9f6fde61/anatome/similarity.py#L154 https://github.com/moskomule/anatome/blob/57f34fa796ffcff0ba37b5fa5142018e9f6fde61/anatome/similarity.py#L133 https://github.com/moskomule/anatome/blob/57f34fa796ffcff0ba37b5fa5142018e9f6fde61/anatome/similarity.py#L203

brando90 commented 3 years ago

I believe it might be missing a 1 - cka for cka

Screen Shot 2021-02-02 at 4 52 02 PM
moskomule commented 3 years ago

Thanks for the information. I'll check it.

brando90 commented 3 years ago

Thanks for the information. I'll check it.

Cool, thanks! Did you have time check take a look at it, is it correct that there is a tiny bug? I believe you might only need to do 1-CKA