changeset 1282:f36f59e53c28

cifar10 op - made splits constructors a parameter
author James Bergstra <bergstrj@iro.umontreal.ca>
date Wed, 15 Sep 2010 17:46:03 -0400
parents 5ae77ac21609
children a73db8d65abb
files pylearn/dataset_ops/cifar10.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/dataset_ops/cifar10.py	Wed Sep 15 17:45:04 2010 -0400
+++ b/pylearn/dataset_ops/cifar10.py	Wed Sep 15 17:46:03 2010 -0400
@@ -58,7 +58,11 @@
     return test_data_labels()[1]
 
 
-def cifar10(s_idx, split, dtype='float64', rasterized=False, color='grey'):
+def cifar10(s_idx, split, dtype='float64', rasterized=False, color='grey',
+        split_options = {'train':(train_data, train_labels),
+                'valid': (valid_data, valid_labels),
+                'test': (test_data, test_labels)}
+            ):
     """ 
     Returns a pair (img, label) of theano expressions for cifar-10 samples
 
@@ -76,10 +80,6 @@
 
     """
 
-    split_options = {'train':(train_data, train_labels),
-            'valid': (valid_data, valid_labels),
-            'test': (test_data, test_labels)}
-
     if split not in split_options:
         raise ValueError('invalid split option', (split, split_options.keys()))