spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbtsai <...@git.apache.org>
Subject [GitHub] spark pull request: Initialized the regVal for first iteration in ...
Date Sat, 01 Mar 2014 02:24:39 GMT
Github user dbtsai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/40#discussion_r10188617
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/optimization/GradientDescent.scala
---
    @@ -149,7 +149,14 @@ object GradientDescent extends Logging {
     
         // Initialize weights as a column vector
         var weights = new DoubleMatrix(initialWeights.length, 1, initialWeights:_*)
    -    var regVal = 0.0
    +
    +    /**
    +     * For the first iteration, the regVal will be initialized as sum of sqrt of
    +     * weights if it's L2 update; for L1 update; the same logic is followed.
    +     */
    +    var regVal = updater.compute(
    --- End diff --
    
    Cool. Changed as you suggested.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message