GitHub user dbtsai opened a pull request: https://github.com/apache/spark/pull/40
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. You can merge this pull request into a Git repository by running: $ git pull https://github.com/AlpineNow/spark dbtsai-smallRegValFix Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/40.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #40 ---- commit 9d2670330ebcde4240d97f0f51d7cfbc71509780 Author: DB Tsai <dbt...@dbtsai.com> Date: 2014-02-22T10:59:00Z 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. commit 1c15cfebf8a130744ddea915dd457a8e4291bdfe Author: DB Tsai <dbt...@dbtsai.com> Date: 2014-02-25T22:02:12Z Added unittest for the change in runMiniBatchSGD commit 594a288acd91dd9b426d9327f2b8f4db828321d3 Author: DB Tsai <dbt...@dbtsai.com> Date: 2014-02-27T09:37:39Z Removed unnecessary parentheses, and fixed a typo. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---