changeset 475:11e0357f06f4

typo in MNIST.train_valid_test
author James Bergstra <bergstrj@iro.umontreal.ca>
date Thu, 23 Oct 2008 18:06:21 -0400
parents 40c8a46b3da7
children 8fcd0f3d9a17 8ff412852d66
files datasets/MNIST.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/datasets/MNIST.py	Thu Oct 23 18:05:46 2008 -0400
+++ b/datasets/MNIST.py	Thu Oct 23 18:06:21 2008 -0400
@@ -25,12 +25,8 @@
 
     return dat.input, numpy.asarray(dat.target, dtype='int64').reshape(dat.target.shape[0])
 
-def all(path=None):
-    return head(n=None, path=path)
-
-
-def train_valid_test(path=None, ntrain=50000, nvalid=10000, ntest=10000):
-    all_x, all_targ = all(path=path)
+def train_valid_test(ntrain=50000, nvalid=10000, ntest=10000, path=None):
+    all_x, all_targ = head(ntrain+nvalid+ntest, path=path)
 
     train = all_x[0:ntrain], all_targ[0:ntrain]
     valid = all_x[ntrain:ntrain+nvalid], all_targ[ntrain:ntrain+nvalid]
@@ -38,3 +34,7 @@
 
     return train, valid, test
 
+def all(path=None):
+    return head(n=None, path=path)
+
+