21.1 Simple Feedforward Networks
Feedforward networks pass inputs through weighted layers and nonlinear activations. Hidden units allow them to represent patterns beyond a single linear decision boundary.
AI · DEEP LEARNING
Deep learning composes layers of differentiable computation to learn useful representations. Backpropagation efficiently computes how each parameter contributes to prediction error.
Feedforward networks pass inputs through weighted layers and nonlinear activations. Hidden units allow them to represent patterns beyond a single linear decision boundary.
A computation graph represents a model as operations on values. The chain rule propagates derivatives backward to calculate gradients for learning.
Convolutions reuse local filters across an input, exploiting spatial structure in images and reducing the number of independent parameters.
Gradient-based optimizers update parameters to reduce a loss. Mini-batches, learning rates, initialization, and normalization affect training behavior.
Training accuracy alone does not ensure performance on new data. Validation, regularization, and appropriate data splits help measure and improve generalization.
Recurrent networks reuse a state update across sequences, allowing context from earlier inputs to influence later predictions.
Unsupervised objectives learn from structure without labels; transfer learning adapts representations learned on one task to another.
Deep networks support perception, language, and control, while their data needs, compute costs, and failure modes call for careful evaluation.
Single-example trace: with input (1,0), compute h₁=tanh(a₁+b₁₀), h₂=tanh(a₂+b₂₀), then o=sigmoid(v₁h₁+v₂h₂+c). Compare o with target 1; propagate error d=o−1 backward through tanh derivatives (1−h²), then update weights. Training repeats this online update over the four examples for each of 500 epochs. The order and initial weights are fixed; 500 epochs do not guarantee perfect XOR classification.
Train a tiny neural network
A 2–2–1 tanh/sigmoid network learns four labeled examples with backpropagation and gradient descent.
inputs
hidden tanh
sigmoid
Choose an input; train to update network weights.
Let E be epochs (500), m the training examples (4), and P the network's trainable parameters (9). One forward/backward online update costs O(P) for this fully connected network, so training takes O(EmP) time; rendering the four-example mean loss is O(mP). Here E, m, and P are fixed, so the click is bounded constant work in the specific page. The model parameters occupy O(P) space; extra per-example activations and working values are O(U), where U is hidden-unit count (2 here). Thus auxiliary space excluding model and data is O(U)=O(1) for this fixed network; visualization adds O(1) elements. This describes arithmetic operation growth, not wall-clock timing or a convergence guarantee.