I thought it might be too, but doesn't look like it to me. Of course, I really have a hard time following vector and matrix math done in Java. Does v.minus(r) mean v - r or r - v?
On Wed, Nov 28, 2012 at 1:28 PM, David Arthur <[email protected]> wrote: > My completely unfounded guess would be the sign is built into gradientBase > > On Nov 28, 2012, at 2:19 PM, David Kincaid wrote: > > > While trying to wrap my head around the Mahout code for SGD I noticed > that > > the update to the beta terms seems to be doing gradient ascent and not > > descent. Could someone help me find the missing minus sign? > > > > The line of code in question from AbstractOnlineLogisticRegression.java, > > train() is: > > > > double newValue = beta.getQuick(i, j) + gradientBase * > learningRate > > * perTermLearningRate(j) * instance.get(j); > > > > It looks to me like the update to beta is ascending the gradient (hence > the > > addition sign instead of minus). Could you help me understand where my > > thinking is going wrong? > > > > Thanks, > > > > Dave > >
