changeset 160:a910141fbe5b

Automated merge with ssh://p-omega1@lgcm.iro.umontreal.ca/tlearn
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Mon, 12 May 2008 16:52:00 -0400
parents cc8b032417db (current diff) 28a988bd19c3 (diff)
children 60e00cce3492
files
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/dataset.py	Mon May 12 16:17:22 2008 -0400
+++ b/dataset.py	Mon May 12 16:52:00 2008 -0400
@@ -1079,6 +1079,7 @@
                       self.dataset.cached_examples.append(example)
               all_fields_minibatch = Example(self.dataset.fieldNames(),
                                              zip(*self.dataset.cached_examples[self.current:self.current+minibatch_size]))
+              self.current+=1
               if self.dataset.fieldNames()==fieldnames:
                   return all_fields_minibatch
               return Example(fieldnames,[all_fields_minibatch[name] for name in fieldnames])
--- a/test_dataset.py	Mon May 12 16:17:22 2008 -0400
+++ b/test_dataset.py	Mon May 12 16:52:00 2008 -0400
@@ -383,7 +383,7 @@
     assert example+example2==example3
     assert have_raised("var['x']+var['x']",x=example)
 
-def test_CacheDataSet():
+def test_CachedDataSet():
     print "test_CacheDataSet"
     a2 = numpy.random.rand(10,4)
     ds1 = ArrayDataSet(a2,LookupList(['x','y','z'],[slice(3),3,[0,2]]))###???tuple not tested
@@ -436,9 +436,9 @@
 def test_ArrayFieldsDataSet():
     print "test_ArrayFieldsDataSet"
     raise NotImplementedError()
-
-test1()
-test_LookupList()
-test_ArrayDataSet()
-test_CacheDataSet()
+if __name__=='__main__':
+    test1()
+    test_LookupList()
+    test_ArrayDataSet()
+    test_CachedDataSet()
 #test pmat.py