Adam applies the decay outside the adaptive 1/sqrt(v) scaling, so
parameters with a large gradient history are not decayed less. Supply
theta or the step reduces to plain Adam.
Usage
morie_adamw_step(
g,
beta1 = 0.9,
beta2 = 0.999,
lr = 0.001,
wd = 0.01,
eps = 1e-08,
theta = NULL,
state = NULL
)Examples
round(morie_adamw_step(0, lr = 0.1, wd = 0.5, theta = 2)$update, 6)
#> [1] -0.1
