Whitening makes features uncorrelated with unit variance. PCA whitening does this by rotating into the principal axes, which can make images look unlike the original. ZCA whitening applies the same decorrelation but rotates back, so the output stays as close to the input as a whitening transform can be.
Implement zca_whiten(X, eps=1e-8). Return an array of the same shape as X.
X.X must have at least 2 rows, otherwise raise ValueError.eps must be nonnegative, otherwise raise ValueError.X.With eigh the matrix V diag(...) Vᵀ is symmetric, so you can build it with vecs * scale @ vecs.T.
No results yet
Run your code to check it against the examples, or submit to run every test.