hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1397446 - /hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java
Date Fri, 12 Oct 2012 06:09:57 GMT
Author: tommaso
Date: Fri Oct 12 06:09:56 2012
New Revision: 1397446

URL: http://svn.apache.org/viewvc?rev=1397446&view=rev
Log:
[HAMA-651] - added a couple of TODOs

Modified:
    hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java

Modified: hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java
URL: http://svn.apache.org/viewvc/hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java?rev=1397446&r1=1397445&r2=1397446&view=diff
==============================================================================
--- hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java (original)
+++ hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java Fri
Oct 12 06:09:56 2012
@@ -104,7 +104,7 @@ public class GradientDescentBSP extends 
         numRead += costResult.getVector().get(1);
       }
 
-      totalCost /= numRead;
+      totalCost /= numRead; // TODO : remove this and incorporate the 1/m element in RegressionModel#calculateCostForItem
 
       if (cost - totalCost < 0) {
         throw new RuntimeException("gradient descent failed to converge with alpha " + alpha);
@@ -123,7 +123,9 @@ public class GradientDescentBSP extends 
 
       peer.sync();
 
-      peer.reopenInput();
+      if (master) { // TODO : check if this has to be done only by the master
+        peer.reopenInput();
+      }
 
       double[] thetaDelta = new double[theta.getLength()];
 



Mime
View raw message