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); | ||