sustaining_gazes/matlab_version/face_validation/DeepLearnToolbox/util/whiten.m
2016-04-28 15:40:36 -04:00

7 lines
No EOL
183 B
Mathematica

function X = whiten(X, fudgefactor)
C = cov(X);
M = mean(X);
[V,D] = eig(C);
P = V * diag(sqrt(1./(diag(D) + fudgefactor))) * V';
X = bsxfun(@minus, X, M) * P;
end