(Raghu et al., 2017) proposed a way to compare two representations that is both invariant to affine transform and fast to compute 1
based on canonical correlation analysis which was invariant to linear transformation.
definition
Given a dataset and a neuron on layer , we define to be the vector of outputs on , or:
SVCCA proceeds as following:
-
Input: takes as input two (not necessary different) sets of neurons and
-
Step 1: Perform SVD of each subspace to get subspace
-
Step 2: Compute Canonical Correlation similarity between , that is maximal correlations between can be expressed as:
where are covariance and cross-variance terms.
By performing change of basis and and Cauchy-Schwarz we recover an eigenvalue problem:
-
Output: aligned directions and correlations
distributed representations
SVCCA has no preference for representations that are neuron (axed) aligned. 2
References
- Raghu, M., Gilmer, J., Yosinski, J., & Sohl-Dickstein, J. (2017). SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability. arXiv preprint arXiv:1706.05806 arxiv
Footnotes
-
means allowing comparison between different layers of network and more comparisons to be calculated than with previous methods ↩
-
Experiments were conducted with a convolutional network followed by a residual network:
convnet:
conv --> conv --> bn --> pool --> conv --> conv --> conv --> conv --> bn --> pool --> fc --> bn --> fc --> bn --> out
resnet:
conv --> (x10 c/bn/r block) --> (x10 c/bn/r block) --> (x10 c/bn/r block) --> bn --> fc --> out
Note that SVD and CCA works with instead of being axis aligned to directions. This is important if representations are distributed across many dimensions, which we observe in cross-branch superpositions! ↩