Adam's L2 regularization adds the decay term to the gradient, so it is rescaled by the adaptive denominator. AdamW (Loshchilov & Hutter, 2017) applies decay directly to the weights, which restores the regularization meaning.
Implement adamw_update(w, m_hat, v_hat, lr, wd, eps), the Adam step plus a decoupled decay term.
Compute the Adam direction, then subtract lr times wd times the current weights.
No results yet
Run your code to check it against the examples, or submit to run every test.