Skip to content

Commit 346f498

Browse files
committed
Port "Stopping conditon of dual CD method for L1- and L2-loss SVM is changed"
Ported from cjlin1/liblinear@475dfdb
1 parent d73b958 commit 346f498

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/de/bwaldvogel/liblinear/Linear.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,8 @@ private static int solve_l2r_l1l2_svc(Problem prob, Parameter param, double[] w,
746746
if (iter % 10 == 0)
747747
info(".");
748748

749-
if (PGmax_new - PGmin_new <= eps) {
749+
if (PGmax_new - PGmin_new <= eps &&
750+
Math.abs(PGmax_new) <= eps && Math.abs(PGmin_new) <= eps) {
750751
if (active_size == l)
751752
break;
752753
else {

0 commit comments

Comments
 (0)