requires_grad and the Computation Graph
Track operations to differentiate them.
Calculus, Handled For You
Training needs derivatives, but you never compute them by hand. PyTorch's autograd watches your math and works out every gradient for you. 🤖
Tensors Can Track Themselves
A tensor only earns gradients when you ask. Set requires_grad to true and PyTorch starts recording every operation done to it.
x = torch.tensor(2.0, requires_grad=True)All lessons in this course
- requires_grad and the Computation Graph
- Call backward() to Get Gradients
- Reading and Zeroing .grad
- torch.no_grad() for Inference