Mercurial > ift6266
diff baseline/mlp/mlp_nist.py @ 408:0580b310dadb
merge
author | Xavier Glorot <glorotxa@iro.umontreal.ca> |
---|---|
date | Wed, 28 Apr 2010 14:35:30 -0400 |
parents | 195f95c3d461 |
children | 3dba84c0fbc1 |
line wrap: on
line diff
--- a/baseline/mlp/mlp_nist.py Wed Apr 28 14:35:01 2010 -0400 +++ b/baseline/mlp/mlp_nist.py Wed Apr 28 14:35:30 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