# HG changeset patch # User Thierry Bertin-Mahieux # Date 1213646596 14400 # Node ID 9ce791fb2cbf1721ce66d01610a7a8bebf52db50 # Parent 2480024bf401aa87f8563c3c4b07e95d81da5c72 little hack in MiniBatchToSingleExampleIterator, there was a problem which I think was not a bug, we were receiving [array(3)] and everything was crashing. Hack is kinda slow diff -r 2480024bf401 -r 9ce791fb2cbf dataset.py --- a/dataset.py Mon Jun 16 12:57:32 2008 -0400 +++ b/dataset.py Mon Jun 16 16:03:16 2008 -0400 @@ -240,7 +240,13 @@ def next(self): size1_minibatch = self.minibatch_iterator.next() if not self.minibatch: - self.minibatch = Example(size1_minibatch.keys(),[value[0] for value in size1_minibatch.values()]) + names = size1_minibatch.keys() + # next lines are a hack, but there was problem when we were getting [array(327)] for instance + if len(size1_minibatch.values()[0].shape) > 0 : + values = [value[0] for value in size1_minibatch.values()] + else : + values = [value for value in size1_minibatch.values()] + self.minibatch = Example(names,values) else: self.minibatch._values = [value[0] for value in size1_minibatch.values()] return self.minibatch