lib/torch/optim/adamax.rb in torch-rb-0.3.7 vs lib/torch/optim/adamax.rb in torch-rb-0.4.0
- old
+ new
@@ -44,10 +44,10 @@
if group[:weight_decay] != 0
grad = grad.add(group[:weight_decay], p.data)
end
# Update biased first moment estimate.
- exp_avg.mul!(beta1).add!(1 - beta1, grad)
+ exp_avg.mul!(beta1).add!(grad, alpha: 1 - beta1)
# Update the exponentially weighted infinity norm.
norm_buf = Torch.cat([
exp_inf.mul!(beta2).unsqueeze(0),
grad.abs.add!(eps).unsqueeze!(0)
], 0)