Kaijing Ma

Paper Notes

Deep Learning

Paper Notes

Ian Goodfellow, Yoshua Bengio, Aaron Courville

MIT Press, 2016 · Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Official Chapter 5 HTML, with the note limited to its stated scope

Chapter 5 Machine Learning Basics, Part 1: from task definition to validation

This unit covers the Chapter 5 introduction and sections 5.1 to 5.3, including 5.1.1 to 5.1.4, 5.2.1 to 5.2.2 and 5.3.1. The page scope is printed pp. 96 to 119 and the complete paragraphs on p. 120 before the 5.4 heading. Algorithm 5.1 is read separately because this 5.3.1 algorithm floats onto p. 121. The 5.4 body on that page is excluded. Statistical estimation, maximum likelihood, Bayesian statistics and the remaining algorithms belong to later units. This record establishes neither Chapter 5 completion, whole book completion nor completion of a user reading pass.

The central question is how a program can use finite data to improve future task performance. A training objective provides computable feedback. The hypothesis space and regularization express inductive preferences. The validation protocol tests whether those preferences help on new examples. A closed form solution resolves a fitting problem. It does not by itself establish generalization.

Scope map. Source illustrations and original note derivations are identified separately.
LayerSourceAnalytical focus
Task, measure and experience5.1, pp. 97 to 105Consistency of the input, output, objective and data interface
A computable learning rule5.1.4, pp. 105 to 108Least squares, rank and intercept
Generalization and capacity5.2, pp. 108 to 116Sample dependence, model limitations and distribution assumptions
Preferences and selection5.2.2 to 5.3.1, pp. 116 to 120; Algorithm 5.1, p. 121Regularization, validation and cross validation

These are original explanations of the public source, rather than a paragraph by paragraph translation. Historical technology examples remain illustrations from the 2016 book. They do not establish current performance rankings. Added arithmetic, risk decompositions, operation counts and checklists are note analysis. The works cited by the chapter were not each read independently in this unit.

1 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Task T, performance P and experience E define the learning problem

Section 5.1, p. 97, uses Mitchell’s definition framework. T specifies what the system does. P specifies how success is measured. E specifies what the program may observe. Learning is the process that improves task ability. The task itself can be walking, classification or prediction. A lower training loss becomes meaningful task improvement only through its relationship to P and the future conditions of use.

Original comparison of T, P and E, based on 5.1 and 5.1.4.
ObjectLinear regression instancePotential confusion
TInput x and output a scalar prediction ŷTraining is not T itself
PMean squared error on new examplesThe training objective is a computable surrogate
EA collection of training examples with targets yTest targets are outside fitting experience
Model and algorithmThe family ŷ=wᵀx and a rule for selecting wA function family can be paired with different learning rules

An example is often represented by x∈ℝⁿ. Its features quantify properties of an object or event. That representation does not determine the task. The same image can support category prediction, missing pixel imputation or generative modeling. Task, data structure and supervision are different dimensions.

2 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

The task space extends beyond classification and regression

Section 5.1.1, pp. 98 to 101, gives an open set of task examples. It is neither an exclusive nor an exhaustive taxonomy. Structured output includes transcription and translation. Conditional generation can also produce structured output. The table connects the input and output interface to a key limitation.

Original task interface summary based on pp. 98 to 101. The 2ⁿ count enumerates missing subsets of n features. It does not require separately training 2ⁿ models.
TaskInput to outputKey property
ClassificationFeatures to one of k categories or a class distributionCategory codes do not express numerical magnitude
Classification with missing inputsObserved feature subset to a categoryn potentially missing features give 2ⁿ observation masks
RegressionFeatures to a real targetThe magnitude of an output error matters
Transcription and translationA perceptual signal to symbols; symbols to another sequenceLocal accuracy and entire sequence accuracy differ
Structured outputInput to several related outputsSegmentation, parse trees and captions impose internal constraints
Anomaly detectionEvents to an anomaly score or flagRarity must correspond to the application’s anomaly definition
Synthesis and samplingUnconditional or conditional sample generationOne input can have several acceptable outputs
Imputation and denoisingIncomplete or corrupted observations to missing values or clean objectsA value or a conditional distribution can be predicted
Density estimationExamples to a normalized probability modelDefining a distribution does not make conditional inference tractable

