NoTody / CKA-similarity

An Numpy and PyTorch Implementation of CKA-similarity with CUDA support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CKA-similarity

An PyTorch Implementation of CKA-similarity with CUDA support. Inspired by: https://github.com/yuanli2333/CKA-Centered-Kernel-Alignment

The Centered Kernel Alignment (CKA) method is from paper:

Similarity of Neural Network Representations Revisited. [https://arxiv.org/abs/1905.00414]

Running time for the example notebook

Numpy: 3min 8s

PyTorch: 15.3s

For large matrices, use PyTorch with CUDA to accelerate.

Dependencies

python3
numpy
gzip
torch

Tested environment: PyTorch v1.7.0, Python 3.6.9

About

An Numpy and PyTorch Implementation of CKA-similarity with CUDA support


Languages

Language:Jupyter Notebook 52.5%Language:Python 47.5%