Optimization 101 in PyTorch
摘要
Training is just negotiation: your model proposes parameters, the data pushes back, and the optimizer splits the difference – thousands of times – until they reach a workable truce. PyTorch’s defaults already carry you far, but a little mechanical sympathy goes a long way. This chapter keeps things hands-on: how autograd builds and breaks graphs, how to write stable custom losses, where schedulers actually help, what regularization buys you, and how to mix precision and stop early without fooling yourself.