A joint probability model can in principle support several tasks through marginalization and conditioning. For example, the missing feature xᵢ has distribution p(xᵢ|x₋ᵢ) when the other features are observed. Normalization, marginalization, conditional sampling or exact probability evaluation can still be intractable. The source distinguishes a unified probability representation from computational feasibility.

3 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Performance P must express the intended behavior

Section 5.1.2, pp. 101 to 102, uses accuracy and error rate for discrete prediction and average log probability for density models. Accuracy is the proportion of correct examples. Error rate is average zero or one loss. A continuous density value is not an event probability. Exact equality accuracy is unsuitable for evaluating a density model.

ℓ₀₁(ŷ,y)=1{ŷ≠y}; accuracy=1−error rate. Average log score=(1/m)Σᵢ log p_model(x⁽ⁱ⁾).

Metric selection contains a design judgment. Entire sequence accuracy and character accuracy respond to different error structures. Squared loss emphasizes large errors more strongly than absolute loss. An ideal measure can also be computationally unavailable, requiring an approximation or an alternative. Whether that substitute preserves the application objective needs its own argument. Successful optimization does not supply it.

An added note distinction concerns the training objective, the validation selection measure and the final reported measure. They can differ, but that difference needs an explicit rationale. Repeated inspection of a test set lets it influence design. The overall selection process can adapt to the test sample even when no individual model directly fits its labels.

4 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Experience E, supervision and the data interface

Section 5.1.3, pp. 102 to 105, describes supervised learning as observing (x,y) and learning to predict y from x. Unsupervised learning extracts a distribution or useful structure from x. Clustering need not learn a complete density. A label can be a scalar, category or sequence. Semi supervised data mix labeled and unlabeled examples. Multi instance learning assigns a label to a group. Reinforcement learning involves feedback between the learner and its environment. This unit records that boundary only.

p(x)=∏ᵢ₌₁ⁿ p(xᵢ | x₁,…,xᵢ₋₁). [5.1]
p(y|x)=p(x,y)/Σᵧ′p(x,y′), for discrete y and p(x)>0. [5.2]

Equation 5.1 decomposes joint modeling into conditional prediction. Equation 5.2 turns a joint model into supervised prediction. Supervised and unsupervised learning therefore do not define disjoint mathematical objects. The note adds the discrete label and positive denominator conditions for 5.2. A continuous target requires the corresponding integral. The identity can hold while its computation remains difficult.

The design matrix X stores examples in rows and features in columns. The book’s Iris illustration has 150 examples, 4 measured features and 3 species labels, giving X∈ℝ¹⁵⁰×⁴. These dimensions describe the source example. No dataset was loaded or measured here. Images and sequences of varying size need not stack directly into one matrix. The collection notation {x⁽¹⁾,…,x⁽ᵐ⁾} does not require equal member lengths.

5 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Linear regression turns T, P and E into an objective

Section 5.1.4, pp. 105 to 107, uses x∈ℝⁿ and parameters w∈ℝⁿ to predict a real value. Each wᵢ specifies the linear prediction response to xᵢ while the other coordinates remain fixed. Weight magnitudes require feature units for comparison. Their signs alone do not establish causal effects. These last two qualifications are added note interpretation.

ŷ=wᵀx. [5.3]
MSE_test=(1/m_test)Σᵢ(ŷᵢ_test−yᵢ_test)²=(1/m_test)‖ŷ_test−y_test‖₂². [5.4, 5.5]

P concerns new example error, while E is the training set. Fitting first minimizes training MSE. In the derivation below, X and y denote training inputs and targets, and m is the training sample count. The test count is m_test. The two set sizes need not agree, so their denominators must remain distinct.

Source Figure 5.1。 The left panel shows the book’s 10 training points with one feature and a fitted line through the origin. The right panel plots the same training MSE against w₁. Its marked point is the normal equation solution. The figure establishes a minimum of the fitting objective. It contains no independent test performance. Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning, MIT Press, 2016, printed p. 107, official online edition. Official chapter. CC BY-NC-ND 4.0. The surrounding page is excluded. Figure content and labels are unchanged.
6 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

From squared residuals to the normal equations

