# HG changeset patch # User Frederic Bastien # Date 1210625520 14400 # Node ID a910141fbe5be2a52c19f5bb3a42f6074141df44 # Parent cc8b032417dbeb428a6721f542fc9fa3345a351b# Parent 28a988bd19c34e4e8f93e4437e9a909ebaa1eecc Automated merge with ssh://p-omega1@lgcm.iro.umontreal.ca/tlearn diff -r cc8b032417db -r a910141fbe5b dataset.py --- 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]) diff -r cc8b032417db -r a910141fbe5b test_dataset.py --- 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