Adam adapts learning rates per parameter using first and second moment estimates. Adamax is a variant that replaces the L2-norm-based second moment with an L-infinity norm operation.
Instead of dividing by sqrt(v), Adamax divides by the maximum of all past absolute gradients seen.
The updates are:
mnew=β1⋅m+(1−β1)⋅grad unew=max(β2⋅u,∣grad∣) paramnew=param−lr⋅unew+epsmnewWhere:
Implement:
adamax_step(
param,
grad,
m,
u,
lr,
beta1,
beta2,
eps,
)
The function returns:
(new_param, new_m, new_u)
The signature is provided in the editor.
First update the first moment estimate. Then update the infinity norm. Finally, compute the scaled update using both.
Compute m_new first as an exponential moving average of the gradient.
Compute u_new as the element-wise maximum of beta2 * u and the absolute gradient.
After computing m_new and u_new, scale the parameter update by m_new divided by (u_new + eps).
No results yet
Run your code to check it against the examples, or submit to run every test.