TP3: print perceptron errors.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 14 Nov 2018 13:19:11 +0000 (14:19 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 14 Nov 2018 13:19:11 +0000 (14:19 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
TP3/exo1/tp3_exo1.py
TP3/exo2/tp3_exo2.py

index 9efcb98968963696643b9dc30801c0a0f3d9b1a5..57312f2cce03a9af40692e3df7210057dc9f5186 100755 (executable)
@@ -56,6 +56,7 @@ def perceptron_nobias(X, Y):
             if y * np.dot(w, x) <= 0:
                 classification_error += 1
                 w = w + y * x
+        print(classification_error)
     return w
 
 
index 63179871840e06d636fa96e0d08ff9db7dee6bff..b97c6ea4df6424608316272322dc3840da29428f 100755 (executable)
@@ -78,6 +78,7 @@ def perceptron_nobias(X, Y):
             if y * np.dot(w, x) <= 0:
                 classification_error += 1
                 w = w + y * x
+        print(classification_error)
     return w