(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:

  1. Input: takes as input two (not necessary different) sets of neurons and

  2. Step 1: Perform SVD of each subspace to get subspace

  3. 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:

  4. Output: aligned directions and correlations

distributed representations

SVCCA has no preference for representations that are neuron (axed) aligned. 2

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

  1. means allowing comparison between different layers of network and more comparisons to be calculated than with previous methods

  2. 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!