diff pylearn/dataset_ops/image_patches.py @ 1285:976539956475

adding tinyimages
author James Bergstra <bergstrj@iro.umontreal.ca>
date Thu, 23 Sep 2010 19:12:08 -0400
parents 8ba8b08e0442
children 07b48bd449cd
line wrap: on
line diff
--- a/pylearn/dataset_ops/image_patches.py	Wed Sep 15 17:49:21 2010 -0400
+++ b/pylearn/dataset_ops/image_patches.py	Thu Sep 23 19:12:08 2010 -0400
@@ -30,7 +30,8 @@
 def image_patches(s_idx, dims,
         split='train', dtype=theano.config.floatX, rasterized=False,
         center=True,
-        unitvar=True):
+        unitvar=True,
+        fn=get_dataset):
     N,R,C=dims
 
     if split != 'train':
@@ -39,7 +40,7 @@
     if not rasterized:
         raise NotImplementedError()
 
-    op = TensorFnDataset(dtype, bcast=(False,), fn=(get_dataset, (N,R,C,dtype,center,unitvar)), single_shape=(R*C,))
+    op = TensorFnDataset(dtype, bcast=(False,), fn=(fn, (N,R,C,dtype,center,unitvar)), single_shape=(R*C,))
     x = op(s_idx%N)
     if x.ndim == 1:
         if not rasterized:
@@ -87,7 +88,8 @@
         split='train', 
         dtype=theano.config.floatX, rasterized=True,
         center=True,
-        unitvar=True):
+        unitvar=True,
+        fn=ranzato_hinton_2010_whitened_patches):
     N = 10240
 
     if split != 'train':
@@ -104,7 +106,7 @@
 
     op = TensorFnDataset(dtype,
             bcast=(False,), 
-            fn=ranzato_hinton_2010_whitened_patches,
+            fn=fn,
             single_shape=(105,))
     x = op(s_idx%N)
     return x