Computation Graph — Micrograd
Interactive DAG for loss = (w·x − y)². Drag the w slider; watch values and gradients update live. Enable Animate Backprop to see the gradient flow direction.
0.5
Show Gradients
Animate Backprop
Loss = 4.0000
Optimal w = 1.5 (y/x = 3/2)
One GD step (lr=0.1):
w → w − lr·∇ = 0.500 − 0.1×(-8.000) = 1.300
Forward pass
Backward pass (gradients)
val= forward value
∇= ∂loss/∂node
Hover any node for details. Drag w toward 1.5 to minimise loss. At w = 1.5, w·x = 1.5·2 = 3 = y, so loss = 0.