Implementing PCA/Whitening
From Ufldl
Line 6: | Line 6: | ||
We achieve this by computing the mean for each patch and subtracting it for each patch. In Matlab, we can do this by using | We achieve this by computing the mean for each patch and subtracting it for each patch. In Matlab, we can do this by using | ||
- | avg = mean(x, 1); | + | avg = mean(x, 1); % Compute the mean pixel intensity value separately for each patch. |
x = x - repmat(avg, size(x, 1), 1); | x = x - repmat(avg, size(x, 1), 1); | ||
Line 49: | Line 49: | ||
xZCAwhite = U * diag(1./sqrt(diag(S) + epsilon)) * U' * x; | xZCAwhite = U * diag(1./sqrt(diag(S) + epsilon)) * U' * x; | ||
+ | |||
+ | |||
+ | {{PCA}} | ||
+ | |||
+ | |||
+ | {{Languages|实现主成分分析和白化|中文}} |