Centre the data, or the code spends itself on the mean
numeric▲▲△Three inputs are , and . A width-one linear autoencoder without biases is trained on them as they are. Find the direction it keeps, the three codes and the loss. Then subtract the mean first and repeat. Which result is the principal subspace?
Hint
Without centring, the matrix in (I.12.2) is the second-moment matrix and not the covariance. Apply I.12.T1 to whichever matrix the loss contains.
Solution
As they are. The second-moment matrix is
The algebra of I.12.T1 applies to this matrix. Its largest eigenvalue is , with eigenvector , so the autoencoder keeps the first coordinate. All three codes are . Every input is reconstructed as and the loss is the other eigenvalue, .
The code is the same number for every example. It carries no information about which example it came from.
Centred. The mean is , and the centred inputs are , and . The covariance is . Its largest eigenvalue is , with eigenvector . The codes are , and , and the loss is the other eigenvalue, .
The second result is the principal subspace: the direction along which the data vary. The first is the direction in which the data are large. The two matrices differ by for the mean , and when the mean is long compared with the spread, that term dominates and the leading direction is close to itself.
An autoencoder with a bias in the decoder can learn the mean and escape this. Without one, centre the data first.