changeset 1354:be3030305d4b

icml07 loaders works
author James Bergstra <bergstrj@iro.umontreal.ca>
date Wed, 03 Nov 2010 12:58:04 -0400
parents 2024c5618466
children ba8a32b71356
files pylearn/datasets/icml07.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/datasets/icml07.py	Wed Nov 03 12:49:24 2010 -0400
+++ b/pylearn/datasets/icml07.py	Wed Nov 03 12:58:04 2010 -0400
@@ -23,7 +23,9 @@
 
     def load_from_amat(self):
         if self.amat_filename_all is not None:
-            raise NotImplementedError()
+            amat_all = AMat(self.amat_filename_all)
+            allmat = amat_all.all
+            assert allmat.shape[0] == self.n_train + self.n_valid + self.n_test, allmat.shape
         else:
             if self.amat_filename_root is not None:
                 amat_train = AMat(self.amat_filename_root+'_train.amat')
@@ -57,7 +59,6 @@
         assert numpy.all(labels < self.n_classes)
         return inputs, labels
 
-
 def icml07_loaders(new_version=True, rootdir='.'):
     rval = dict(
         mnist_basic=DatasetLoader(
@@ -121,7 +122,7 @@
             n_test=50000
             ),
         )
-    for level in range(1,6):
+    for level in range(1,7):
         rval['mnist_noise_%i'%level] = DatasetLoader(
             http_source='http://www.iro.umontreal.ca/~lisa/icml2007data/mnist_noise_variation.tar.gz',
             amat_filename_all=os.path.join(rootdir,
@@ -131,7 +132,7 @@
             n_classes=10,
             n_train=10000,
             n_valid=2000,
-            n_test=50000
+            n_test=2000
             )
 
     if new_version: