comparison baseline/mlp/mlp_nist.py @ 405:195f95c3d461

corrected bug where we inverted min and maj
author xaviermuller
date Wed, 28 Apr 2010 12:59:29 -0400
parents 1509b9bba4cc
children 3dba84c0fbc1
comparison
equal deleted inserted replaced
404:1509b9bba4cc 405:195f95c3d461
239 if(wanted_class>9): 239 if(wanted_class>9):
240 char_exemple_count=char_exemple_count + 1 240 char_exemple_count=char_exemple_count + 1
241 predicted_class=numpy.argmax(a1_out[10:62])+10 241 predicted_class=numpy.argmax(a1_out[10:62])+10
242 if((predicted_class!=wanted_class) and ((predicted_class+26)!=wanted_class) and ((predicted_class-26)!=wanted_class)): 242 if((predicted_class!=wanted_class) and ((predicted_class+26)!=wanted_class) and ((predicted_class-26)!=wanted_class)):
243 char_error_count = char_error_count +1 243 char_error_count = char_error_count +1
244
245 #minuscule
246 if(wanted_class>9 and wanted_class<36):
247 maj_exemple_count=maj_exemple_count + 1
248 predicted_class=numpy.argmax(a1_out[10:35])+10
249 if(predicted_class!=wanted_class):
250 maj_error_count = maj_error_count +1
251 #majuscule
252 if(wanted_class>35):
253 min_exemple_count=min_exemple_count + 1
254 predicted_class=numpy.argmax(a1_out[36:62])+36
255 if(predicted_class!=wanted_class):
256 min_error_count = min_error_count +1
244 257
245 258
246 259
247 print (('total error = %f') % ((total_error_count/total_exemple_count)*100.0)) 260 print (('total error = %f') % ((total_error_count/total_exemple_count)*100.0))
248 print (('number error = %f') % ((nb_error_count/nb_exemple_count)*100.0)) 261 print (('number error = %f') % ((nb_error_count/nb_exemple_count)*100.0))
249 print (('char error = %f') % ((char_error_count/char_exemple_count)*100.0)) 262 print (('char error = %f') % ((char_error_count/char_exemple_count)*100.0))
263 print (('min error = %f') % ((min_error_count/min_exemple_count)*100.0))
264 print (('maj error = %f') % ((maj_error_count/maj_exemple_count)*100.0))
250 return (total_error_count/total_exemple_count)*100.0 265 return (total_error_count/total_exemple_count)*100.0
251 266
252 267
253 268
254 269