Equations 5.6 to 5.12 differentiate with respect to the parameters. After expanding the squared norm, yᵀy is constant in w and XᵀX is symmetric. The gradient is therefore 2Xᵀ(Xw−y)/m. This objective is a convex quadratic, so a zero gradient gives a global minimum. That conclusion does not extend to a general nonconvex loss.

L(w)=‖Xw−y‖₂²/m=(wᵀXᵀXw−2wᵀXᵀy+yᵀy)/m.
∇L(w)=(2/m)Xᵀ(Xw−y); ∇²L(w)=(2/m)XᵀX ⪰0; XᵀXw=Xᵀy.
rank(X)=n ⇒ w*=(XᵀX)⁻¹Xᵀy. [5.12, with rank condition]

Equation 5.12 requires full column rank. Then m≥n and XᵀX is positive definite. The condition m≥n alone is insufficient because duplicate columns can still make the matrix singular. A rank deficient problem still has least squares solutions, but the parameters are not unique. The pseudoinverse gives the solution of minimum Euclidean norm. All solutions have identical fitted training predictions.

w*=X⁺y+v, v∈ker(X); Xw*=XX⁺y; Xᵀ(Xw*−y)=0.

An added numerical qualification concerns the inverse notation. It describes the solution without requiring an implementation to form an inverse. Forming the normal equations squares the spectral condition number of a full column rank X. QR or SVD can solve least squares directly and retain clearer rank information. Neither automatically improves statistical generalization.

7 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Intercept, bias and a checkable least squares example

ŷ=wᵀx+b=[wᵀ,b][xᵀ,1]ᵀ. [5.13]

On pp. 107 to 108, b makes the input mapping affine while the prediction remains linear in the complete parameter vector. A feature column fixed at 1 includes it in the same fitting rule. Here the bias parameter is the intercept. Statistical bias instead compares an estimator’s expectation with the true quantity. The terms describe different objects.

The following original two point example is separate from Figure 5.1. With no intercept, X=[1,2]ᵀ and y=[1,0]ᵀ give XᵀX=5, Xᵀy=1 and w*=1/5. The residual is orthogonal to the input: 1×(−4/5)+2×(2/5)=0. Individual training residuals are nevertheless nonzero.

Original worked example. Training MSE=(16/25+4/25)/2=2/5. All values are exact arithmetic, not measurements.
xyŷResidual ŷ−ySquared residual
111/5−4/516/25
202/52/54/25

Adding an intercept lets ŷ=2−x fit these two points with zero training error. This change establishes only that an expanded hypothesis space can lower the optimal error on this sample. It supplies no new example labels and cannot determine whether future predictions improve.

8 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Empirical risk, population risk and the generalization gap

Section 5.2, pp. 108 to 109, defines generalization through unseen inputs and discusses training and testing under a shared p_data. Independent identically distributed examples connect finite sample averages with population expectations. Independence and a common distribution are separate requirements. Overlapping examples, temporal dependence and a changed deployment distribution require additional treatment. The risk notation below formalizes the source discussion.

R(h)=E_(X,Y)∼p_data[ℓ(h(X),Y)]; R̂_S(h)=(1/m)Σᵢℓ(h(xᵢ),yᵢ); gap=R(ĥ_S)−R̂_S(ĥ_S).
R̂_train(w)=‖X_train w−y_train‖₂²/m_train; R̂_test(w)=‖X_test w−y_test‖₂²/m_test. [5.14 and following text]

For h fixed independently of the training sample, the same sampling mechanism gives E[R̂_train(h)]=E[R̂_test(h)]=R(h). A learned ĥ_S depends on S, changing the relationship to its training examples. If the test set remains independent after selection, E[R̂_test(ĥ_S)|S]=R(ĥ_S). A finite test mean still has sampling error.

The source describes expected test error as at least expected training error after learning. This note retains the empirical risk minimization context. The inequality below holds for exact empirical risk minimization in a fixed hypothesis space. It is not a guarantee for every algorithm or every random split. A regularized solution need not minimize the unpenalized training error.

ĥ_S∈argmin_(h∈H)R̂_S(h) ⇒ E_S R̂_S(ĥ_S) ≤ inf_(h∈H)R(h) ≤ E_S R(ĥ_S).

For each S, the empirical minimum is no greater than the empirical risk of any fixed h. Taking expectation and then the infimum over h proves the first inequality. Population risk is always at least the best risk in the same space, which proves the second. The argument explains why fixing a model before sampling differs from selecting it after sampling.

Exact empirical risk minimization is sufficient rather than necessary. Exact minimization of empirical risk plus a fixed, data independent penalty over the same fixed family also gives expected training error no greater than expected population error. Comparing solutions from independent training samples and taking expectations cancels the penalty terms. The sandwich inequality above concerns unpenalized ERM and does not directly apply to the penalized solution.

9 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Underfitting, overfitting and three aspects of capacity

Pages 109 to 112 identify two aims: low training error and a controlled generalization gap. Underfitting leaves training error too high. Overfitting creates an excessive gap between training and new example error. Low training error alone is insufficient. A small gap is also insufficient because a constant predictor can perform poorly on both sets.

Original comparison of capacity and selection rules, based on 5.2 and 5.2.2.
ConceptWhat it determinesWhat it does not establish
Hypothesis space HWhich functions may be selectedEqually large families need not suit the same task
Representational capacityThe functions expressible by the model familyThe optimizer will find the best function
Effective capacitySolutions the learning rule can reach or preferParameter count alone characterizes generalization
Regularization preferenceHow eligible functions are rankedA penalty helps on every distribution

Reducing complexity to parameter count confuses representation with algorithm behavior. Optimization failure can leave a large model with high training error. Families with the same parameter count can impose different geometric restrictions. Regularization can also make functions less likely to be selected without removing them from the family.

10 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Polynomial features show how capacity changes

ŷ₁=b+wx; ŷ₂=b+w₁x+w₂x²; ŷ₉=b+Σᵢ₌₁⁹wᵢxⁱ. [5.15, 5.16, 5.17]

The key distinction on p. 110 is linearity in the parameters. Adding x² or higher powers makes a function nonlinear in the raw input, while least squares can still fit its coefficients. A univariate polynomial of degree d has d+1 coefficients when it includes an intercept. Its design matrix contains power features. Rank conditions still matter despite the closed form notation.

Source Figure 5.2。 The book samples x and obtains y from a deterministic quadratic function. The linear model cannot express the curvature. The quadratic model matches the generating structure. The degree 9 model uses a pseudoinverse to interpolate, yet develops the wrong shape between observations and to their left. This noiseless synthetic example shows that zero training error does not uniquely determine a correct extension. Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning, MIT Press, 2016, printed p. 111, official online edition. Official chapter. CC BY-NC-ND 4.0. The surrounding page is excluded. Figure content and labels are unchanged.

The note interpretation concerns selection rather than expressibility. The higher degree model includes the true quadratic, but finite constraints admit many solutions and the selection rule does not recover the right structure. Failure of this particular pseudoinverse solution does not prove that every interpolating method must fail.

11 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

VC dimension, finite sample guarantees and their limits

Page 112 defines the VC dimension of a binary classifier through an existence statement. It is the largest m for which some set of m distinct inputs admits every binary labeling within the family. Every labeling must be realizable, but the point set need only exist. Every possible point set need not be shattered. VC dimension describes a function family rather than one fitted prediction vector.

The source gives a qualitative relationship. Higher capacity loosens bounds between training and population error, while more examples tighten them. It also notes that deep model bounds can be loose and that capacity and optimization restrictions are difficult to characterize. The following finite family bound is added note analysis. It shows explicitly how probability, loss range and sample count enter a guarantee. It is not an additional numbered theorem from the book.

For finite H, i.i.d. S, 0≤ℓ≤1 and 0<δ<1: Pr{sup_(h∈H)|R(h)−R̂_S(h)|≤√[log(2|H|/δ)/(2m)]}≥1−δ.

A bounded variable concentration bound for each fixed h, followed by a union bound over finite H, gives a simultaneous statement for the whole family. Its simultaneous nature permits later selection of h using S. An infinite family requires another complexity argument. Substituting an infinite |H| does not produce a useful bound. Unbounded squared loss also falls outside this statement.

Source Figure 5.3。 This is a qualitative capacity and error diagram. It contains no individual training runs or data points that can be treated as benchmark scores. The dashed training curve declines, the green population curve first declines and then rises, and the arrow marks the gap. The shape expresses the section’s typical tradeoff. It is not a required shape for every learning rule, sample size or model. Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning, MIT Press, 2016, printed p. 113, official online edition. Official chapter. CC BY-NC-ND 4.0. The surrounding page is excluded. Figure content and labels are unchanged.
12 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Nonparametric models need not be parameter free

