Exercise:PCA and Whitening

From Ufldl

Jump to: navigation, search
(Step 4b: Check covariance)
Line 69: Line 69:
To verify that your implementation of PCA whitening with and without regularisation is correct, you can check these properties. Implement code to compute the covariance matrix and verify this property. (How should you check your PCA whitening code without regularisation? Simply set epsilon to 0, or close to 0). As earlier, you can visualise the covariance matrix with <tt>imagesc</tt>. When visualised as an image, for PCA whitening without regularisation you should see a red line across the diagonal (corresponding to the one entries) against a blue background (corresponding to the zero entries); for PCA whitening with regularisation you should see a red line that slowly turns blue across the diagonal (corresponding to the 1 entries slowly becoming smaller).
To verify that your implementation of PCA whitening with and without regularisation is correct, you can check these properties. Implement code to compute the covariance matrix and verify this property. (How should you check your PCA whitening code without regularisation? Simply set epsilon to 0, or close to 0). As earlier, you can visualise the covariance matrix with <tt>imagesc</tt>. When visualised as an image, for PCA whitening without regularisation you should see a red line across the diagonal (corresponding to the one entries) against a blue background (corresponding to the zero entries); for PCA whitening with regularisation you should see a red line that slowly turns blue across the diagonal (corresponding to the 1 entries slowly becoming smaller).
-
[[File:pca_whitened_covar.png|360px]]
+
<table>
 +
<tr>
 +
<td>[[File:pca_whitened_covar.png|360px|alt=Covariance for PCA whitening with regularisation|Covariance for PCA whitening with regularisation]]</td>
 +
<td>[[File:pca_whitened_unregularised_covar.png|360px|alt=Covariance for PCA whitening with regularisation|Covariance for PCA whitening without regularisation]]</td>
 +
</tr>
 +
<tr>
 +
<td>PCA whitening with regularisation</td>
 +
<td>PCA whitening without regularisation</td>
 +
</tr>
 +
</table>
=== Step 5: ZCA whitening ===
=== Step 5: ZCA whitening ===

Revision as of 18:40, 29 April 2011

Personal tools