comparison learner.py @ 126:4efe6d36c061

minor edits
author Yoshua Bengio <bengioy@iro.umontreal.ca>
date Wed, 07 May 2008 16:57:48 -0400
parents d0a1bd0378c6
children ee5507af2c60
comparison
equal deleted inserted replaced
121:2ca8dccba270 126:4efe6d36c061
54 If output_fields is specified, it may be use to indicate which fields should 54 If output_fields is specified, it may be use to indicate which fields should
55 be constructed in the output DataSet (for example ['output','classification_error']). 55 be constructed in the output DataSet (for example ['output','classification_error']).
56 Optionally, if copy_inputs, the input fields (of the input_dataset) can be made 56 Optionally, if copy_inputs, the input fields (of the input_dataset) can be made
57 visible in the output DataSet returned by this method. 57 visible in the output DataSet returned by this method.
58 """ 58 """
59 raise NotImplementedError 59 raise AbstractFunction()
60 60
61 def attributeNames(self): 61 def attributeNames(self):
62 """ 62 """
63 A Learner may have attributes that it wishes to export to other objects. To automate 63 A Learner may have attributes that it wishes to export to other objects. To automate
64 such export, sub-classes should define here the names (list of strings) of these attributes. 64 such export, sub-classes should define here the names (list of strings) of these attributes.
226 If output_attributes is None then all of the attributes in self.AttributeNames() 226 If output_attributes is None then all of the attributes in self.AttributeNames()
227 are copied in the output dataset, but if it is [] (the default), then none are copied. 227 are copied in the output dataset, but if it is [] (the default), then none are copied.
228 If a test_stats_collector is provided, then its attributes (test_stats_collector.AttributeNames()) 228 If a test_stats_collector is provided, then its attributes (test_stats_collector.AttributeNames())
229 are also copied into the output dataset attributes. 229 are also copied into the output dataset attributes.
230 """ 230 """
231 minibatchwise_use_function = minibatchwise_use_functions(input_dataset.fieldNames(), 231 minibatchwise_use_function = self.minibatchwise_use_functions(input_dataset.fieldNames(),
232 output_fieldnames, 232 output_fieldnames,
233 test_stats_collector) 233 test_stats_collector)
234 virtual_output_dataset = ApplyFunctionDataSet(input_dataset, 234 virtual_output_dataset = ApplyFunctionDataSet(input_dataset,
235 minibatchwise_use_function, 235 minibatchwise_use_function,
236 True,DataSet.numpy_vstack, 236 True,DataSet.numpy_vstack,
237 DataSet.numpy_hstack) 237 DataSet.numpy_hstack)
238 # actually force the computation 238 # actually force the computation