Exercise:PCA and Whitening

From Ufldl

Jump to: navigation, search
(PCA, PCA whitening and ZCA implementation)
Line 5: Line 5:
You will build on the MATLAB starter code which we have provided in <tt>[http://ufldl.stanford.edu/wiki/resources/pca_exercise.zip pca_exercise.zip]</tt>. You need only write code at the places indicated by "YOUR CODE HERE" in the files. The only file you need to modify is <tt>pca_gen.m</tt>.
You will build on the MATLAB starter code which we have provided in <tt>[http://ufldl.stanford.edu/wiki/resources/pca_exercise.zip pca_exercise.zip]</tt>. You need only write code at the places indicated by "YOUR CODE HERE" in the files. The only file you need to modify is <tt>pca_gen.m</tt>.
-
=== Step 0: Load data ===
+
=== Step 0a: Load data ===
The starter code contains code to load some natural images and sample 10000 14x14 patches from them. The raw patches sampled from the images will look something like this:
The starter code contains code to load some natural images and sample 10000 14x14 patches from them. The raw patches sampled from the images will look something like this:
Line 12: Line 12:
These patches are stored as column vectors <math>x^{(i)} \in \mathbb{R}^{196}</math> in the <math>196 \times 10000</math> matrix <math>x</math>.
These patches are stored as column vectors <math>x^{(i)} \in \mathbb{R}^{196}</math> in the <math>196 \times 10000</math> matrix <math>x</math>.
 +
 +
=== Step 0b: Zero mean the data ===
 +
 +
You should then zero-mean the data by subtracting the mean image from each image.
=== Step 1: Implement PCA ===
=== Step 1: Implement PCA ===

Revision as of 01:37, 29 April 2011

Personal tools