# HG changeset patch # User James Bergstra # Date 1294959218 18000 # Node ID 08a00dea117d8c399dde0beb98a4ebca62814dd3 # Parent d4a35c1c0a232fdec05df19387438d9c1638e06c added some comments in dataset_ops/cifar10 diff -r d4a35c1c0a23 -r 08a00dea117d pylearn/dataset_ops/cifar10.py --- 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)