hama-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tommaso Teofili <tomm...@apache.org>
Subject Re: svn commit: r1397446 - /hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java
Date Fri, 12 Oct 2012 07:15:08 GMT
thanks, nice suggestions :)
Tommaso

2012/10/12 Thomas Jungblut <thomas.jungblut@gmail.com>

> You need to reopen the input on every peer in your case ;)
> To get M you can loop over the data in setup and then reopen again and
> exchange the numbers via messaging.
>
> GL!
>
> 2012/10/12 <tommaso@apache.org>
>
> > 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message