Skip to content

Commit d09e5cc

Browse files
committed
Corrected mini convergence but broke the implementation
1 parent 9aca10c commit d09e5cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mini_batch.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function kmeans!(alg::MiniBatch, X, k;
8080
end
8181

8282
# TODO: Check for early stopping convergence
83-
if (niters > 1) & abs((J - J_previous) < (tol * J))
83+
if (niters > 1) & (abs(J - J_previous) < (tol * J))
8484
counter += 1
8585

8686
# Declare convergence if max_no_improvement criterion is met
@@ -103,6 +103,8 @@ function kmeans!(alg::MiniBatch, X, k;
103103
J = sum_of_squares(X, final_labels, centroids) # just a placeholder for now
104104
break
105105
end
106+
else
107+
counter = 0
106108

107109
end
108110

0 commit comments

Comments
 (0)