diff options
author | shivaram <shivaram.venkataraman@gmail.com> | 2013-07-30 10:27:54 -0700 |
---|---|---|
committer | shivaram <shivaram.venkataraman@gmail.com> | 2013-07-30 10:27:54 -0700 |
commit | 8aee11821673d4822dbc79bddd1da53696216108 (patch) | |
tree | ebc493bafb3706f88accb7f16791f8f3feb36474 | |
parent | 49be084ed3cca4778ff0602c0bee962a3515338e (diff) | |
parent | e4387ddf5d1a46dfedece73feff4de6a30f9a220 (diff) | |
download | spark-8aee11821673d4822dbc79bddd1da53696216108.tar.gz spark-8aee11821673d4822dbc79bddd1da53696216108.tar.bz2 spark-8aee11821673d4822dbc79bddd1da53696216108.zip |
Merge pull request #748 from atalwalkar/master
made SimpleUpdater consistent with other updaters
-rw-r--r-- | mllib/src/main/scala/spark/mllib/optimization/Updater.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mllib/src/main/scala/spark/mllib/optimization/Updater.scala b/mllib/src/main/scala/spark/mllib/optimization/Updater.scala index e916a92c33..bf506d2f24 100644 --- a/mllib/src/main/scala/spark/mllib/optimization/Updater.scala +++ b/mllib/src/main/scala/spark/mllib/optimization/Updater.scala @@ -41,7 +41,8 @@ abstract class Updater extends Serializable { class SimpleUpdater extends Updater { override def compute(weightsOld: DoubleMatrix, gradient: DoubleMatrix, stepSize: Double, iter: Int, regParam: Double): (DoubleMatrix, Double) = { - val normGradient = gradient.mul(stepSize / math.sqrt(iter)) + val thisIterStepSize = stepSize / math.sqrt(iter) + val normGradient = gradient.mul(thisIterStepSize) (weightsOld.sub(normGradient), 0) } } |