sustaining_gazes/matlab_version/face_validation/DeepLearnToolbox/util/whiten.m

7 lines
183 B
Mathematica
Raw Normal View History

2016-04-28 19:40:36 +00:00
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