Repository: incubator-systemml
Updated Branches:
  refs/heads/master 468a366bd -> 9165fbc5d


stop training if descent direction is 0 vector (for toy data)

Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/9165fbc5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/9165fbc5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/9165fbc5

Branch: refs/heads/master
Commit: 9165fbc5d0c041d0639baa081fdd9347c7add627
Parents: 468a366
Author: prithvirajsen <s...@us.ibm.com>
Authored: Fri Apr 22 10:48:42 2016 -0700
Committer: prithvirajsen <s...@us.ibm.com>
Committed: Fri Apr 22 10:48:42 2016 -0700

----------------------------------------------------------------------
 scripts/algorithms/l2-svm-predict.dml | 2 +-
 scripts/algorithms/l2-svm.dml         | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/9165fbc5/scripts/algorithms/l2-svm-predict.dml
----------------------------------------------------------------------
diff --git a/scripts/algorithms/l2-svm-predict.dml 
b/scripts/algorithms/l2-svm-predict.dml
index 3202792..e91f46c 100644
--- a/scripts/algorithms/l2-svm-predict.dml
+++ b/scripts/algorithms/l2-svm-predict.dml
@@ -64,7 +64,7 @@ if(cmdLine_scores != " ")
 if(cmdLine_Y != " "){
        y = read(cmdLine_Y)
 
-       pred = ppred(scores, 0, ">")
+       pred = ppred(scores, 0, ">=")
        pred_labels = pred*positive_label + (1-pred)*negative_label
        num_correct = sum(ppred(pred_labels, y, "=="))
        acc = 100*num_correct/nrow(X)

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/9165fbc5/scripts/algorithms/l2-svm.dml
----------------------------------------------------------------------
diff --git a/scripts/algorithms/l2-svm.dml b/scripts/algorithms/l2-svm.dml
index 140ac5a..d6efbec 100644
--- a/scripts/algorithms/l2-svm.dml
+++ b/scripts/algorithms/l2-svm.dml
@@ -144,6 +144,10 @@ while(continue == 1 & iter < maxiterations)  {
     s = be * s + g_new
     g_old = g_new
 
+       if(sum(s^2) == 0){
+           continue = 0
+       }
+
     iter = iter + 1
 }
 

Reply via email to