Sophia (Liu et al., 2023) uses a diagonal Hessian estimate to set a per-coordinate step size, then clips each coordinate's step to a fixed range. The clip bounds the worst-case step even where the curvature estimate is poor.
Implement sophia_step(m, h, gamma, eps), the Hessian-scaled momentum step with per-entry clipping.
Divide the momentum by the larger of gamma times the Hessian and eps, then clip to minus one and one.
No results yet
Run your code to check it against the examples, or submit to run every test.