Mercurial > pylearn
comparison dataset.py @ 344:a22ea54a19ed
bugfix, MinibatchDataSet.minibatches_nowrap() must raise StopIteration when needed
author | Frederic Bastien <bastienf@iro.umontreal.ca> |
---|---|
date | Tue, 17 Jun 2008 14:46:10 -0400 |
parents | d96be0eba3cc |
children | 7545207466d4 |
comparison
equal
deleted
inserted
replaced
343:394b4e849c1b | 344:a22ea54a19ed |
---|---|
862 raise NotImplementedError() | 862 raise NotImplementedError() |
863 def __iter__(self): | 863 def __iter__(self): |
864 return self | 864 return self |
865 def next(self): | 865 def next(self): |
866 upper = self.next_example+minibatch_size | 866 upper = self.next_example+minibatch_size |
867 assert upper<=self.ds.length | 867 if upper>self.ds.length: |
868 raise StopIteration | |
868 #minibatch = Example(self.ds._fields.keys(), | 869 #minibatch = Example(self.ds._fields.keys(), |
869 # [field[self.next_example:upper] | 870 # [field[self.next_example:upper] |
870 # for field in self.ds._fields]) | 871 # for field in self.ds._fields]) |
871 # tbm: modif to use fieldnames | 872 # tbm: modif to use fieldnames |
872 values = [] | 873 values = [] |