changeset 200:ac61f1178f88

bugfix?
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Thu, 15 May 2008 13:04:20 -0400
parents 1400fa04dfab
children c9c966cab763
files dataset.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dataset.py	Tue May 13 16:42:51 2008 -0400
+++ b/dataset.py	Thu May 15 13:04:20 2008 -0400
@@ -1177,12 +1177,13 @@
               self.input_iterator=output_dataset.input_dataset.__iter__()
           def __iter__(self): return self
           def next(self):
-              function_inputs = self.input_iterator.next()
               if self.output_dataset.minibatch_mode:
+                  function_inputs = [[input] for input in self.input_iterator.next()]
                   outputs = self.output_dataset.function(*function_inputs)
                   assert all([hasattr(output,'__iter__') for output in outputs])
                   function_outputs = [output[0] for output in outputs]
               else:
+                  function_inputs = self.input_iterator.next()
                   function_outputs = self.output_dataset.function(*function_inputs)
               return Example(self.output_dataset.output_names,function_outputs)
       return ApplyFunctionSingleExampleIterator(self)