Adam constructor
Adam(})
Implementation
Adam(
this.params, {
this.lr = 0.001,
this.beta1 = 0.9,
this.beta2 = 0.999,
this.eps = 1e-8,
this.gradClip = 1.0,
}) {
for (var p in params) {
// Initialize moments with zeros on GPU.
m.add(Tensor.zeros(p.shape));
v.add(Tensor.zeros(p.shape));
}
}