com.thoughtworks.deeplearning.double.optimizers.L2Regularization.scala Maven / Gradle / Ivy
The newest version!
package com.thoughtworks.deeplearning.double.optimizers
/**
* @author 杨博 (Yang Bo) <[email protected]>
*/
trait L2Regularization extends LearningRate {
protected def l2Regularization: scala.Double
override def updateDouble(oldValue: Double, delta: Double): Double = {
super.updateDouble(oldValue, delta) - l2Regularization * oldValue * currentLearningRate()
}
}