lib/torch/optim/asgd.rb in torch-rb-0.3.7 vs lib/torch/optim/asgd.rb in torch-rb-0.4.0
- old
+ new
@@ -41,10 +41,10 @@
# decay term
p.data.mul!(1 - group[:lambd] * state[:eta])
# update parameter
- p.data.add!(-state[:eta], grad)
+ p.data.add!(grad, alpha: -state[:eta])
# averaging
if state[:mu] != 1
state[:ax].add!(p.data.sub(state[:ax]).mul(state[:mu]))
else