comparison dataset.py @ 64:863da25a60f1

trying to fix infinite loop
author Yoshua Bengio <bengioy@iro.umontreal.ca>
date Fri, 02 May 2008 11:01:28 -0400
parents 23bf2c9eb7b3
children d48eba49a2f4
comparison
equal deleted inserted replaced
63:14589f02a372 64:863da25a60f1
550 fieldnames=dataset.fieldNames() 550 fieldnames=dataset.fieldNames()
551 elif fieldnames is not dataset.fieldNames(): 551 elif fieldnames is not dataset.fieldNames():
552 dataset = FieldsSubsetDataSet(dataset,fieldnames) 552 dataset = FieldsSubsetDataSet(dataset,fieldnames)
553 assert dataset.hasFields(*fieldnames) 553 assert dataset.hasFields(*fieldnames)
554 self.dataset=dataset 554 self.dataset=dataset
555 minibatch_iterator = dataset.minibatches(fieldnames, 555 if isinstance(dataset,MinibatchDataSet):
556 minibatch_size=len(dataset), 556 LookupList.__init__(self,fieldnames,list(dataset._fields))
557 n_batches=1) 557 else:
558 minibatch=minibatch_iterator.next() 558 minibatch_iterator = dataset.minibatches(fieldnames,
559 LookupList.__init__(self,fieldnames,minibatch) 559 minibatch_size=len(dataset),
560 n_batches=1)
561 minibatch=minibatch_iterator.next()
562 LookupList.__init__(self,fieldnames,minibatch)
560 563
561 def examples(self): 564 def examples(self):
562 return self.dataset 565 return self.dataset
563 566
564 def __or__(self,other): 567 def __or__(self,other):