diff 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
line wrap: on
line diff
--- 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