The following code for the CIFAR dataset after GCN:
xtx = np.dot(dataset.train_data[i].transpose(), dataset.train_data[i])
e, q = np.linalg.eigh(xtx)
print(np.max(e), np.min(e))
Produces the following output:
2.65138e+07 -0.00247511
This is inconsistent given that xtx
is symmetric positive-semi definite. My guess is that this might be due to applying GCN earlier, but still the minimum eigenvalue is not even that close to 0?
Update: So the condition number of my matrix is 8.89952e+09. I've actually have forgotten before to take out the mean so now the maximum eigenvalue is ~573, while the minimum is -7.14630133e-08. My question is that I'm trying to do ZCA. In this case how should I proceed? Add a diagonal petrubtion to xtx
or to the Eigenvalues?