changeset 330:20e08c52c98c

merge
author Thierry Bertin-Mahieux <bertinmt@iro.umontreal.ca>
date Mon, 16 Jun 2008 16:11:36 -0400
parents 9ce791fb2cbf (diff) 09140ba68e17 (current diff)
children 52aa031e1fe3
files dataset.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dataset.py	Mon Jun 16 16:06:59 2008 -0400
+++ b/dataset.py	Mon Jun 16 16:11:36 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