changeset 627:ec27e19bb6eb

moving away from mnist_factory
author James Bergstra <bergstrj@iro.umontreal.ca>
date Mon, 19 Jan 2009 18:10:48 -0500
parents 25d9f91f1afa
children 739720896d61
files pylearn/datasets/MNIST.py
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/datasets/MNIST.py	Sun Jan 18 22:17:56 2009 -0500
+++ b/pylearn/datasets/MNIST.py	Mon Jan 19 18:10:48 2009 -0500
@@ -8,7 +8,7 @@
 
 from ..io.amat import AMat
 from .config import data_root
-from .dataset import dataset_factory, Dataset
+from .dataset import Dataset
 
 def head(n=10, path=None):
     """Load the first MNIST examples.
@@ -50,15 +50,23 @@
     return rval
 
 
+def full():
+    return train_valid_test()
 
-@dataset_factory('MNIST')
+def first_1k():
+    return train_valid_test(ntrain=1000, nvalid=200, ntest=200)
+
+def first_10k():
+    return train_valid_test(ntrain=10000, nvalid=2000, ntest=2000)
+
+#old method from factory idea days... delete when ready -JB20090119
 def mnist_factory(variant="", ntrain=None, nvalid=None, ntest=None):
     if variant=="":
-        return train_valid_test()
+        return full()
     elif variant=="1k":
-        return train_valid_test(ntrain=1000, nvalid=200, ntest=200)
+        return first_1k()
     elif variant=="10k":
-        return train_valid_test(ntrain=10000, nvalid=2000, ntest=2000)
+        return first_10k()
     elif variant=="custom":
         return train_valid_test(ntrain=ntrain, nvalid=nvalid, ntest=ntest)
     else: