Basics
In the Introduction, we saw how machine learning replaces hand-written rules with parameterized programs that learn directly from examples. Suppose you are handed tens of thousands of small grayscale photographs of clothing and asked to build a system that identifies whether each image shows a T-shirt, a sneaker, a coat, or a handbag. No programmer knows how to write explicit if–else rules that map raw pixel intensities to clothing categories reliably. Yet by the end of the first three chapters of this part, you will have built and trained a working classifier that does exactly that—and by the end of the part, you will have progressed to deep convolutional networks that recognize complex visual scenes and recurrent networks that learn to generate English prose from scratch.
Our approach throughout Basics is guided by a simple principle: to truly understand deep learning, you should build its core mechanisms with your own hands before relying on black-box library calls. Across these eight chapters, we implement nearly every foundational model, layer, loss function, and optimizer twice: first from scratch, relying only on basic tensor arithmetic and automatic differentiation so that every mathematical operation is visible in code, and then concisely, using the high-level abstractions of modern deep learning frameworks (PyTorch, JAX, TensorFlow, and MXNet). Once you have seen how a component works from the ground up, we use its concise framework implementation as a building block in later chapters.
The eight chapters of this part unfold in three stages:
The Toolkit and the Core Recipe (1 Preliminaries to 3 Linear Classification). We begin on models simple enough to analyze completely. 1 Preliminaries equips you with the essential working tools of deep learning: storing and manipulating data in multidimensional arrays (tensors), preprocessing tabular data, applying linear algebra and calculus in code, computing derivatives automatically via autograd, and reasoning about uncertainty with probability. 2 Linear Regression and 3 Linear Classification then introduce the universal training loop of machine learning on linear models. In 2 Linear Regression, we fit continuous targets with linear regression, squared-error loss, and minibatch stochastic gradient descent, and confront the central statistical challenge of generalization—why fitting our training data too closely leads to overfitting, and how regularization methods such as weight decay keep models honest. In 3 Linear Classification, we turn from continuous numbers to discrete categories, developing softmax regression and cross-entropy loss to classify clothing photographs on the Fashion-MNIST benchmark, while examining how deployed classifiers behave when the real-world data distribution shifts away from the training set.
Going Deep and Mastering the Software Engine (4 Multilayer Perceptrons to 5 Computation). Linear models can only draw flat decision boundaries between classes. 4 Multilayer Perceptrons breaks through that limitation by stacking hidden layers of units equipped with nonlinear activation functions to create multilayer perceptrons (MLPs). We trace how signals and gradients flow forward and backward through a deep network via backpropagation, explore why deep networks can suffer from vanishing or exploding gradients if initialized carelessly, and introduce dropout as a powerful regularizer for high-capacity networks. 5 Computation then opens up the software architecture of modern deep learning frameworks: how complex networks are assembled from reusable modular blocks, how parameters are shared, inspected, and initialized, how custom layers and forward passes are defined, how trained weights are saved and loaded, and how computations are moved onto GPUs.
Building Domain Structure into the Architecture (6 Convolutional Neural Networks to 8 Sequence Models). Fully connected networks treat every input feature symmetrically, ignoring whether the inputs are pixels arranged on a two-dimensional image grid or words arranged in a sequential sentence. The final three chapters show how encoding the natural symmetries of the data directly into the network architecture leads to dramatic gains in statistical and computational efficiency. For images, 6 Convolutional Neural Networks develops convolutional neural networks (CNNs) from the principles of translation invariance and spatial locality, introducing padding, striding, multiple input/output channels, and pooling to build the classic LeNet architecture. 7 Modern Convolutional Neural Networks then traces the architectural milestones that carried computer vision into the modern era: AlexNet, repeatable block design (VGG), \(1\times 1\) convolutions (NiN), multi-branch parallel blocks (GoogLeNet), batch normalization, residual connections (ResNet), and DenseNet, culminating in principled architecture design spaces (AnyNet and RegNet). Finally, 8 Sequence Models turns to sequential data such as text and time series, developing autoregressive language modeling, tokenization, recurrent neural networks (RNNs), backpropagation through time, and the classical gated architectures—Gated Recurrent Units (GRUs), Long Short-Term Memory (LSTM) networks, deep stacked RNNs, and bidirectional RNNs—all tested by training a character-level language model to generate new passages in the style of H. G. Wells’s The Time Machine.
The first five chapters (1 Preliminaries through 5 Computation) form a sequential spine and are best read in order. Once you have completed them, the computer vision chapters (6 Convolutional Neural Networks and 7 Modern Convolutional Neural Networks) and the sequence modeling chapter (8 Sequence Models) do not depend on one another and can be studied in either order. Together, they establish the conceptual and engineering habits that the Advanced part builds upon.