Chapter 1: An overview of machine learning and deep learning
This introduction frames deep learning as a transformative practical technology and explains why the book emphasizes mathematical principles over memorizing recipes.
After this chapter you will be able to
- Mathematical foundations rationale. Explain why the book prioritizes understanding deep learning’s underlying principles and abstractions, supported by mathematics, rather than merely memorizing hands-on procedures.
- Machine learning paradigm shift. Explain how machine learning differs from conventional step-by-step programming: the engineer chooses a parameterized mathematical model rather than writing explicit rules that convert every input into an output.
- Classification and regression outputs. Distinguish classification, which chooses one of a set of classes, from regression, which produces a quantitative estimate; describe how a quantitative score can also be converted into a class decision using thresholds.
- Supervised model lifecycle. Describe the supervised-learning workflow in this section: choose a model architecture with unknown weights, prepare input-target training examples, iteratively adjust weights to move model outputs toward targets, and use the trained model for inferencing on arbitrary inputs.
- Generalization beyond training data. Explain why a trained model must operate on inputs it did not see during training, why correct behavior on those inputs is not guaranteed, and why training data that resembles the real-life input distribution makes success more likely.
- Function approximation perspective. Explain why machine learning is treated as function approximation: the real input-to-output transformation is usually unknown, so a model function serves as its proxy or surrogate.
- Architecture weights and training. Describe the distinction between model architecture and weights, and explain that training finds weight values that make model outputs match the corresponding training outputs as closely as possible.
- Inferencing and model success. Trace what happens after training and explain why good results on real inputs are not guaranteed: inferencing applies the fully determined model to an input, while success depends on the chosen architecture and the quality and quantity of training data.
- Cat decision scenario. Describe the hypothetical cat model: it chooses to run away, ignore an object, or approach and purr based on two quantitative inputs about the object.
- Min-max feature normalization. Explain how an input value v between vmin and vmax is normalized to vnorm between 0 and 1 using equation 1.1. Describe the transformation as mapping the original input domain [vmin, vmax] into the output range [0,1].
- Threat-score decision rule. Explain how the model converts its estimated threat score y into one of the three cat behaviors using the threshold δ. State that a high positive score means run away, a score near zero means ignore, and a high negative score means approach and purr.
- Model estimation objective. Explain that model estimation seeks to approximate the unknown function that maps an input vector to its output, denoted y(), using training data.
- Estimation process stages. Describe the two steps of model estimation: first select a parameterized surrogate-function architecture, then train it by estimating parameters so its outputs match the corresponding training outputs as closely as possible.
- Linear model architecture. Describe the selected cat-brain architecture as a model with two weights and one bias that produces the threat score y from the two input features.
- Training objective. Explain that, after choosing an architecture, training estimates the model’s unknown parameters from input-output training pairs so predicted outputs match their ground-truth outputs as closely as possible.
- Squared-error loss. Describe the loss for the cat-brain model as the squared difference between a predicted threat value and its ground-truth value for each training example, with total error obtained by adding those losses over the training set. State that training seeks weights that minimize this total error.
- Iterative parameter fitting. Trace the iterative training approach: begin with random parameter values, load and process only a small portion of training data at a time, repeatedly tune parameters to reduce total training error, and stop when the error is minimal or practically accurate enough.
- Deployed model inference. Describe inferencing as using a trained machine with its optimal parameters to process new inputs after deployment and produce a predicted output.
- Thresholded classification output. Explain that the model computes a predicted value from the new input and its learned parameters, and classification is obtained by thresholding that predicted value as specified in equation 1.2.
- Feature and output spaces. Describe an input example as a point in feature space and its model result as a point in output space. State that real problems can have many input and output dimensions, although output dimensionality is typically smaller than input dimensionality.
- Output-space class separation. Explain why a model maps feature-space points to output space: the task should become easier there. For classification, describe separate input classes mapping to separate clusters in output space, which can then be distinguished by thresholding or another decision rule.
- Signed-distance threat model. Trace the cat-brain model in which hardness x0 and sharpness x1 define a 2D input point and the threat score is its signed distance from the separator line x0 + x1 - 1 = 0. Explain that y(x0,x1) = (x0 + x1 - 1)/√2 is negative on one side, zero on the line, and positive on the other, enabling approach, ignore, and run decisions through thresholding.
- Regression and classification distinction. Distinguish a regressor from a classifier by stating that a regressor emits a desired value for an input, whereas a classifier selects the input's class from a prespecified set of classes.
- Thresholded regressor classification. Explain how the cat brain converts its threat-score regressor into a classifier by thresholding the regressor output to obtain a behavioral class, and state that a model can instead output a class directly without an intervening regressor.
- Need for nonlinear models. Explain why a simple weighted-sum, linear model is insufficient when classes cannot be separated by a line or hyperplane, and why nonlinear functions are appropriate for approximating complex real-world classification or estimation processes.
- Sigmoid nonlinear activation. Describe the sigmoid function as an S-shaped nonlinear function, typically denoted by σ, and state that it supplies nonlinearity when applied after a weighted sum of inputs.
- Basic neural network unit. State that applying sigmoid to a weighted sum of inputs forms a simple model architecture that can handle more complex classification tasks than a weighted sum alone, and that this architecture is the basic building block of a neural network.
- Layered expressive power. Explain why a complex task such as dog recognition needs high expressive power and how adding multiple nonlinear layers provides it. State that a neural network’s expressive power can be adjusted systematically to suit the problem.
- Cascaded hidden layers. Describe the forward structure of a deep neural network: inputs generate hidden outputs, each later layer uses the preceding layer’s outputs, and the outermost hidden layer is combined into the final or grand output. Explain that each hidden output is essentially a logistic regression unit.
Section by section
Introduction
This introduction frames deep learning as a transformative practical technology and explains why the book emphasizes mathematical principles over memorizing recipes.
- Mathematical foundations rationale: Explain why the book prioritizes understanding deep learning’s underlying principles and abstractions, supported by mathematics, rather than merely memorizing hands-on procedures.
Why it matters: Mathematical understanding helps you move beyond applying downloaded models toward reasoning about deep learning systems. - Chapter orientation purpose: Describe this chapter as an orienting overview of deep learning that introduces a first look at machine and deep learning, a simple cat-brain model, and deep neural networks, while relying on concepts explained later.
Why it matters: Knowing that this is an orientation chapter helps you tolerate open questions and connect its overview to the detailed material that follows.
Key terms: underlying principles, abstractions, mathematics, how-to steps, overview of deep learning, cat brain, deep neural networks, open questions
1.1 A first look at machine/deep learning: A paradigm shift in computation
This section introduces machine learning as building and training parameterized models that map inputs to decisions or estimates, rather than programming rules directly.
- Machine learning paradigm shift: Explain how machine learning differs from conventional step-by-step programming: the engineer chooses a parameterized mathematical model rather than writing explicit rules that convert every input into an output.
Why it matters: This shift explains why learning model parameters, rather than hand-coding decisions, is central to machine learning. - Classification and regression outputs: Distinguish classification, which chooses one of a set of classes, from regression, which produces a quantitative estimate; describe how a quantitative score can also be converted into a class decision using thresholds.
Why it matters: Recognizing the required output tells you what kind of prediction problem a model must solve. - Supervised model lifecycle: Describe the supervised-learning workflow in this section: choose a model architecture with unknown weights, prepare input-target training examples, iteratively adjust weights to move model outputs toward targets, and use the trained model for inferencing on arbitrary inputs.
Why it matters: This workflow connects the design of a model to its training and eventual use in the real world. - Generalization beyond training data: Explain why a trained model must operate on inputs it did not see during training, why correct behavior on those inputs is not guaranteed, and why training data that resembles the real-life input distribution makes success more likely.
Why it matters: A model is useful only if its learned pattern extends beyond its known examples rather than acting as a lookup table. - Task-specific machine limitations: State that present-day machine learning generally builds separate models for individual tasks, unlike the human brain, which can handle a vast variety of decisions and estimates.
Why it matters: This sets realistic expectations about the scope of the models introduced in the book.
Key terms: machine learning, parameterized function, model, model architecture, parameters, classification problem, classes, regressors, quantitative estimation, threat score
1.2 A function approximation view of machine learning:Models and their training
This section frames machine learning as approximating an unknown input-to-output function with a parameterized model trained on labeled examples.
- Function approximation perspective: Explain why machine learning is treated as function approximation: the real input-to-output transformation is usually unknown, so a model function serves as its proxy or surrogate.
Why it matters: This perspective connects classification and estimation problems to the common task of building a function from examples. - Architecture weights and training: Describe the distinction between model architecture and weights, and explain that training finds weight values that make model outputs match the corresponding training outputs as closely as possible.
Why it matters: Separating a model's form from its fitted parameter values is essential for understanding how machine-learning models are built and trained. - Inferencing and model success: Trace what happens after training and explain why good results on real inputs are not guaranteed: inferencing applies the fully determined model to an input, while success depends on the chosen architecture and the quality and quantity of training data.
Why it matters: A trained model must work beyond its limited training examples, so training performance alone does not ensure useful real-world behavior. - Human labeling and ground truth: Describe how training outputs may be obtained through human labeling or human curation, in which people create target outputs, also called ground truth, for training inputs.
Why it matters: Obtaining reliable labeled training data can be one of the hardest practical parts of applying machine learning.
Key terms: function approximation, model, proxy, surrogate, training data, model architecture, tunable parameters, weights, training, weighted sum
1.3 A simple machine learning model: The cat brain
This section introduces a deliberately simple cat-decision example that the following subsections use to illustrate machine learning concepts.
- Cat decision scenario: Describe the hypothetical cat model: it chooses to run away, ignore an object, or approach and purr based on two quantitative inputs about the object.
Why it matters: This small example provides a concrete setting for introducing the parts of a machine learning model. - Lightweight overview scope: State that this chapter is a lightweight overview of machine and deep learning and uses some mathematical concepts that are introduced later.
Why it matters: Knowing the intended scope helps you treat early mathematical references as preview material rather than prerequisites you must already master. - Recommended reading approach: Describe the recommendation to read the chapter now and optionally reread it after learning the later vectors and matrices material.
Why it matters: The recommendation lets you gain an initial conceptual map now and revisit it with stronger mathematical context later.
Key terms: hypothetical cat, quantitative inputs, run away, ignore, approach and purr, lightweight overview, mathematical concepts, vectors, matrices, re-read
1.3.1 Input features
This subsection defines the cat-brain input features, shows how to normalize each feature to the range from 0 to 1, and represents one input as a two-element vector.
- Cat-brain input features: Describe the two input features of the cat-brain example and how a single input instance is represented. State that x0 denotes hardness, x1 denotes sharpness, and the two values can be collected in a two-element vector.
Why it matters: A model can only make a decision from the features used to describe each input. - Min-max feature normalization: Explain how an input value v between vmin and vmax is normalized to vnorm between 0 and 1 using equation 1.1. Describe the transformation as mapping the original input domain [vmin, vmax] into the output range [0,1].
Why it matters: Normalization puts feature values on a common 0-to-1 scale before they are used by the model.
Key terms: input features, x0, hardness, x1, sharpness, two-element vector, normalization, vmin, vmax, v
1.3.2 Output decisions
This subsection defines the cat model’s three behavioral outputs by converting a scalar threat score into run, ignore, or approach decisions using thresholds.
- Threat-score decision rule: Explain how the model converts its estimated threat score y into one of the three cat behaviors using the threshold δ. State that a high positive score means run away, a score near zero means ignore, and a high negative score means approach and purr.
Why it matters: This shows how a numerical model output can be interpreted as a discrete multiclass decision. - Score versus direct class: Distinguish directly computing a multiclass label from the approach used here, where the model estimates a threat score and then interprets it as a class. State that the possible final class values are 0 for run away, 1 for ignore, and 2 for approach and purr.
Why it matters: Separating a model’s numeric output from its final decision helps clarify how machine-learning outputs can be represented.
Key terms: threat score, threshold δ, multiclass, run away, ignore, approach and purr, class, output decision
1.3.3 Model estimation
This section frames model estimation as approximating an unknown input-to-output function from training data through architecture selection and training.
- Model estimation objective: Explain that model estimation seeks to approximate the unknown function that maps an input vector to its output, denoted y(), using training data.
Why it matters: This is the central task that turns example input-output pairs into a usable machine learning model. - Estimation process stages: Describe the two steps of model estimation: first select a parameterized surrogate-function architecture, then train it by estimating parameters so its outputs match the corresponding training outputs as closely as possible.
Why it matters: Separating the function form from its fitted parameters clarifies what architecture design and training each contribute to a model.
Key terms: model estimation, input vector, output, y(), training data, ideal function, model architecture selection, parameterized function, proxy, surrogate
1.3.4 Model architecture selection
This section selects a simplest linear cat-brain model whose threat score is computed from two input-weight products plus a bias.
- Linear model architecture: Describe the selected cat-brain architecture as a model with two weights and one bias that produces the threat score y from the two input features.
Why it matters: The architecture specifies which adjustable parameters the model will train and how it turns inputs into a decision score. - Bias and weight roles: Distinguish the bias b from the weights w0 and w1: the bias is a constant added independently of the inputs, whereas each weight is multiplied by an input.
Why it matters: Separating bias from weights helps you correctly read model equations and understand which parameters play different roles.
Key terms: model architecture, parameters, w0, w1, b, threat score, bias, weights, constant, inputs
1.3.5 Model training
This section defines supervised model training as estimating parameters that minimize prediction error on labeled training data, typically through iterative updates.
- Training objective: Explain that, after choosing an architecture, training estimates the model’s unknown parameters from input-output training pairs so predicted outputs match their ground-truth outputs as closely as possible.
Why it matters: Training is how a chosen model becomes a fitted function that can make useful predictions. - Squared-error loss: Describe the loss for the cat-brain model as the squared difference between a predicted threat value and its ground-truth value for each training example, with total error obtained by adding those losses over the training set. State that training seeks weights that minimize this total error.
Why it matters: A numerical loss makes it possible to judge whether one set of model parameters is better than another. - Iterative parameter fitting: Trace the iterative training approach: begin with random parameter values, load and process only a small portion of training data at a time, repeatedly tune parameters to reduce total training error, and stop when the error is minimal or practically accurate enough.
Why it matters: Iterative fitting makes training feasible when datasets contain millions of examples and cannot all be held in memory at once.
Key terms: model training, parameters, weights, training data, ground truth, predicted output, squared error, loss, total error, E
1.3.6 Inferencing
This subsection explains how a trained model is deployed to produce predictions for new inputs and turn them into classifications by thresholding.
- Deployed model inference: Describe inferencing as using a trained machine with its optimal parameters to process new inputs after deployment and produce a predicted output.
Why it matters: Inferencing is how a trained model is used in the world rather than fitted to its training data. - Thresholded classification output: Explain that the model computes a predicted value from the new input and its learned parameters, and classification is obtained by thresholding that predicted value as specified in equation 1.2.
Why it matters: A numerical prediction becomes a class decision only when the model applies its classification threshold.
Key terms: inferencing, trained machine, optimal parameters, new inputs, predicted output, ypredicted, thresholding, classification, equation 1.2
1.4 Geometrical view of machine learning
This section presents machine learning geometrically as mapping feature-space points into an output space where estimation or classification is simpler.
- Feature and output spaces: Describe an input example as a point in feature space and its model result as a point in output space. State that real problems can have many input and output dimensions, although output dimensionality is typically smaller than input dimensionality.
Why it matters: This geometric picture gives you a reusable way to think about what any machine learning model does to data. - Output-space class separation: Explain why a model maps feature-space points to output space: the task should become easier there. For classification, describe separate input classes mapping to separate clusters in output space, which can then be distinguished by thresholding or another decision rule.
Why it matters: The goal is not merely to transform data, but to create outputs from which the desired decision is easy to make. - Signed-distance threat model: Trace the cat-brain model in which hardness x0 and sharpness x1 define a 2D input point and the threat score is its signed distance from the separator line x0 + x1 - 1 = 0. Explain that y(x0,x1) = (x0 + x1 - 1)/√2 is negative on one side, zero on the line, and positive on the other, enabling approach, ignore, and run decisions through thresholding.
Why it matters: This concrete example connects a linear model's formula and parameters to the geometry of a separating line.
Key terms: feature space, input space, output space, input vector, output vector, classification, classes, clusters, thresholding, signed distance
1.5 Regression vs. classification in machine learning
This section distinguishes regressors from classifiers and shows how thresholding a regressor can produce a class decision.
- Regression and classification distinction: Distinguish a regressor from a classifier by stating that a regressor emits a desired value for an input, whereas a classifier selects the input's class from a prespecified set of classes.
Why it matters: This distinction identifies what kind of output a machine learning problem requires. - Thresholded regressor classification: Explain how the cat brain converts its threat-score regressor into a classifier by thresholding the regressor output to obtain a behavioral class, and state that a model can instead output a class directly without an intervening regressor.
Why it matters: It shows that classification can be built by turning a continuous model output into a discrete decision or by predicting the decision directly.
Key terms: regressor, classifier, prespecified classes, class, thresholding, threat-score estimator, intervening regressor, output decision
1.6 Linear vs. nonlinear models
This section explains why nonlinear models are needed for complex class boundaries and introduces the sigmoid of a weighted input sum as a basic neural-network building block.
- Need for nonlinear models: Explain why a simple weighted-sum, linear model is insufficient when classes cannot be separated by a line or hyperplane, and why nonlinear functions are appropriate for approximating complex real-world classification or estimation processes.
Why it matters: This is the reason neural networks use nonlinear components rather than only weighted sums. - Sigmoid nonlinear activation: Describe the sigmoid function as an S-shaped nonlinear function, typically denoted by σ, and state that it supplies nonlinearity when applied after a weighted sum of inputs.
Why it matters: The sigmoid shows how a simple model can gain nonlinear behavior without abandoning weighted input combinations. - Basic neural network unit: State that applying sigmoid to a weighted sum of inputs forms a simple model architecture that can handle more complex classification tasks than a weighted sum alone, and that this architecture is the basic building block of a neural network.
Why it matters: This unit connects the idea of nonlinear modeling to the components from which neural networks are constructed.
Key terms: linear model, nonlinear model, weighted combination, hyperplane, function approximation, sigmoid function, σ, weighted sum, nonlinearity, model architecture
1.7 Higher expressive power through multiple nonlinear layers: Deep neural networks
This section introduces deep neural networks as cascades of nonlinear logistic-regression units whose layered architecture provides systematically adjustable expressive power for complex tasks such as image recognition.
- Layered expressive power: Explain why a complex task such as dog recognition needs high expressive power and how adding multiple nonlinear layers provides it. State that a neural network’s expressive power can be adjusted systematically to suit the problem.
Why it matters: Deep networks are useful because complex real-world input variations cannot usually be handled well by a simple one-step model. - Cascaded hidden layers: Describe the forward structure of a deep neural network: inputs generate hidden outputs, each later layer uses the preceding layer’s outputs, and the outermost hidden layer is combined into the final or grand output. Explain that each hidden output is essentially a logistic regression unit.
Why it matters: This cascade is the basic architectural idea behind a deep neural network rather than a model that maps inputs directly to outputs in one step. - Layer weight notation: Describe the weight notation for the multilayer network: superscripts identify layers, with layer 0 nearest the inputs and layer L the final, farthest layer; two-dimensional subscripts identify destination and source nodes, so each layer’s weights form a matrix.
Why it matters: This notation makes it possible to specify and reason about the connections and computations of a multilayer network. - Implicit bias input: Explain that the equations omit an explicit bias term only for notational simplicity: the bias is incorporated into the weights by setting one input, such as x0, to 1 and using its corresponding weight as the bias.
Why it matters: Recognizing an implicit bias prevents mistaking a simplified equation for a network with no bias at all.
Key terms: expressive power, nonlinear model, deep neural network, hidden outputs, hidden layer, logistic regression unit, grand output, final layer, weights, layer 0
1.8 Summary
This summary consolidates machine learning as trained function approximation and deep learning as multilayer nonlinear modeling with greater expressive power.
Where this is used later
- Geometrical view of image classification (chapter 3) · Image classification is presented as a geometric decision-boundary problem.
- Error, aka loss function (chapter 3) · Loss measures how closely model outputs match desired outputs during training.
- Regularization (chapter 9) · Regularization later addresses how models behave beyond the training examples.
- Matrices and their role in machine learning (chapter 2) · Machine learning uses input-output examples to construct a mapping with low overall error.
- Expressing real-world problems: Target functions (chapter 7) · Target functions formalize the real-world functions that neural networks seek to model.
- PyTorch code for gradient descent, error minimization,and model training (chapter 3) · Model-training code operationalizes fitting a model before using it for outputs.
- Population histograms (chapter 5) · Population data and observations provide context for thinking about data used in learning.
- Training the Faster R-CNN (chapter 11) · Training an object detector requires target information for examples.
Concepts explained in this chapter
- embeddingAn ordered mathematical object representing a point or direction in a coordinate space.
- training datasetA set of input examples collected from a distribution, which may or may not have corresponding labels or outputs.
- classifierA supervised learning task that assigns inputs to discrete classes.
- trainingThe step of estimating model parameters so the model’s outputs on training inputs match the corresponding targets as closely as possible.
- machine learningA paradigm for learning a parameterized mapping from inputs to outputs by training on data rather than by writing explicit step-by-step rules.
- labelThe manually labeled or authoritative target output for a training example against which prediction error is measured.
- model architectureThe chosen arrangement of neurons and their connections in a neural network.
- parameterThe tunable values of a model estimated from data.
- interceptA learned additive parameter that shifts model output independently of the inputs.
- inputA measured or encoded property used as an input variable to a machine-learning model.
- supervised learningA learning setting where training examples include known target outputs used to guide parameter estimation.
- weighted sumA linear combination of values multiplied by coefficients.
- linear regressionA function that preserves addition and scalar multiplication between vector spaces, as in matrix multiplication.
- feature spaceThe set of all possible input values represented geometrically as the space in which data points lie.
- output spaceThe space of all possible model outputs, treated geometrically as points the model maps to.
- nonlinear mappingA property of a function or layer whose output is not a linear transformation of its inputs.
- objective functionA function assigning a scalar penalty to model parameters or predictions.
- expressive powerThe capacity of a model architecture to represent a wide range of functions or input-output relationships, including ones like XOR.
- function approximationThe task of representing a target input-output mapping with a model, used here to justify nonlinear models for complex real-world processes.
- generationA modeling approach that learns a data distribution so new samples resembling the training data can be generated.
- parameterized functionA function whose behavior depends on adjustable parameter values learned from data.
- sigmoidAn S-shaped nonlinear activation function whose steepness and horizontal position can be adjusted with parameters.
- mean squared errorThe average of squared differences between predicted and target values.
- neuronA biological nerve cell used as an analogy for a neural-network building block.
- closed formA solution method that computes parameter values directly by algebraic manipulation rather than by iterative optimization.
- neural network layerA stage in a neural network that transforms one set of activations into another.
- unsupervised learningA learning setup that uses training inputs without manually provided target outputs.
- hyperplaneA flat boundary of one dimension less than the ambient space.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
