# HG changeset patch # User Frederic Bastien # Date 1212680864 14400 # Node ID fa8abc813bd21c759817c3ed56e0b2d79de74449 # Parent fdce496c3b5616a2f77c9302cfb5bf91e8c4687d# Parent 6226ebafefc399b2520c9c58f6f2dac6a26dd3e6 Automated merge with ssh://projects@lgcm.iro.umontreal.ca/hg/pylearn diff -r fdce496c3b56 -r fa8abc813bd2 dataset.py --- a/dataset.py Wed Jun 04 19:04:40 2008 -0400 +++ b/dataset.py Thu Jun 05 11:47:44 2008 -0400 @@ -1051,32 +1051,30 @@ return self.__dict__[key] def __iter__(self): - class ArrayDataSetIterator2(object): - def __init__(self,dataset,fieldnames,minibatch_size,n_batches,offset): + class ArrayDataSetIteratorIter(object): + def __init__(self,dataset,fieldnames): if fieldnames is None: fieldnames = dataset.fieldNames() # store the resulting minibatch in a lookup-list of values self.minibatch = LookupList(fieldnames,[0]*len(fieldnames)) self.dataset=dataset - self.minibatch_size=minibatch_size - assert offset>=0 and offset=self.dataset.data.shape[0]: + if self.current>=self.l: raise StopIteration sub_data = self.dataset.data[self.current] self.minibatch._values = [sub_data[c] for c in self.columns] - self.current+=self.minibatch_size + self.current+=1 return self.minibatch - return ArrayDataSetIterator2(self,self.fieldNames(),1,0,0) + return ArrayDataSetIteratorIter(self,self.fieldNames()) def minibatches_nowrap(self,fieldnames,minibatch_size,n_batches,offset): class ArrayDataSetIterator(object):