made SimpleUpdater consistent with other updaters

This commit is contained in:
Ameet Talwalkar 2013-07-29 22:21:50 -07:00
parent 468a36c005
commit e4387ddf5d

View file

@ -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)
}
}