Github user MLnick commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18305#discussion_r125026593
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/optim/loss/RDDLossFunction.scala ---
    @@ -62,8 +62,8 @@ private[ml] class RDDLossFunction[
         val newAgg = instances.treeAggregate(thisAgg)(seqOp, combOp, 
aggregationDepth)
         val gradient = newAgg.gradient
         val regLoss = regularization.map { regFun =>
    -      val (regLoss, regGradient) = regFun.calculate(coefficients.data)
    -      BLAS.axpy(1.0, Vectors.dense(regGradient), gradient)
    +      val (regLoss, regGradient) = 
regFun.calculate(Vectors.fromBreeze(coefficients))
    --- End diff --
    
    Yeah, more or less - see how Breeze does L2 reg in 
`DiffFunction.withL2Regularization`


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to