πͺ£ Gradient Accumulation Visualizer
Every weight has a bucket underneath it. Backward passes fill it. Only zero_grad() empties it.
π How To Use This Lab
Next Step βΆ
β
runs one backward pass β a gradient droplet falls into each weight's bucket.
β‘ optimizer.step()
β
updates every weight using its bucket's current total β
the bucket stays full!
π§Ή zero_grad()
β
the only action that actually empties the buckets back to zero.
βΊ Reset
β
clears everything back to batch 0 with fresh starting weights.
Buckett
β Previous Step
Next Step βΆ (backward)
Auto Run βΆβΆ
βΊ Reset
β‘ optimizer.step()
π§Ή zero_grad()
π€ BUCKETT
Press Next Step to run a backward pass β watch a gradient droplet land in every bucket.
π§βπ« PROF. TORCH
Gradients accumulate by default in PyTorch. Forgetting zero_grad() is one of the most common real training bugs.