changeset 1400:08a00dea117d

added some comments in dataset_ops/cifar10
author James Bergstra <bergstrj@iro.umontreal.ca>
date Thu, 13 Jan 2011 17:53:38 -0500
parents d4a35c1c0a23
children e06c0ff46d2a
files pylearn/dataset_ops/cifar10.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/dataset_ops/cifar10.py	Thu Jan 13 17:52:49 2011 -0500
+++ b/pylearn/dataset_ops/cifar10.py	Thu Jan 13 17:53:38 2011 -0500
@@ -196,7 +196,7 @@
     patches = pylearn.datasets.image_patches.extract_random_patches(imgs, N,R,C, rng)
     orig_shape = patches.shape
 
-    # center individual examples
+    # center individual examples (subtract off mean colour)
     patches = patches.reshape((orig_shape[0], R*C*3))
     patches -= patches.mean(axis=1).reshape((N, 1))
     patches = patches.reshape(orig_shape)
@@ -214,6 +214,9 @@
 
 @memo
 def random_cifar_patches_pca(max_components, max_energy_fraction, dtype, N,R,C,*args):
+    """
+    Return (eigvals, eigvecs) of centered patches from the training data.
+    """
     pca, _ = pylearn.preprocessing.pca.pca_from_examples(
             random_cifar_patches(dtype,N,R,C,*args).reshape((N,R*C*3)),
             max_components, max_energy_fraction, x_centered=True)