comparison dataset.py @ 196:bda6d89d0b3d

the function should take the example unpacked as an input.
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Tue, 13 May 2008 15:27:45 -0400
parents 895b4b60f5e8
children 96d891448107
comparison
equal deleted inserted replaced
195:363752267470 196:bda6d89d0b3d
1175 self.input_iterator=output_dataset.input_dataset.__iter__() 1175 self.input_iterator=output_dataset.input_dataset.__iter__()
1176 def __iter__(self): return self 1176 def __iter__(self): return self
1177 def next(self): 1177 def next(self):
1178 function_inputs = self.input_iterator.next() 1178 function_inputs = self.input_iterator.next()
1179 if self.output_dataset.minibatch_mode: 1179 if self.output_dataset.minibatch_mode:
1180 function_outputs = [output[0] for output in self.output_dataset.function(function_inputs)] 1180 function_outputs = [output[0] for output in self.output_dataset.function(*function_inputs)]
1181 else: 1181 else:
1182 function_outputs = self.output_dataset.function(function_inputs) 1182 function_outputs = self.output_dataset.function(function_inputs)
1183 return Example(self.output_dataset.output_names,function_outputs) 1183 return Example(self.output_dataset.output_names,function_outputs)
1184 return ApplyFunctionSingleExampleIterator(self) 1184 return ApplyFunctionSingleExampleIterator(self)
1185 1185