-
- Downloads
Initialized the regVal for first iteration in SGD optimizer
Ported from https://github.com/apache/incubator-spark/pull/633 In runMiniBatchSGD, the regVal (for 1st iter) should be initialized as sum of sqrt of weights if it's L2 update; for L1 update, the same logic is followed. It maybe not be important here for SGD since the updater doesn't take the loss as parameter to find the new weights. But it will give us the correct history of loss. However, for LBFGS optimizer we implemented, the correct loss with regVal is crucial to find the new weights. Author: DB Tsai <dbtsai@alpinenow.com> Closes #40 from dbtsai/dbtsai-smallRegValFix and squashes the following commits: 77d47da [DB Tsai] In runMiniBatchSGD, the regVal (for 1st iter) should be initialized as sum of sqrt of weights if it's L2 update; for L1 update, the same logic is followed.
Showing
- mllib/src/main/scala/org/apache/spark/mllib/optimization/GradientDescent.scala 7 additions, 1 deletion...org/apache/spark/mllib/optimization/GradientDescent.scala
- mllib/src/main/scala/org/apache/spark/mllib/optimization/Updater.scala 2 additions, 0 deletions...n/scala/org/apache/spark/mllib/optimization/Updater.scala
- mllib/src/test/scala/org/apache/spark/mllib/optimization/GradientDescentSuite.scala 41 additions, 0 deletions...pache/spark/mllib/optimization/GradientDescentSuite.scala
Loading
Please register or sign in to comment