← Projectstensor-autograd / L2Matmul + Broadcasting~22 min
one move: preserve an invariant
Extend the one-variable optimizer to a two-dimensional surface f(x,y)=x²+y². Return every point so convergence can be inspected axis by axis. In the Tensor/Autograd Engine system, implement this level as a deterministic contract before composing it with the next service.
Required API
def gradient_descent_2d(x, y, learning_rate, steps):
return [[step, x, y, loss], ...]
Behavior
record the starting point before updating
update both coordinates using their partial derivatives
record the joint loss after every update
Examples — tap to reveal
Constraints
Use only the Python standard library.
Return deterministic values so every run can be compared with the contract.