```python
import numpy as np
D = adam_effective_steps(np.full((5, 1), 0.3), alpha=0.01)
print([round(float(x), 6) for x in D[:, 0]])
```
Output:
[0.01, 0.01, 0.01, 0.01, 0.01]
Reasoning:
The gradient is the same 0.3 at every step, so after bias correction the first-moment estimate equals 0.3 and the second-moment estimate equals 0.09. Their ratio is 1, and every step has size exactly alpha = 0.01, whatever the gradient's size.
Adam's paper argues that its parameter steps have a predictable size: about α when the gradient is consistent, smaller when it is noisy, never much larger than a known bound, and unchanged when every gradient is multiplied by a constant. Measure that effective step on a stream of gradients, and compute the paper's bound.
grads: array of shape (T, d); row t−1 is the gradient gt at timestep t=1,…,T.
Returns a float array of shape (T, d) whose row t−1 is the signed effective step
Δt=αv^tm^t,
with m0=v0=0, mt=β1mt−1+(1−β1)gt, vt=β2vt−1+(1−β2)gt2, m^t=mt/(1−β1t) and v^t=vt/(1−β2t), all element-wise. There is no ϵ here. The ratio m^t/v^t is what the paper calls the signal-to-noise ratio (SNR).
step_bound(alpha, beta1, beta2) -> float
Returns the paper's upper bound on ∣Δt∣: α(1−β1)/1−β2 when (1−β1)>1−β2, and α otherwise.
Notes
A coordinate whose gradients so far have all been exactly 0 has v^t=0; its step is 0 (not NaN).
The parameter update itself would subtract Δt; you only report it.