changeset 247:9502f100eda5

Automated merge with ssh://projects@lgcm.iro.umontreal.ca/hg/pylearn
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Tue, 03 Jun 2008 12:14:03 -0400
parents c702abb7f875 (current diff) 0fb75fdd727d (diff)
children e93e511deb9a 474be3d12c23
files
diffstat 1 files changed, 23 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/test_dataset.py	Mon Jun 02 17:09:58 2008 -0400
+++ b/test_dataset.py	Tue Jun 03 12:14:03 2008 -0400
@@ -500,38 +500,52 @@
     ds = ArrayDataSet(a2,{'all':slice(0,a2.shape[1],1)})
     mat = numpy.random.rand(400,100)
     @print_timing
-    def f_array1(a):
+    def f_array_full(a):
         a+1
     @print_timing
-    def f_array2(a):
+    def f_array_index(a):
         for id in range(a.shape[0]):
 #            pass
             a[id]+1
 #            a[id]*mat
     @print_timing
-    def f_ds(ds):
+    def f_array_iter(a):
+        for r in a:
+#            pass
+            r+1
+#            r*mat
+    @print_timing
+    def f_ds_index(ds):
+        for id in range(len(ds)):
+#            pass
+            ds[id][0]+1
+#            ds[id][0]*mat
+    @print_timing
+    def f_ds_iter(ds):
         for ex in ds:
 #            pass
             ex[0]+1
-#            a[id]*mat
+#            a[0]*mat
     @print_timing
     def f_ds_mb1(ds,mb_size):
         for exs in ds.minibatches(minibatch_size = mb_size):
             for ex in exs:
 #                pass
                 ex[0]+1
-#                ex[id]*mat
+#                ex[0]*mat
     @print_timing
     def f_ds_mb2(ds,mb_size):
         for exs in ds.minibatches(minibatch_size = mb_size):
 #            pass
             exs[0]+1
-#            ex[id]*mat
+#            ex[0]*mat
 
-    f_array1(a2)
-    f_array2(a2)
+    f_array_full(a2)
+    f_array_index(a2)
+    f_array_iter(a2)
 
-    f_ds(ds)
+    f_ds_index(ds)
+    f_ds_iter(ds)
 
     f_ds_mb1(ds,10)
     f_ds_mb1(ds,100)