# HG changeset patch # User xaviermuller # Date 1272473969 14400 # Node ID 195f95c3d4617ef5129bf782fa2e9e9a99872996 # Parent 1509b9bba4cc35de538e4041bfc6e9b11d20f6ff corrected bug where we inverted min and maj diff -r 1509b9bba4cc -r 195f95c3d461 baseline/mlp/mlp_nist.py --- a/baseline/mlp/mlp_nist.py Wed Apr 28 11:45:14 2010 -0400 +++ b/baseline/mlp/mlp_nist.py Wed Apr 28 12:59:29 2010 -0400 @@ -241,12 +241,27 @@ predicted_class=numpy.argmax(a1_out[10:62])+10 if((predicted_class!=wanted_class) and ((predicted_class+26)!=wanted_class) and ((predicted_class-26)!=wanted_class)): char_error_count = char_error_count +1 + + #minuscule + if(wanted_class>9 and wanted_class<36): + maj_exemple_count=maj_exemple_count + 1 + predicted_class=numpy.argmax(a1_out[10:35])+10 + if(predicted_class!=wanted_class): + maj_error_count = maj_error_count +1 + #majuscule + if(wanted_class>35): + min_exemple_count=min_exemple_count + 1 + predicted_class=numpy.argmax(a1_out[36:62])+36 + if(predicted_class!=wanted_class): + min_error_count = min_error_count +1 print (('total error = %f') % ((total_error_count/total_exemple_count)*100.0)) print (('number error = %f') % ((nb_error_count/nb_exemple_count)*100.0)) print (('char error = %f') % ((char_error_count/char_exemple_count)*100.0)) + print (('min error = %f') % ((min_error_count/min_exemple_count)*100.0)) + print (('maj error = %f') % ((maj_error_count/maj_exemple_count)*100.0)) return (total_error_count/total_exemple_count)*100.0