From: Jérôme Benoit Date: Wed, 14 Nov 2018 13:19:11 +0000 (+0100) Subject: TP3: print perceptron errors. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=df0a762f5ec979cb0953ac13c2c92ebbea66f6d9;p=TP_AA.git TP3: print perceptron errors. Signed-off-by: Jérôme Benoit --- diff --git a/TP3/exo1/tp3_exo1.py b/TP3/exo1/tp3_exo1.py index 9efcb98..57312f2 100755 --- a/TP3/exo1/tp3_exo1.py +++ b/TP3/exo1/tp3_exo1.py @@ -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 diff --git a/TP3/exo2/tp3_exo2.py b/TP3/exo2/tp3_exo2.py index 6317987..b97c6ea 100755 --- a/TP3/exo2/tp3_exo2.py +++ b/TP3/exo2/tp3_exo2.py @@ -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