repositories
/
TP_AA.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix TP3 exo2.
[TP_AA.git]
/
TP3
/
exo1
/
tp3_exo1.py
diff --git
a/TP3/exo1/tp3_exo1.py
b/TP3/exo1/tp3_exo1.py
index 02416ba46171c462dde7934537888c37661bdd3f..9efcb98968963696643b9dc30801c0a0f3d9b1a5 100755
(executable)
--- a/
TP3/exo1/tp3_exo1.py
+++ b/
TP3/exo1/tp3_exo1.py
@@
-52,10
+52,10
@@
def perceptron_nobias(X, Y):
classification_error = 1
while not classification_error == 0:
classification_error = 0
classification_error = 1
while not classification_error == 0:
classification_error = 0
- for
i in range(X.shape[0]
):
- if
Y[i] * np.dot(w, X[i]
) <= 0:
+ for
x, y in zip(X, Y
):
+ if
y * np.dot(w, x
) <= 0:
classification_error += 1
classification_error += 1
- w = w +
Y[i] * X[i]
+ w = w +
y * x
return w
return w