lib/torch/optim/adamax.rb in torch-rb-0.4.2 vs lib/torch/optim/adamax.rb in torch-rb-0.5.0
- old
+ new
@@ -55,10 +55,10 @@
Torch.max(norm_buf, 0, keepdim: false, out: [exp_inf, exp_inf.new.long])
bias_correction = 1 - beta1 ** state[:step]
clr = group[:lr] / bias_correction
- p.data.addcdiv!(-clr, exp_avg, exp_inf)
+ p.data.addcdiv!(exp_avg, exp_inf, value: -clr)
end
end
loss
end