The spelled-out intro to neural networks and backpropagation: building micrograd
Andrej KarpathyYouTube ↗
Further reading 2
Why do tests pass when the program is wrong? →Gary Bernhardt’s isolated tests and Andrej Karpathy’s neural network both deliver good news when the code is wrong.How does a network change after a wrong answer? →Forward propagation computes a prediction. In micrograd, a loss and its gradients connect that prediction to the next parameter update.
Caption notes
Build automatic differentiation from scalar operations, apply the chain rule backward and train a small classifier. Reusing accumulated gradients reveals why training loops clear them.
Original passages · 6
back propagation is is just a recursive application of chain rule backwards through the computation graphwe have to accumulate these gradients these gradients addthese gradients just add up and they never get reset to zeroyou may have lots of bugs in the code and uh your network might actually workefficiently evaluate the gradient of some kind of a loss functionchanging this variable is not changing the loss function