comparison _test_dataset.py @ 299:eded3cb54930

small bug fixed
author Thierry Bertin-Mahieux <bertinmt@iro.umontreal.ca>
date Fri, 06 Jun 2008 17:58:45 -0400
parents 5987415496df
children 0690de82c338
comparison
equal deleted inserted replaced
298:5987415496df 299:eded3cb54930
478 return self.minibatch 478 return self.minibatch
479 return MultiLengthDataSetIterator(self,fieldnames,minibatch_size,n_batches,offset) 479 return MultiLengthDataSetIterator(self,fieldnames,minibatch_size,n_batches,offset)
480 480
481 def test_ApplyFunctionDataSet(self): 481 def test_ApplyFunctionDataSet(self):
482 ds = T_Exotic1.DataSet() 482 ds = T_Exotic1.DataSet()
483 dsa = ApplyFunctionDataSet(ds,lambda x,y,z: ([x[-1]],[y*10],[int(z)]),['input','target','name'],minibatch_mode=False) #broken!!!!!! 483 dsa = ApplyFunctionDataSet(ds,lambda x,y,z: (x[-1],y*10,int(z)),['input','target','name'],minibatch_mode=False) #broken!!!!!!
484 for k in range(len(dsa)): 484 for k in range(len(dsa)):
485 res = dsa[k] 485 res = dsa[k]
486 self.failUnless(ds[k]('input')[0][-1] == res('input')[0] , 'problem in first applied function') 486 self.failUnless(ds[k]('input')[0][-1] == res('input')[0] , 'problem in first applied function')
487 res = dsa[33:96:3] 487 res = dsa[33:96:3]
488 488