Pages 113 to 114 define a parametric model through a finite parameter dimension fixed before the data are observed. Nonparametric models have no such fixed dimension restriction. A practical representation can grow with sample size. Nearest neighbor regression stores training X and y, finds the closest input at prediction time and returns its target. The distance metric itself expresses an inductive preference.

i*(x)∈argminᵢ‖Xᵢ,:−x‖₂²; ŷ(x)=yᵢ*(x). Equal nearest ties may be averaged.

If identical inputs have conflicting targets, a deterministic function cannot reproduce every target. Under squared loss, the optimal prediction at that repeated input is the target mean. The source statement that nearest neighbor reaches the minimum training error therefore uses averaging over all nearest ties. The minimum error can still exceed 0.

Original repeated input example. It shows why minimum training error need not be 0.
Identical input xTwo targetsOptimal shared predictionMean squared error
00, 211

An outer procedure that increases polynomial degree with data can turn a sequence of parametric models into a nonparametric learning process. The distinction concerns how complexity grows with experience. It does not concern whether the implementation stores numerical values.

13 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Bayes error depends on both information and loss

Page 114 considers an ideal predictor that knows the true data distribution. Error can remain when the target is stochastic given the observed input or relevant variables are omitted. Bayes error is the optimal population risk for the available information and loss. It is not a lower bound on the error of each finite training sample.

Squared loss: f*(x)=E[Y|X=x]; R(f)=E[Var(Y|X)]+E[(f(X)−E[Y|X])²]; R*=E[Var(Y|X)].
Classification with 0/1 loss: h*(x)∈argmax_c p(c|x); R*=E_X[1−max_c p(c|X)].

The squared loss decomposition assumes finite second moments. The conditional residual Y−E[Y|X] has zero expected cross term with any input measurable function, separating conditional variance from prediction deviation. Classification instead chooses a category with maximal posterior probability. Different losses therefore produce different optimal predictions and different Bayes errors.

More data cannot restore input information that was never recorded. Training error below Bayes error is also consistent because a learner can memorize random training labels. A fixed family with insufficient capacity can retain approximation error above Bayes risk even with many examples.

14 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Learning curves combine source evidence with idealized reasoning

Source Figure 5.4。 The source synthetic problem adds noise to a degree 5 polynomial. Each training size uses 40 training sets, the error bars show 95% confidence intervals, and the test set is fixed. The top panel compares a quadratic model with a model whose degree is chosen by test error. Both are fitted in closed form. The bottom panel shows the latter degree. This test based selection is an illustrative oracle comparison. It is not a valid deployment selection protocol. The section supplies neither a numeric table of plotted values nor a complete set of generation parameters. This note does not estimate values from the pixels. Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning, MIT Press, 2016, printed p. 115, official online edition. Official chapter. CC BY-NC-ND 4.0. The surrounding page is excluded. Figure content and labels are unchanged.

The source trend explains why small samples can be fitted unusually well. More data make the fitting problem harder while improving population estimation. The quadratic model eventually remains above the noise floor, while the appropriately selected family approaches it. The preferred capacity can also change with sample size.

The p. 114 statement that expected generalization error cannot increase with more examples needs an idealized interpretation. An optimal decision procedure with extra observations can ignore them, so the best attainable risk cannot worsen merely because information increased. An arbitrary fixed algorithm has no universal monotone learning curve. Optimization changes, instability and selection can produce local increases. Convergence of a nonparametric method to Bayes risk also requires consistency and distribution conditions. The name alone does not provide them.

15 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

No Free Lunch depends on the averaging scheme

Section 5.2.1, pp. 114 to 116, uses No Free Lunch to examine universal generalization. Under an unweighted task average with no preferred structure, no classifier dominates on unseen inputs. The source emphasizes that an algorithm can still be better on a structured family of real problems. Learnability requires assumptions or preferences about the generating process.

An added finite case makes the averaging explicit. The input set is finite, and the average is uniform over every binary labeling function. After observing labels at seen points, the label at each unseen point remains an independent fair bit. Any predictor using only training information therefore has expected error 1/2 there. A prior favoring smoothness or local correlation changes the crucial condition.

This does not say that every algorithm behaves identically on every dataset or that model selection is meaningless. It asks which structure makes the chosen preference reasonable. Linear functions suit approximately linear relationships. A distance metric suits a task when nearby inputs should have similar outputs. Those judgments can fail, which makes independent validation necessary.

16 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Regularization expresses preferences between functions

Section 5.2.2, pp. 116 to 118, broadens capacity control. Restricting a hypothesis space excludes some functions completely. A soft regularizer keeps them eligible but requires better fitting to offset the penalty. The source adds a squared weight norm to training MSE as weight decay. Regularization aims to improve generalization. It does not guarantee success on every problem or require a reduction in training error.

J_λ(w)=MSE_train+λwᵀw=‖Xw−y‖₂²/m+λ‖w‖₂², λ≥0. [5.18]
Source Figure 5.5。 All three panels use degree 9 models and the training points from Figure 5.2. A large λ suppresses the nonconstant terms and underfits. A medium λ recovers the broad quadratic shape in this example. As λ approaches 0, the high degree interpolating shape returns. The figure illustrates the effect of a preference. It does not supply an optimal λ transferable to other data. Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning, MIT Press, 2016, printed p. 118, official online edition. Official chapter. CC BY-NC-ND 4.0. The surrounding page is excluded. Figure content and labels are unchanged.

The note adds three qualifications. An L2 penalty generally shrinks coefficients continuously and does not guarantee exact zeros, so it is not a general feature selection mechanism. Changing feature units changes the weight norm of the same function, making scaling and parameterization part of the regularizer’s definition. An unpenalized intercept can retain a constant as λ grows. Penalizing the intercept too generally drives the limit toward the zero function. A flat illustrative curve does not specify the intercept convention.

17 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

The ridge solution, scaling convention and geometry

The following derivation extends 5.18 using the convention that every coordinate of w is penalized. MSE includes 1/m, so the linear system contains mλI. A convention using summed squared residuals gives a different numerical penalty strength for the same symbol λ.

∇J_λ=(2/m)Xᵀ(Xw−y)+2λw=0 ⇒ (XᵀX+mλI)w=Xᵀy.
λ>0 ⇒ w_λ=(XᵀX+mλI)⁻¹Xᵀy; for thin SVD X=UΣVᵀ: w_λ=V diag(σⱼ/(σⱼ²+mλ))Uᵀy.

For λ>0 the solution is unique even when X is rank deficient. Compared with the pseudoinverse factor 1/σⱼ, the spectral factor suppresses amplification along small singular value directions. This reduces sensitivity to some perturbations while introducing bias. A lower future risk still depends on the distribution and λ. As λ approaches 0, the fully penalized solution approaches the minimum norm least squares solution.

With an unpenalized b, centering X and y using training means permits fitting penalized slopes and recovering b=ȳ−wᵀx̄. Means and feature scales are estimated from the current training subset and then applied to validation and test examples. Estimating preprocessing quantities from validation data in advance brings those observations into fitting experience.

18 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Original arithmetic: worse training loss can accompany better prediction

For X=[1,2]ᵀ and y=[1,0]ᵀ, m=2 gives w_λ=1/(5+2λ). The table evaluates training MSE and the penalized objective for each λ. The J values belong to different objectives as λ changes. Their magnitudes do not provide a selection criterion for λ.

Original two point ridge arithmetic. Decimals retain 6 places. Fractions are exact.
λw_λTraining MSEJ_λ
01/52/5 = 0.4000002/5 = 0.400000
1/21/629/72 = 0.4027785/12 = 0.416667
11/720/49 = 0.4081633/7 = 0.428571
Two alternative original hypothetical cases. They are not a sampled validation set, a book result or a generalization experiment.
Hypothetical new exampleSquared error at λ=0Squared error at λ=1
x=3, y=09/25 = 0.3600009/49 = 0.183673
x=3, y=14/25 = 0.16000016/49 = 0.326531

On the same training data, shrinkage raises training error. It improves prediction under the first hypothetical target and worsens prediction under the second. The example establishes that training information alone cannot decide whether a regularizer is appropriate. One constructed new point does not estimate population risk. Reliable selection still needs suitable independent data.

19 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Parameters and hyperparameters depend on the learning level

Section 5.3, pp. 118 to 119, treats polynomial degree and weight decay strength λ as hyperparameters. They are set outside the current inner learning rule, while that rule fits w. Hyperparameters need not remain manually chosen. An outer learning algorithm can optimize them using validation performance. Their names depend on the learning level.

For nested polynomial families, a higher degree contains the lower degree family, so its optimal training MSE cannot worsen. Training MSE alone makes maximal capacity an optimal choice, though ties can make it nonunique. Likewise, selecting λ by unpenalized training MSE cannot favor a positive λ over a global least squares solution at λ=0. These statements require the same data, the same measure and successful optimization. They do not say that every hyperparameter should be maximal.

α̂∈argmin_α R̂_val(ĥ_α); ĥ_α=A_α(S_train). The test set is outside both choices.
Original learning level summary. Parameter and hyperparameter do not form an absolute split between learnable and unlearnable values.
LevelSelected objectEvidence used
Inner fittingw or other model parametersTraining subset
Outer selectionDegree, λ or model configurationValidation data or cross validation inside the training pool
Final evaluationFuture error estimate for a fixed procedureA test set that did not participate in selection
20 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Training, validation and testing serve different roles

Page 119 splits the original training pool into a fitting subset and a validation set while keeping the final test set separate. Its 80% and 20% split is a typical example, rather than an optimal ratio for every data size. Validation data participate in hyperparameter selection, making the selected validation error optimistic. The independent test set estimates generalization after all choices are complete.

The note adds a distinction about the splitting unit. It must match the intended object of generalization. Repeated measurements of one subject, near duplicate images or adjacent windows from a time series can make random row splitting exaggerate independence. Grouped and chronological splits address different estimation questions. They cannot simultaneously claim arbitrary random i.i.d. guarantees.

Normalization, feature selection and any estimated preprocessing are part of learning and are fitted within the current training split. Once hyperparameters are fixed, a prespecified rule can refit final parameters on the entire development pool. This changes the fitting sample size. The test set still evaluates the resulting final procedure.

The source also notes that years of repeated comparison can make a public benchmark optimistic. The issue concerns the accumulated use of test feedback throughout research. It is broader than whether one code path directly reads test labels. Fresh data, a genuinely separate evaluation or limited feedback can change the evidence conditions. An old test score alone cannot establish that selection bias has disappeared.

21 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Cross validation reuses data while isolating each fit

Section 5.3.1, p. 120, considers statistical uncertainty from a small test set. In k fold cross validation, the data are partitioned into k disjoint folds. Trial i holds out fold i and trains on the rest, then held out errors are averaged. This unit also reads the isolated Algorithm 5.1 box on printed p. 121. Its partitioning, separate fitting and held out loss accumulation belong to 5.3.1. This supplement does not extend coverage into the 5.4 body.

S=⊔ᵢ₌₁ᵏVᵢ; ĥ₋ᵢ=A(S∖Vᵢ); CV_equal=(1/k)Σᵢ R̂_Vᵢ(ĥ₋ᵢ) when all folds have equal size.
CV_pooled=(1/m)ΣᵢΣ_(z∈Vᵢ)ℓ(ĥ₋ᵢ,z)=Σᵢ(|Vᵢ|/m)R̂_Vᵢ(ĥ₋ᵢ).

With equal fold sizes, averaging fold means equals pooling all held out losses. Unequal sizes produce different weighting. The note makes that distinction explicit. Each example is scored by a model that did not use it for fitting, but training sets overlap across trials. Fold errors are consequently dependent.

The book cites Bengio and Grandvalet for the absence of a general unbiased estimator of cross validation error variance. This unit reads that cited statement rather than independently checking the paper’s proof. The sample variation of fold errors cannot simply be treated as an independent trial standard error. Cross validation improves data use without eliminating evaluation uncertainty.

Algorithm 5.1 actually returns the vector e of individual held out losses rather than only a fold mean. Each example z⁽ʲ⁾ receives eⱼ=L(fᵢ,z⁽ʲ⁾) from the model for its held out fold. The mean of e gives the pooled estimate. The algorithm description mentions common confidence intervals and explicitly warns that their justification after cross validation is weak. This note retains that warning without counting the referenced later equation 5.47 as read.

22 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Cross validation selection, cost and the final estimand

The following protocol interpretation is added note analysis. When k fold scores select hyperparameters, the best score has itself participated in selection. It is not automatically a final unbiased test result. An external test set can evaluate the chosen procedure. Alternatively, outer folds can repeat the entire selection process inside each outer training set. This is the principle of nested cross validation. It is not a new experiment reported in the section.

Original fit count accounting. Caching, early stopping and parallelism are excluded. These are symbolic costs, not time measurements.
SettingMain number of fitsEstimated object
Single holdout with H candidatesHA candidate fitted on the smaller training subset
k folds with H candidatesHkA rule fitted on about m(k−1)/k examples per trial
q outer folds, k inner folds and H candidatesqHk, plus q outer refitsThe complete procedure including hyperparameter selection

Cross validation usually evaluates an algorithm trained on fewer than m examples. A final model refitted on the entire development pool can have a different risk. Cost also depends on how one fit scales with sample size. For dense least squares, forming a Gram matrix takes about O(mn²), and factoring the n×n system takes about O(n³). Direct QR for m≥n also takes about O(mn²). Nearest neighbor storage is about O(mn), with about O(mn) per naive query. These are note operation counts. They include no hardware, sparsity or numerical library measurements.

23 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

What the evidence supports and what remains unresolved

Evidence ledger. The 40 and 95% in Figure 5.4 come from its source description. Added numeric examples are identified separately.
Evidence typeSpecific source in this unitSupported conclusion and limit
Definitions and derivations5.1 to 5.3; equations 5.1 to 5.18Specify interfaces and computable rules under stated assumptions
Synthetic geometryFigures 5.1, 5.2 and 5.5Illustrate particular fits and preferences without real task rankings
Qualitative diagramFigure 5.3Explains a typical capacity tradeoff without numeric benchmark data
Synthetic learning curvesFigure 5.4; 40 training sets and 95% intervalsSupport trends for that problem without full generation settings or point tables
Original arithmetic and boundsTwo point least squares, ridge, risks and costsCheck reasoning without claiming book experiments or measured replication

No real model was trained, benchmark was run or experiment was replicated in this unit. The cited theoretical papers were not all read independently. Claims are limited to the sections read, the actual figures and the explicitly marked original derivations. Estimation theory beginning in 5.4 remains outside this unit.

The reasoning sequence from this unit starts with T, P and E, then specifies the function family and learning rule. It next states distribution and independence assumptions and identifies which data support selection and testing. Without this evidence chain, low training loss or one test score cannot explain why a model should generalize.

24 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Recall checks: definitions, derivations and evidence limits

Original recall table. Answers use the source scope read and the identified mathematical additions.
Recall topicCheckable answer
Learning and taskT is the behavior to perform. E improves that behavior, and P measures the improvement. Training is not itself the task definition.
Linearity in regressionPolynomial features can make the function nonlinear in raw x while retaining linearity in fitted coefficients.
The normal equation inverseXᵀX is invertible only with full column rank. Otherwise the pseudoinverse gives the minimum norm solution.
Low training errorIt establishes a fit to observed constraints without uniquely determining the function on unseen inputs.
Generalization gapA fixed model has expected empirical risk equal to population risk. Data dependent selection changes that relationship.
Capacity and optimizationRepresentational capacity describes expressible functions. Effective capacity also depends on optimization and preferences.
Bayes errorIt is the best population risk for the information and loss. Training error can fall below it.
No Free LunchUniform task averaging leaves unseen labels without predictable structure. Structured tasks can support useful preferences.
Ridge scalingMSE contains 1/m, giving XᵀX+mλI. L2 does not guarantee exact sparsity.
Optimistic validationValidation participates in candidate selection, changing the interpretation of the selected score.
The cross validation statistical unitTraining sets overlap across folds, so fold errors are not independent repetitions.
This unit’s scopeThe introduction, 5.1 to 5.3.1 and isolated Algorithm 5.1 box are covered. Content beginning in 5.4 remains for later.
25 / 25Chapter 5 Part 1 only: introduction, 5.1 to 5.3.1, pp. 96 to 119 and p. 120 before 5.4, plus isolated Algorithm 5.1 on p. 121; official HTML retrieved October 29, 2026; no explicit web revision identifier

Original figures and source data come from the cited book chapter. Explanations and derivations are reading notes. Added examples are identified separately. Source versions, pages and figure labels appear beside the material.