Skip to content
Snippets Groups Projects
Commit e4387ddf authored by Ameet Talwalkar's avatar Ameet Talwalkar
Browse files

made SimpleUpdater consistent with other updaters

parent 468a36c0
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,8 @@ abstract class Updater extends Serializable { ...@@ -41,7 +41,8 @@ abstract class Updater extends Serializable {
class SimpleUpdater extends Updater { class SimpleUpdater extends Updater {
override def compute(weightsOld: DoubleMatrix, gradient: DoubleMatrix, override def compute(weightsOld: DoubleMatrix, gradient: DoubleMatrix,
stepSize: Double, iter: Int, regParam: Double): (DoubleMatrix, Double) = { 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) (weightsOld.sub(normGradient), 0)
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment