CMU Introduction To Deep Learning 11-785, Fall 2026: Lecture 2
Overview
Lecture 2 explains what multilayer perceptrons (MLPs) can represent and how network depth, width, and activation functions affect that capacity. It shows that shallow networks can represent arbitrary Boolean functions, classifiers, and real-valued functions in principle, but may require exponentially many or even infinitely many neurons; deeper networks can often represent the same patterns much more compactly, provided each layer preserves enough information.
Key takeaways
- A single perceptron implements a linear threshold boundary, so it can represent AND and OR but not XOR; connecting perceptrons allows the network to compose the multiple regions XOR requires.
- Any Boolean function can be represented by a one-hidden-layer MLP using a DNF truth-table construction, but the worst case can require 2ⁿ⁻¹ hidden units, including 512 units for 10 inputs.
- Depth can change representation size dramatically: parity can be composed from small XOR blocks with size linear in the number of inputs and about 2 log₂(n) layers, rather than exponential shallow width.
- A one-hidden-layer MLP can approximate arbitrary real-valued functions by combining localized pulses or higher-dimensional cylinders, but exact representation is not guaranteed and arbitrary precision may require many units.
- Threshold activations discard distance-to-boundary information; graded activations such as sigmoid, ReLU, softplus, and leaky ReLU can preserve more information for subsequent layers.
- Depth and graded activations do not eliminate capacity limits: an early layer that is too narrow can irreversibly lose distinctions needed to form the target function.
Chapters
- The lecture continues from the prior introduction to neural networks, focusing on representational capacity and constraints from depth, width, and activation functions.
- Neural networks are presented as functions, such as mapping a voice signal to a transcript or an image to a caption.
- Artificial neural networks are described as networks of simple computational units modeled loosely on biological neurons.
- A perceptron computes a weighted sum of inputs and outputs 1 when that sum reaches a threshold, otherwise 0.
- The threshold can be written as a bias, giving the affine expression z = Σwᵢxᵢ + b.
- The perceptron’s threshold rule is represented by a step activation that switches at z = 0.
- A linear function passes through the origin, while an affine function can include a bias that shifts it.
- The step activation can be replaced by sigmoid or tanh, which produce smooth, bounded outputs.
- ReLU, softplus, and other activations are introduced as alternatives; threshold activations are retained for the lecture’s representation examples.
- A network is a directed graph, and its depth is the length of the longest path from a source node to a sink node.
- A graph can contain shorter input-to-output paths without changing its depth; the longest path determines the value.
- A layer groups neurons at the same depth from the input, rather than neurons that merely appear aligned in a drawing.
- MLPs can represent Boolean functions and classifiers, and can approximate real-valued functions to arbitrary precision.
- A single perceptron can implement AND, OR, and detectors for specific Boolean input patterns by choosing weights and thresholds.
- A perceptron can compute a majority function by setting all weights to 1 and the threshold to the required count.
- One perceptron cannot compute XOR because XOR’s positive inputs cannot be separated from its negative inputs with a single linear boundary.
- A network of perceptrons can compute XOR even though an individual perceptron cannot.
- Hidden neurons can detect intermediate Boolean conditions, whose outputs are combined by a later perceptron.
- Combining perceptrons into an MLP makes it possible to represent Boolean functions that are not linearly separable.
- Any Boolean function can be represented by listing the truth-table rows where its output is 1.
- A disjunctive normal form (DNF) expresses the function as an OR of clauses, with each clause describing one input pattern.
- A single hidden layer can assign one perceptron to each clause, then combine their outputs with an OR-like output unit.
- The lecture defines a deep network as having at least two hidden layers, so this construction is universal without being deep.
- Karnaugh maps arrange truth-table entries so adjacent cells differ in one input bit, allowing neighboring 1s to be grouped into simpler DNF clauses.
- The lecture’s four-input example reduces seven positive truth-table entries to three grouped clauses and therefore three hidden units.
- A checkerboard pattern prevents such grouping; in the worst case, a one-hidden-layer network may need up to 2ⁿ⁻¹ hidden perceptrons.
- For 10 inputs, the stated worst case requires 512 hidden units in that layer.
- The checkerboard Boolean pattern is an XOR, or parity, function: flipping any one input bit flips the output.
- A deep network can compute parity by composing smaller XOR operations instead of encoding every positive truth-table row separately.
- This changes the construction from exponential width for a shallow network to a number of perceptrons that grows linearly with the number of inputs.
- The lecture uses XOR as a concrete example of how depth can make a representation substantially more compact.
- Because XOR is associative, parity can be computed pairwise in a tree, reducing the number of remaining values by a factor of two at each stage.
- The pairwise construction uses about 2 log₂(n) layers, with each XOR block requiring two layers in the illustrated design.
- Stopping before enough layers are available leaves an XOR over many unresolved inputs, which can force the final layer to grow exponentially wide.
- A network that is too narrow as well as too shallow may fail to represent the function, rather than merely requiring more computation.
- The Boolean-function recap distinguishes universal representability from efficient representation: one hidden layer can suffice but may be exponentially large.
- A threshold perceptron over real-valued inputs divides space with a hyperplane, producing a linear classifier.
- For two Boolean inputs, the four possible points can be separated to implement gates such as OR and AND.
- XOR requires more than one linear boundary, explaining geometrically why a single perceptron cannot compute it.
- A hidden neuron can test which side of a hyperplane contains an input; an output neuron can combine these tests.
- For a pentagonal decision region, five boundary detectors can be combined with a threshold of five so that the output is 1 only inside the polygon.
- Multiple subnetworks can represent separate regions, while additional boundary detectors can assemble more intricate decision shapes.
- The construction illustrates how MLPs form complex classifiers by composing simpler geometric tests.
- The lecture compares polygonal boundaries with the sums produced by their boundary detectors; adding more polygon sides makes the near-boundary regions narrower.
- In the many-sided limit, the summed response approaches a cylindrical region, with a high value inside and a lower baseline outside.
- Separate subnetworks can form disconnected circular regions, and a final threshold can combine them into a classifier.
- Arbitrary boundaries can be approximated by packing increasingly thin regions, but some require infinitely many units for an exact one-hidden-layer construction.
- A two-hidden-layer construction can use 16 first-layer neurons for 16 lines and 40 second-layer neurons for 40 selected regions, plus an output unit.
- The lecture compares this layered decomposition with representing the pattern as an XOR over boundary features.
- For a 64-line grid, a direct region-based construction involves 544 highlighted regions, while a deeper XOR-style design is described as requiring 253 or, with a two-neuron XOR, 120 hidden neurons.
- The examples show that deeper networks can reuse intermediate features instead of separately encoding every region.
- For a scalar input, two threshold units at t₁ and t₂ can form a pulse that is active only between those thresholds.
- Weighted pulses can build a piecewise-constant approximation of a scalar function using one hidden layer.
- In higher dimensions, analogous units form cylindrical regions; scaled cylinders can approximate real-valued functions by filling the input space.
- The construction provides arbitrary precision, not necessarily exact representation, even with infinitely many hidden units.
- Threshold activations output only 0 or 1, preserving which side of a boundary an input lies on but discarding how far it is from that boundary.
- If an early layer has only eight threshold units where 16 boundary tests are needed, later layers cannot recover the discarded distinctions.
- Even with all 16 first-layer boundary detectors, the example requires enough second-layer units to represent its 40 selected regions.
- Graded activations such as sigmoid, ReLU, softplus, and leaky ReLU can retain more information for later layers, but do not remove the need for sufficient width.
- The recap states that MLPs are universal Boolean function computers, classifiers, and function approximators, but shallow versions can be very large.
- Deeper networks may achieve the same representation or approximation with far fewer neurons, provided each layer has enough capacity to pass relevant information.
- The lecture identifies training as the next question: how to make an MLP represent a particular function.
- The closing questions revisit the 40-unit classifier layer and clarify that graded activations cannot compensate for insufficient neurons in every architecture.
Transcript excerpt
0:03 Good morning everybody and welcome to lecture two. Uh the uh lecture slides are not yet up. We were supposed to get them up have them up last night and uh so I apologize that they're not up. They should have been up. They will be up just shortly after the class. So uh do we have any questions from the last class? Any questions? No. Was the last class were the topics we covered in the last class last clip? Yes. Okay. Uh guys, please don't ask me to uh record the lecture using order
0:57 because interferes with zoom zone recording and it tends to stop it and as a result we we've had situations where some students got auto recordings but the entire class got no lecture recording. So we will not be while you can transcribe the uh uh lecture we won't be permitting you to record it using Potter. All right. So let me continue. Right. Uh now here's [snorts] where we were in the last class. Uh we have we were introduced to what neural networks were and we were brief and briefly went over what they could represent. So we're going to continue on that topic for today. We're going to talk about what neural networks can
1:44 represent and what the restrictions are in terms of depth, width, and activations. So as we saw in the last class, neural networks have taken over the world of AI. Tasks uh that were considered almost impossible in the past have been made possible by neural networks also known as deep learning. These are tasks that were once assumed to be purely in the human domain of expertise. Now it's almost commonplace acceptance that AI can do it. And how has that happened? Through neural networks. So
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Carnegie Mellon University Deep Learning.