Regularized Autoencoders and Likelihood-Based Generative Models
Prerequisite Knowledge
This lecture builds on the following concepts from earlier lectures. If any feel unfamiliar, review the linked notes before proceeding.
Previously Covered in This Subject
- Undercomplete autoencoders and lossy encoding — covered in Lecture 3 (The Autoencoder Architecture)
- Overcomplete autoencoders and the identity trap — covered in Lecture 3 (Overcomplete Autoencoders)
- Sparse and contractive autoencoders, a first look — covered in Lecture 3 (Sparse and Contractive Autoencoders)
- Linear autoencoders and the PCA equivalence — covered in Lectures 1 and 3
- Convolutional autoencoders: encoder path, decoder path, transpose convolution — covered in Lecture 3
- Variational autoencoders with a Gaussian-constrained latent space — covered in Lecture 1
- Autoregressive generative models and factorizing an image's probability — covered in Lecture 1
# Regularized Autoencoders and Likelihood-Based Generative Models
4.1 Recap: Undercomplete Autoencoders and Lossy Encoding
Why start here? Before adding any new machinery, ask one question: can a network be its own teacher? An autoencoder answers yes — its input and its target are the same data, so no human labels are needed. Everything built in this lecture keeps that self-supervised setup and only changes what pressure the training feels.
An autoencoder is a pair of networks trained together. The encoder squeezes the input into a small code, and the decoder rebuilds the input from that code. In symbols, for an input (a vector of numbers), a hidden code , and weights with bias :
Here is the hidden activation function of the encoder, the activation of the decoder output layer, and the decoder's weight matrix and bias, and the reconstruction. Both halves train together with backpropagation, and the training signal is just the difference between and .
In the undercomplete formulation introduced in the earlier session, the hidden layer has fewer nodes than the input layer: . Because the code lives in a smaller-dimensional space than the original data, it can hold only some of the main underlying factors that describe the dataset.
This narrowing has a name. Projecting the original space onto the smaller space spanned by the encoder nodes always loses some information, no matter how little. That is why the undercomplete autoencoder performs a lossy encoding: when the code passes through the decoder, the reconstruction can land very close to the original data, but some loss always remains.
A concrete picture helps. Think of retelling a two-hour film as a one-minute spoken summary. You cannot keep every scene; you must pick which threads carry the story. A good summary loses detail but keeps the plot. The autoencoder does the same job with gradients instead of judgment: the bottleneck forces it to decide which directions of variation in the data matter most. The analogy has a limit — a person chooses what matters on purpose, while the network discovers it mechanically by minimizing reconstruction error.
The quality bar for any autoencoder architecture follows from this: an architecture counts as better if it reconstructs the data well while using a smaller-dimensional subspace spanned by the hidden nodes. Reconstruction quality alone proves nothing; quality per code dimension is the honest measure.
4.1.1 Input Types Constrain Activations and Losses
The nature of the data being auto-encoded restricts the design choices before training even starts.
| Input type | Output-layer activation | Matching loss | Typical hidden activation |
|---|---|---|---|
| Real, continuous ( to ) | Linear | Squared error | ReLU, ELU, sigmoid, tanh |
| Binary (each value 0 or 1) | Sigmoid | Cross-entropy per feature | Sigmoid or ReLU |
| Bounded range (e.g., pixel 0–255 scaled to 0–1) | Sigmoid or linear | Squared error on the bounded scale | ReLU |
For real, continuous inputs, the output layer needs one kind of activation and one kind of loss; for binary inputs, different choices fit better. The same restriction applies to the activations inside the encoding nodes. So before building any autoencoder, ask what the input looks like — the answer decides the output activation, the output loss, and the hidden activations.
4.1.2 Backpropagation Assumptions and Exam Expectations
Training an autoencoder uses straightforward backpropagation, and every weight update formula in this course follows from it. The chain rule carries the reconstruction error backwards through the decoder, through the code layer, and into the encoder; each weight receives the share of the blame it earned in the forward pass.
Standing prerequisite: you need a solid, working knowledge of the backpropagation algorithm so you can apply it to compute weight updates for an autoencoder architecture — and for any other architecture covered here. Assessments may require computing those updates by hand. Backpropagation is the backbone of modern deep learning; this point repeats across every course of this program because it stays true everywhere.
Exam note: expect to compute weight updates by hand using backpropagation on autoencoder-style architectures. Treat fluency in backpropagation as a prerequisite, not an option.
Recap: an undercomplete autoencoder compresses into a code with dimensions and rebuilds ; encoding is lossy, so architectures are judged by reconstruction quality at a given code size. Bridge: if shrinking the code is what forces useful structure, a natural experiment suggests itself — grow the hidden layer past the input size and watch what happens. That mirror case comes next.
4.2 Overcomplete Autoencoders Need Regularization
Here is a puzzle worth sitting with: give a network more room — as many code dimensions as inputs, or more — and it learns nothing at all. More capacity producing less insight is the exact opposite of what most of deep learning trains you to expect, and the reason why is the doorway into everything this lecture builds.
The mirror image of the undercomplete case also exists. An overcomplete autoencoder has as many hidden nodes as the input dimension, or even more (). Without any extra adjustment, such a network learns nothing worth knowing: the original data gets copied through the connections to the hidden nodes and out to the output.
4.2.1 What Goes Wrong Without Constraints
Think about what copying means mechanically. Every input value has a private route to the output: a weight of about 1 on its own path and about 0 everywhere else turns the whole stack into the identity map. The network can then score zero reconstruction error without ever compressing, abstracting, or noticing structure. No latent variation is forced to emerge, because none is needed.
The copy behavior destroys exactly what we wanted from the bottleneck — insight into the latent variations within the data and the deep underlying features on which the whole dataset rests. With as many code dimensions as input dimensions, that discovery capability disappears. A useful analogy: hand a student the answer key before an exam and ask them to "solve" the paper. Perfect score, zero understanding. The overcomplete network holds the answer key — the input itself — so it never has to learn anything about the subject. The analogy breaks only in that the network does not even know it is copying; gradient descent simply never encounters pressure to do otherwise.
| Undercomplete | Overcomplete, unregularized | |
|---|---|---|
| Code size | ||
| Easiest way to low error | Compress and reconstruct | Copy input through |
| What the code contains | Main underlying factors | A copy of the data |
| Useful for representation learning | Yes | No |
When to pick which? An unregularized overcomplete autoencoder is never the goal; it becomes interesting only once a penalty forces the code to earn its size.
4.2.2 Three Autoencoder-Specific Penalties
Overcomplete autoencoders become useful when regularization enters the training process, which gives the family its name: regularized autoencoders. Besides the standard L1 and L2 penalties learned in earlier machine learning and deep neural network courses, three penalties are specific to autoencoders:
- Sparsity of representation — force most coding units to stay silent most of the time. This produces sparse autoencoders.
- Robustness to noise or missing inputs — train on corrupted data but demand clean reconstructions. This produces denoising autoencoders.
- Smallness of derivatives of the representation — make the coded values change slowly with the inputs. This produces contractive autoencoders.
Each penalty attacks the copy shortcut differently. Sparsity makes a full copy expensive, because the copy would light up every coding unit. Noise robustness breaks the private route, because the input that arrives is damaged while the target stays clean. Small derivatives make the code blind to small wiggles, so passing raw values through earns nothing. This lecture covers all four ideas in turn: L1/L2 next, then tied weights and the contractive variant, then denoising and sparsity in detail.
Common beginner traps here:
- Assuming more hidden nodes always help. Past the input size, unconstrained capacity invites copying.
- Treating regularization as optional polish. For overcomplete codes it is the difference between learning structure and learning nothing.
- Mixing up the three penalties later: sparsity constrains how often units fire, robustness constrains what the network sees during training, and small derivatives constrain how fast the code moves with the input.
Exam note: the mid-semester examination arrives in roughly four to five weeks, and everything in this stretch of the course becomes exam material then. The remainder of this session works through sparse and denoising autoencoders in detail.
Recap: an unconstrained overcomplete autoencoder copies its input and learns no representation; adding a penalty restores usefulness. Bridge: the simplest penalties are the familiar ones — L1 and L2 on the weights — and they slot straight into the training objective.
4.3 L1 and L2 Regularized Autoencoders
The first two regularizers need no new theory — you already own them. Ridge and lasso walk straight over from supervised learning and attach themselves to the reconstruction error. The interesting question is what each one does to an encoder, where the thing being shaped is not a prediction function but a code.
Collect every weight in the architecture into one symbol . This includes all entries of , the weight matrix from the input layer to the encoder layer, and all entries of , the weight matrix from the encoder layer to the decoder (output) layer. Two bias vectors also exist — at the encoder side and at the decoder side — and they play a special role explained below. In this section (lambda) is the regularization constant deciding how strongly weights get punished for growing. Watch out later: the same Greek letter plays the role of a step size in Section 4.4, because the lecture used it there; the meaning is announced wherever it appears.
4.3.1 The L2 Objective and Its Symbols
For real-valued inputs, the plain training goal is to minimize the squared reconstruction error. Stated in words from class: minimize this reconstruction error, assuming real data whose range lies between minus infinity and plus infinity, together with the L2 norm of theta, squared. Reconstructed, the objective reads:
where is the i-th training input, is its reconstruction, is the number of training points, and balances the two goals. The penalty sums the squares of every weight in both matrices. Its effect is called weight decay: all weights feel pressure to shrink.
Why does squaring produce shrinking? Differentiate the objective with respect to any single weight . The reconstruction part contributes whatever the data demands, call it , and the penalty contributes :
A gradient-descent step with learning rate then gives:
Read the middle expression carefully: before the data gradient does anything, every weight is multiplied by the factor , a number just below one. Each training step shaves a fixed percentage off every weight. A weight the data never uses therefore decays toward zero geometrically.
Worked numbers for weight decay. Let and . The decay factor per step is . Suppose a particular weight receives almost no useful gradient from the data, so the decay dominates. After 100 steps its size is — about a third of where it started — and it keeps shrinking. Meanwhile a weight the data actively needs gets pushed back up by the term every step, so only genuinely useless weights fade away. Sense-check: the factor sits strictly between 0 and 1 whenever , so decay can never grow a weight — matching what "decay" promises.
Notation note: some textbooks write this penalty with a factor of one half, , so its derivative is instead of . The difference is absorbed by re-scaling ; the behavior is identical.
Training runs by backpropagation over the whole objective, updating only the weights. One carry-over rule from earlier ML and deep learning courses matters here: apply regularization only to the weights, never to the biases and . The biases stay outside the penalty term. The reason is capacity: a bias merely shifts a unit's response left or right, it does not multiply the influence of any input direction, so growing biases does not create the kind of flexibility that overfits. Penalizing them would mainly cost fitting power while buying almost nothing.
4.3.2 The L1 Objective and Feature Selection
The L1 variant swaps the squared penalty for absolute values. In words: use lambda times the sum over theta of the absolute values of theta; this has a tendency to push the thetas toward zero. Formally:
This is the lasso idea from earlier coursework. The mechanical difference shows up in the derivative. The absolute-value function has slope for negative and for positive , written . So the update becomes:
Every step drags each weight toward zero by the same fixed amount , whether the weight is large or tiny. Small weights get pushed all the way past zero and stop there, instead of lingering at 0.001 forever as they do under L2's proportional pull.
Worked numbers comparing the two pulls. Take , , and a weight with (the data is indifferent). Under L2, one step gives ; the pull shrinks as the weight shrinks, so never quite reaches zero. Under L1, one step gives , the next gives 2.98, and so on — a steady march of per step that lands exactly on zero after 300 steps and stays there. Sense-check: both paths reduce the weight, but only L1's path terminates at exactly zero.
Because lasso drives some weights all the way to zero, it can select the more relevant subset of features out of an original feature set containing irrelevant entries — feature selection. Both penalties apply to overcomplete autoencoders and equally to undercomplete ones; in both settings they provide better generalization.
| L2 (ridge-like) | L1 (lasso) | |
|---|---|---|
| Penalty form | ||
| Pull per step | Proportional to | Constant size , toward zero |
| Where small weights end up | Tiny but nonzero | Exactly zero |
| Typical effect | Smooth shrinkage, weight decay | Sparse weights, feature selection |
When to pick which? Use L2 when you believe many features each contribute a little; use L1 when you suspect only a few input directions matter at all.
4.3.3 Practical Notes on Regularization
Assumptions and scope:
- Both objectives above assume real-valued inputs with squared-error reconstruction; binary targets would swap in cross-entropy (see 4.1.1).
- Penalty terms are sensitive to input scale. If one feature ranges over thousands and another over fractions, the penalty punishes their weights unevenly; standardize features first.
- is a design choice: too small and copying survives, too large and the encoder cannot afford to represent anything.
- A common trap: L1 here makes the weights sparse, not the activations. Making the hidden code itself sparse is a different idea — the sparse autoencoder of Section 4.7.
- Second trap: forgetting that contains both matrices, and , while the biases stay exempt.
Real-world: for extra problem practice, ChatGPT turns out to be effective at generating questions in this exact area, and its solutions are mostly correct.
Exam note: ChatGPT is endorsed for generating practice problems here, but verify that its method matches the method taught in class, because multiple valid methods exist for the same problem and they can give slightly different results. This course is an entry-level treatment of unsupervised deep learning, so gaps between methods can appear; mostly, though, answers land on target relative to the material covered.
Recap: the training objective gains (smooth weight decay) or (weights driven to exactly zero), applied to weights only. Bridge: penalties act on values; the next constraint acts on structure — forcing the decoder's weights to be a mirror copy of the encoder's.
4.4 Tied Weights
What if a regularizer were not a number added to the loss, but a piece of architecture? Forcing the decoder's weights to be an exact mirror image of the encoder's weights costs nothing in code size, yet removes half the free parameters — and the interesting part is making gradient descent respect the mirror.
A special structural constraint can act as a regularizer: force the decoder weight matrix to be the transpose of the encoder weight matrix,
A concrete shape example from class: suppose the encoder maps a 4-dimensional input to 12 hidden units, so is a matrix (and the code is , where ); then the decoder mapping from those 12 units back down to 4 outputs, called , is a matrix — precisely the transpose of . Entry of always equals entry of : the strength of the connection from input into hidden unit is declared, by fiat, equal to the strength of the connection from hidden unit back out to output .
4.4.1 Why Plain Gradients Break the Constraint
If you run ordinary updates on both matrices, the constraint breaks immediately. Stated in words from class: for calculating the partial of the loss with respect to , only the output-side activation functions are used; but for , information flows through both layers.
Concretely, is read off directly at the decoder output layer, while must travel the full chain rule path: loss, then decoder, then through the hidden activations, before reaching the encoder weights. The two gradients are therefore different numbers in general. After one plain step,
so the freshly updated matrices stop being transposes of each other, and whatever benefit tying promised evaporates from iteration two onward.
4.4.2 Synchronized Updates Step by Step
The fix is a two-phase update computed every iteration. First compute temporary, unconstrained updates for both matrices:
Here plays the role of the step size in the update rule (what other texts often call ) — not the regularization constant of Section 4.3. Then synchronize by averaging: replace each temporary matrix by half of itself plus half of the transpose of the other. With and :
Why does this repair the constraint instead of just softening the damage? Check the transpose of the second expression:
Transposing swaps back to and back to , which returns exactly the first expression. So after synchronization, and agree identically and exactly, by construction, no matter what the two gradients did. The class phrasing "both become half of each temporary update" is this averaging rule; writing the two results as one line is shorthand for this pair, since lives in and in — they are transposes, not the same array. Shape check: if and , then , so the sum and average live in , matching .
Worked example: one synchronized update, entry by entry. Shrink the class's shapes to so the arithmetic fits on a page. Let
Suppose backpropagation reports
and take step size . Phase one, temporary updates:
Phase two, average with the transpose:
and . Look at any tied pair: entry started at in both matrices, but the two temporary steps pulled it to (decoder side) and (encoder side); the average sits exactly halfway. Every pair meets at the midpoint of its two temporary positions. Sense-check: reproduces exactly, so the mirror constraint survived the update.
4.4.3 Student Question: What Happens to Training Dynamics?
Q: If we synchronize the two weight matrices this way, what happens to the training dynamics — how do the weights evolve over time? A: Notice first that averaging deviates from pure backpropagation. Backpropagation alone would leave the two updated matrices different, because their gradients differ; forcing them equal means replacing both by the average of their changes. Observed consequences: training speed goes down, more epochs are needed to converge, and reconstruction error measured on the training set goes up compared with running without tying. The likely upside shows up on held-out data instead — see below.
4.4.4 Capacity, Cross-Validation, and Honest Expectations
Tying cuts the number of free parameters roughly in half. Capacity, here, means how many weights the model owns; fewer weights mean less capacity, and less capacity usually generalizes better. Count for the class example: untied, the encoder owns weights and the decoder another , giving . Tied, both halves share one matrix: . Half the knobs, same wiring pattern.
Intuition worth keeping: tying is a statistical technique, not an engineering upgrade. It trades fitting power on the data you have for reliability on data you have not seen yet. Training speed goes down while validation results will most likely improve.
This is also the right moment to recall how to judge any autoencoder fairly: use cross-validation. Training optimizes reconstruction error on the subset of data used for training, but the honest number comes from a held-out dataset the network never saw. Typically the held-out reconstruction error exceeds the training reconstruction error, and tying improves exactly that held-out number.
And a dose of statistical honesty: phrases like "possibly, most likely better" are the precise level of promise a machine learning method can make. This remains a statistics-driven technique rather than deterministic engineering; you cannot forecast exact performance in advance.
Common traps in this section:
- Running textbook backpropagation on a tied network without synchronizing — from iteration two onward the tie is broken and the regularizer is gone.
- Confusing the step size called here with the regularization constant called in Section 4.3; same letter, different jobs, announced in context.
- Expecting tied training to converge faster. It converges slower; the payoff is generalization, not speed.
Exam note: know the two-phase recipe cold: temporary unconstrained steps for both matrices, then set each to half of itself plus half of the transpose of the other. Be ready to justify why the averaged pair still satisfies — take the transpose of the encoder update and watch it return the decoder update.
Recap: tied weights halve capacity and slow training slightly, buying better expected performance on unseen data. Bridge: tying constrains the weights; the contractive autoencoder constrains the function — how violently the code may react when the input twitches.
4.5 Contractive Autoencoders
A third special regularizer asks a different question than L1 or L2: not how large are the weights, but how violently does the code react? If nudging the input by a hair swings the code wildly, the code is amplifying noise. The contractive autoencoder pays a price for every such swing until the code learns to stay still unless something real happens.
The idea: the encoded representation should not change unless the input changes significantly. Take a small example with three encoding nodes fed by inputs . For every hidden unit and every input coordinate, form the partial derivative , square it, and sum over all inputs and all hidden units. Stated in words from class: take this partial derivative of with respect to , square it, and sum over all inputs and hidden nodes; this has got to be minimized.
4.5.1 The Jacobian Penalty
Those partials arrange into a matrix — the Jacobian of the hidden outputs with respect to the input. The Jacobian is a grid of slopes: row , column answers "if input coordinate moves by a tiny amount, how much does hidden output move?"
where counts hidden units, counts input dimensions, and again balances the penalty against reconstruction error. Minimizing the sum of squares of every Jacobian entry forces those sensitivities toward zero: the hidden values stop responding to wiggles in the inputs.
For the single-layer encoder used throughout this lecture, , the entries have a closed form worth seeing once. The weighted input to unit is , so by the chain rule:
and squaring and summing collects into column norms:
Read this as a product of two brakes per hidden unit: , how awake the unit's activation currently is, times , the total squared strength of its incoming weights. The contractive penalty pushes down whichever brake is cheaper — calm the activations or slim the weights. One subtlety follows immediately: an activation sitting in its saturated flat region has and contributes nothing, which is why the penalty must be balanced against reconstruction error rather than minimized alone.
Worked numbers for one hidden unit. Let one code unit be with weights on inputs , bias , evaluated at .
- Weighted input: .
- Activation: ; slope .
- Penalty contribution of this unit: .
Now double both weights to : , , slope , weight norm squared . Contribution: — about 3.4 times larger. Bigger incoming weights make the unit twitchier, and the penalty charges accordingly. Sense-check: shrinking either factor (calmer activation or smaller weights) lowers the cost, exactly as intended.
4.5.2 A Quantized View of the Code
What does the trained representation look like? The encoding behaves like a high-dimensional quantized version of the original input space: nearby inputs collapse toward shared codes, the way quantization snaps nearby values onto one level. Decoding then acts as dequantization — the decoder maps those flattened hidden outputs back to reconstructions that stay close to the original data. Training a contractive autoencoder means creating exactly this: a quantized-looking hidden representation whose decode still reconstructs faithfully.
An everyday picture: rounding temperatures to the nearest degree. Readings of 20.4°, 20.6°, and 20.5° all snap onto 21°... or onto 20°, depending where the boundary sits; small measurement jitter vanishes because neighbors share a label. Decoding is then like reporting the typical weather associated with that rounded value. The analogy breaks in one honest way: the network's rounding boundaries are learned curved surfaces, not fixed grid lines, and they bend wherever the data demands finer distinctions.
4.5.3 When the Penalty Gets Too Strong
Watch the strength knob . Moderate buys insensitivity: the code ignores nuisance variation while still separating genuinely different inputs. Push enormous importance onto this penalty and everything freezes.
Failure mode at extreme : the penalty term dominates the objective, so the cheapest way to satisfy it is to drive every sensitivity to zero — the hidden outputs freeze at their initial values for every input pattern. The decoder then receives identical codes for different inputs, so it can only emit one average answer; the reconstruction loss explodes and the arrangement becomes meaningless. If your contractive autoencoder reconstructs nearly the same blob for every input, suspect an oversized .
Assumptions and scope:
- The Jacobian needs differentiable activations and continuous inputs; for binary or integer data the penalty is not directly defined.
- Because saturation makes , a network can lower the penalty by parking units in their flat regions rather than by becoming truly robust; keep reconstruction error in the objective so codes remain informative.
- The penalty constrains the encoder only; nothing here stops the decoder from being careless.
Recap: the contractive autoencoder minimizes reconstruction error plus times the squared Frobenius norm of the encoder's Jacobian, producing a flat, quantization-like code whose decode still reconstructs. Bridge: the next architecture buys the same robustness differently — instead of penalizing sensitivities, it corrupts the training inputs and demands clean outputs anyway.
Real-world placement: learned codes that ignore small perturbations matter wherever embeddings feed a downstream system — face-recognition pipelines, for instance, need identity codes that barely move when lighting shifts by a shade or a camera sensor jitters, which is precisely the insensitivity this penalty trains.
4.6 Denoising Autoencoders
Every autoencoder so far received clean data. The denoising autoencoder deliberately wrecks its own training data first — and that act of sabotage is precisely what forces it to learn something worth knowing.
A denoising autoencoder (DAE) encodes data so that unwanted noise variations get suppressed in the reconstruction. The twist sits in the training pipeline. Start with original unlabeled data. Corrupt it deliberately with noise. Encode the noisy version. Decode it. But define the loss so the reconstruction must match the original clean data — not the noisy input that actually entered the encoder.
Formally, with the corrupted copy of a clean input , and the two network halves, and the reconstruction:
Stated in words: the loss is formulated so the reconstructed data is similar to the original data, which never went into the encoder as input, because you added noise to it first. Training uses noisy data with the intention of recovering the original noiseless data through this structure. Once training ends, any signal or image passed through yields a representation that should be immune to whatever noise lurks in the original.
4.6.1 Corrupt, Encode, Decode, Compare with the Clean Original
Keep the target straight and everything else follows: the noisy version plays the role of input only; the clean original plays the role of label. The reconstruction error is measured against what was never seen by the encoder. This is why a DAE needs no human labels — the clean image is its own teacher — yet the setup behaves like supervised learning, with corruption playing the role of data collection.
A one-line mental model: an ordinary autoencoder asks "can you repeat what I said?"; a denoising autoencoder asks "can you say what I meant, even though I mumbled?" The second task cannot be solved by copying, so the code has to carry meaning rather than raw values.
4.6.2 Gaussian Noise and Salt-and-Pepper Noise
Two corruption styles came up, and the choice matters.
Gaussian noise. Unroll an image into one long vector of pixel values. Call the random generator in the scikit-learn toolbox and add uncorrelated Gaussian noise to each feature element independently:
with zero mean and standard deviation on each element, where is chosen by the designer. Every feature dimension gets corrupted — no pixel escapes. Values can drift outside the valid pixel range, so in practice you clip back to the legal interval after adding noise.
Salt-and-pepper noise. The name is literal: pepper stands for black, the value 0; salt stands for white, the value 255. The label "color noise" was avoided on purpose — salt-and-pepper is the standard name. Formally, each pixel of the corrupted copy obeys:
where is the corruption probability per pixel, set by the designer. Most of the image survives unchanged, with sprinkles of salt and pepper sprayed across it.
Worked arithmetic at (manifest example). Every pixel faces a 20 percent corruption chance, so about 20 percent of pixels turn fully black or fully white while the remaining 80 percent keep their original values. Splitting is allowed — out of the 20 percent corrupted pixels, send half to white (salt) and half to black (pepper), so both flavors appear; the pure-black variant adds only pepper. On MNIST digits, each image holds pixels, so one corrupted digit shows about destroyed pixels — roughly 78 white and 79 black on average — while about 627 pixels stay untouched. Sense-check: , so every pixel lands in exactly one of the three fates.
Terminology check: salt means white (255), pepper means black (0). Some descriptions call this "color noise"; stick with salt-and-pepper — it names exactly what happens to the values and it is what the literature calls it.
4.6.3 Worked Application: Restoring Old Family Photographs
Why train on synthetically damaged photos? Here is the classic scenario from class, walked end to end.
The restoration pipeline.
- Someone hands you physical prints of old family pictures — fifty, sixty, seventy years old, colors faded, paper damaged. Digitize them with a phone camera: the resulting images come out almost full of salt-and-pepper-type noise, and the damage pattern can be modeled reasonably well this way, depending on how the damage happened.
- Build a training set. Capture fresh photographs with a cell phone — your current family, nature scenes, anything. These are the clean images.
- Synthesize corruption. Apply the salt-and-pepper rule above to the fresh photos, producing noisy twins.
- Train the DAE: feed corrupted phone photos, demand reconstructions matching the original clean phone photos. The encoder-decoder combination thereby learns to remove synthetic salt-and-pepper damage.
- Test on the real target: pass the digitized old photo prints through the trained network. The damaged look fades and a reasonably recovered image comes out the other side.
Final answer: three distinct image sets play three roles — test images (the old prints), clean training images, and their synthetically corrupted copies. Sense-check: the network never trained on an old print, yet it cleans them, because synthetic salt-and-pepper and real aging damage share the same statistical shape.
4.6.4 Student Questions and Answers
Q: Since we are trying to denoise with autoencoders, there must be some threshold or tipping point of noise beyond which we cannot recreate the original image — beyond the 0.2 level, say. Is there such a criterion? A: First, a correction to the framing: when you say "recover the original image," you actually never recover it. What you get is a reconstruction carrying some residual reconstruction error — the process does not get rid of the damage completely. Now assume the architecture is fixed: number of dimensions and everything else stays put. If the corruption probability climbs from 0.2 to 0.5, things break down — half the pixels are destroyed and half kept, so typically it will not work, or the reconstruction will degrade badly. One lever remains: increase the capacity of the autoencoder using more hidden layers and more hidden nodes, which gives a better chance of recovering the original signal from the noisy one. Across the board, though, reconstruction error grows as the noise level rises.
Several students circled the same worry from another side — what the zeroed pixels are for:
Q: When we change certain pixels to 0 during training, the weight deltas touching those pixels swing very high or very low — and the zeroed set differs randomly every round. What are we eventually trying to achieve by setting to zero? How does the final latent variable differ from training without any zeroing? A: Think about a concrete application instead of abstractions. Zeroing random pixels teaches the network to reconstruct missing values from the surrounding context, so the code can no longer behave like a pass-through wire — it must store enough neighborhood information to fill gaps in. Compared with training without zeroing, the final latent variable therefore encodes content and context rather than raw pixel positions; the payoff is exactly the restoration use case worked through above, where a denoiser trained on corrupted fresh phone photos cleans digitized old prints whose damage resembles salt-and-pepper noise.
Q: Following up — in general, how does the network repair one damaged pixel? A: It learns to replace a damaged pixel with a weighted, nonlinear combination of the pixel values around it. To claim anything sharper you would visualize the learned weights, but broadly that nonlinear neighborhood blending is the mechanism. Keep perspective too: this is one way to denoise, not the only way.
| Contractive autoencoder | Denoising autoencoder | |
|---|---|---|
| Where robustness enters | A penalty on encoder derivatives | Corrupted inputs paired with clean targets |
| Training data | Clean throughout | Deliberately damaged |
| Code character | Flat, quantization-like | Noise-suppressing, context-filling |
| Watch out for | Extreme freezes codes | Too much noise breaks a fixed architecture |
When to pick which? If your deployed inputs arrive already noisy, train a DAE with that same noise; if they are clean but you fear sensitivity to tiny perturbations, contract the Jacobian.
4.6.5 Reading the Learned Filters on Handwritten Digits
One displayed example trains a denoising setup on MNIST handwritten digits — numbers 0 through 9 as 28 by 28 images, pixel values 0 or 255, possibly binarized further to plain 0/1. In a supervised-flavored variant, the decoder output layer carries one node per class: for an input digit 3, the corresponding node should activate while others stay quiet — the decoder effectively indicates which class the input belongs to, so this autoencoder trains in a supervised manner. Adding Gaussian distributed noise damages every pixel — zero mean, some standard deviation — yet the denoiser still trains against the clean originals.
After training, visualize the learned weights. Picture each filter drawn back on the 28 by 28 grid: dark and bright patches arranged along short diagonal and curved segments, resembling pen strokes — little edge detectors matching the strokes that draw handwritten characters, edges like those familiar from computer vision. Run the same setup with L2 weight decay instead, and the filters take on a granular, speckled texture, because weight decay spreads error reduction across all weights rather than sharpening a few. Either way, the hidden neurons behave like edge detectors, and those edges correspond to pen strokes.
Real-world placement: MNIST-style denoising remains the classic demonstration that unsupervised autoencoders discover edge-like visual features without a single label — the same edge vocabulary later exploited by convolutional networks. Beyond teaching examples, the corrupt-clean training recipe directly powers photo-restoration tools that strip grain and speckle from scanned prints.
Assumptions and scope:
- The corruption used in training should resemble the noise expected in deployment; a denoiser trained on salt-and-pepper has no special skill against blur.
- With a fixed architecture, reconstruction error grows monotonically as noise rises; past heavy corruption levels the model degrades no matter how well it trained.
- Residual error never reaches zero — "denoised" always means "closer," never "restored perfectly."
Recap: a DAE trains on but scores its output against the clean , so copying becomes impossible and the code must capture context. Bridge: corruption is one route to a meaningful overcomplete code; the next section replaces corruption with a firing budget — most units must simply stay silent.
4.7 Sparse Autoencoders
The sparse autoencoder attacks copying with a budget instead of noise: the hidden layer may be hugely overcomplete, but every unit is allowed to fire for only a small fraction of the time. Ten thousand inputs, and each unit gets maybe one hundred moments of glory — spend them carelessly and reconstruction falls apart.
The sparse autoencoder keeps the hidden layer highly overcomplete — many more coding units than inputs — and relies on a sparsity penalty to block trivial copying. Without any regularizer, an overcomplete autoencoder reproduces the identity: the reconstruction equals for every feature, since every value can flow straight through. Sparsity changes the incentive: each hidden node may fire — output a high value near one — only for a small fraction of training signals.
Worked firing-rate budget. Suppose each node should fire for about 10 percent of training signals and the training set holds 10,000 inputs. Then a given node reaches a high output only about times across the whole dataset — and the same budget applies to every other node individually. Sense-check: with units each active on ~100 patterns, the average code contains roughly active entries out of , so codes are about 90 percent zeros regardless of how overcomplete the layer is.
Once the network internalizes this budget, every encoding comes out mostly zeros with ones sprinkled at a few positions — and the positions arrange themselves so that decoding still recovers the original data to a large extent.
4.7.1 Firing Rates and the Sparsity Index
Everything hangs on measuring how often a unit fires. Let be the number of training points and let denote the output of hidden unit when input passes through. Average that hidden activation over all patterns:
Stated in words: sum this L-th hidden activation over all patterns, divide by , and you get a number between 0 and 1 indicating the fraction of training points for which this hidden output fires. This ("rho-hat") is an empirical mean — measured from the activations actually flowing through the network. Against it stands a designer-chosen target (plain "rho"), supplied externally: you decide the sparsity level your architecture should enforce, typically something small like 0.1 or 0.2, possibly smaller when the training data is large. The constraint applies to every hidden node, not just one — there is one measured rate and one target per unit.
4.7.2 The KL Divergence Penalty
The penalty pushing each empirical firing rate toward its target is the KL divergence, borrowed from previous coursework. Summed over all hidden units ( is the total number of hidden nodes):
A note on the logarithm's base, since class weighed the options openly: the choice does not change the mathematics. Changing the base multiplies every term by the fixed constant , which is indistinguishable from rescaling ; the location of the minimum never moves. Standard references define the KL divergence with the natural logarithm, so treat here as natural log and move on.
Each term compares two distributions over "fire or stay silent": the target distribution provided by the designer, and the measured distribution computed by the network. The whole expression reaches its minimum value of zero exactly when — two probability distributions agreeing perfectly — and it is strictly positive otherwise.
Picture the penalty curve: fix the designer's value at ; put the measured rate on the horizontal axis running from 0 to 1, and the penalty on the vertical axis. The curve dips to its minimum of zero right around , forming a valley that rises steeply toward both walls as the measured rate approaches 0 or 1. Any drift to either side costs penalty. Plug in one point to feel it: at ,
That valley shape is why this term works as a sparseness regularizer alongside the standard reconstruction loss.
4.7.3 Gradients and Weight Updates
Weight updates remain straightforward backpropagation on the combined objective — reconstruction loss plus the KL sum. One algebraic convenience helps by hand: expand each logarithm ratio as , splitting every KL term into pieces ready for differentiation.
Differentiating a KL term with respect to the weights uses the chain rule, and the inner derivative with respect to the measured rate comes out as follows, step by step. Write the term in expanded form, then differentiate piece by piece:
The two constant pieces vanish under the derivative; differentiating leaves , and differentiating leaves because the chain rule contributes a factor of from . Sanity-check the sign: when the measured rate sits below target (), the negative first term dominates, so raising lowers the penalty — exactly what the valley picture promised.
Then multiply by how the hidden output depends on the weights. The hidden activation takes the familiar affine form:
where is the chosen hidden activation function and is the weighted input plus bias. Writing for the weighted input of unit , the chain rule carries everything through to the parameters:
so each weight update combines three factors: how far the unit's firing rate sits from target (the KL derivative above), how awake the activation currently is (), and how much that weight influenced the weighted input. Practice this derivation by hand with pen and paper until it feels routine.
One clarification about balancing terms: wherever an L1 or L2 regularizer appears there is a constant controlling the trade-off between reconstruction quality and sparseness amount. That same constant applies here too; it was omitted from the displayed formulas for simplicity. If no is written, assume .
4.7.4 Student Questions and Answers
Two questions reached the same confusion — whether adding the machinery means regularizing the divergence all over again:
Q: For the loss function with the KL divergence, we are adding a rho term — are we regularizing the KL divergence again? A: No. Look at what the formula actually does. The sum runs over from 1 to , with the number of hidden nodes. Each inside is the sparseness index calculated empirically from whatever comes out of that L-th hidden node. The plain is the number provided externally by you, the designer of the autoencoder — you supply the target, such as 20 percent, 10 percent, or 1 percent firing, whatever suits the architecture. So nothing gets double-regularized; the formula simply measures how far each empirical rate sits from its designer-chosen target.
Q: Where is lambda in this rho function? Something must control the balance between reconstruction quality and the amount of sparseness. A: Every place an L2 or L1 regularizer is used there is also a regularization constant, and that same constant can be applied here. It was left out of the written formulas for simplicity, so assume lambda equals one when it is not shown.
Real-world placement: sparse codes give complex real-valued data a discrete disguise — most entries zero, a few ones — so clustering original data into a few groups becomes easy, and the scheme supports dictionary learning, where a learned dictionary of prototype atoms combines to rebuild real signals. Sparse encodings also reveal which feature dimensions matter most across the dataset, since only a handful are ever recruited.
4.7.5 A Practice Routine You Can Run Today
Ask ChatGPT to create a tiny sparse network for practice: two inputs, two hidden nodes, and two outputs, with a sparseness target of 0.2 plus a small training set. Then request step-by-step calculation: how the forward outputs are computed, how the loss function is evaluated, how sparseness is measured, and how the weights change iteration by iteration while the overall loss falls. Working through one full cycle by hand cements the whole pipeline.
Common traps in this section:
- Reading and as the same kind of object: one is a fixed design constant, the other is measured from live activations and changes every iteration.
- Forgetting the per-unit structure: the sum runs over all hidden units, each with its own empirical rate.
- Dropping mentally when it is absent from the formula — assume it equals one, do not assume the balance vanished.
- Expecting sparsity in the weights (that was L1 in Section 4.3); here the activations are what become sparse.
Recap: a sparse autoencoder adds times the sum of KL divergences between each unit's measured firing rate and the designer's target , producing mostly-zero codes that decode faithfully. Bridge: one hidden layer with a budget already works well — stacking layers makes it work better, which is where deep autoencoders take over.
4.8 Deep Autoencoders
Every autoencoder drawn so far had a single encoder layer and a single decoder layer — but that was a diagram-saving shortcut, not a design recommendation. The question this section answers: what do you gain by stacking layers, and can you prove the gain rather than take it on faith?
Deep means depth: several layers stacked between input and code and back out, instead of the one encoder layer used in every illustration so far. Single-layer pictures existed only to keep diagrams simple. The advantages of adding layers mirror what supervised deep learning already taught: deeper representations capture structure shallow stacks cannot — low-level pieces compose into parts, parts into wholes, and each level of composition costs only one extra layer of width.
4.8.1 Linear, Shallow, Deep: The Performance Ladder
Three rungs form the comparison ladder:
- At the bottom sit linear autoencoders: both halves are plain matrix multiplications with no nonlinearity. These are, in effect, principal component analysis (PCA) — a linear encoder compresses exactly the way PCA does, projecting data onto its top directions of variance. This is worth pausing on: with linear maps, minimizing squared reconstruction error has the same optimum as PCA's eigen-decomposition, so "autoencoder" and "PCA" name the same machine at the bottom rung.
- One rung up sit shallow nonlinear autoencoders: few layers but a genuinely nonlinear hidden activation , which could be as simple as ReLU, or ELU (exponential linear unit) and relatives met in deep neural network coursework. Nonlinearity lets the code bend the compression surface to fit curved data manifolds, something no straight projection can do.
- At the top, deep autoencoders add hidden layers and perform even better, because each added layer gives the code another chance to re-describe what it sees at a higher level of abstraction.
So the claimed ordering: a deep autoencoder beats the corresponding shallow autoencoder, which beats a linear one. Assignment one asks you to verify this yourself on datasets in your own implementation — the claim becomes your experiment, not just a slide bullet.
Picture the evidence as a bar chart: three bars left to right labeled Linear, Shallow nonlinear, Deep; the vertical axis is reconstruction error on held-out data. Each bar steps down from the one before it, the deepest bar shortest — same code size everywhere, so the only thing changing is representational power.
Node accounting makes the point concrete. In one drawn example, the deep stack contains eleven hidden units in total between input and output layers. To match the same reconstruction error with just one hidden layer, you would need a very large number of hidden units — and then regularization too, otherwise the layer tips into overcomplete territory where copying takes over (Section 4.2's trap all over again). Depth buys expressive reach per parameter; width alone cannot.
| Rung | Architecture | Equivalent to | Reconstruction quality |
|---|---|---|---|
| Bottom | Linear encoder + decoder | PCA | Baseline |
| Middle | Shallow stack, nonlinear | Nonlinear generalization of PCA | Better |
| Top | Deep stack of layers | Hierarchical representation | Best at equal code size |
When to pick which? If your data is close to flat (linear correlations dominate), PCA is honest and cheap; for images, speech, or any curved manifold, nonlinear depth wins at the same budget.
4.8.2 What Deep Codes Enable
The primary objective stays dimensionality reduction, also called representation learning. On top of that foundation, deep codes support classification, denoising (feed a corrupted input through encoder and decoder, Section 4.6), image inpainting — editing or completing an image — and segmentation performed on deep features.
Scope and traps:
- Depth helps only when combined with an appropriate bottleneck or regularizer; a deep overcomplete network still learns to copy.
- The ladder ordering is empirical, verified per dataset by your assignment — treat it as a strong prior, not a law of nature.
- Comparing rungs fairly requires holding the code size fixed across all three architectures; otherwise you are measuring capacity, not architecture.
Exam note: assignment one carries two verification tasks here — confirm empirically that deep autoencoders beat shallow nonlinear ones, which beat linear (PCA-style) ones. Plan your experiment around a fixed code size so the comparison is fair.
Recap: depth stacks re-descriptions of the code, and linear autoencoders turn out to be PCA exactly. Bridge: for images, though, dense matrix layers waste parameters rediscovering translation structure — convolutional encoders reuse their weights across every image location, which is where the next architecture begins.
4.9 Deep Convolutional Autoencoders
A fully connected layer treats pixel and pixel as total strangers, even though both are "somewhere in the upper area" of an image. Convolutional layers share their weights across every location — and when the data is images, that one change buys better reconstructions with far fewer parameters.
For images, replace fully-connected layers with convolutional ones. The resulting architecture partly resembles the CNN designs you already know: blue blocks of convolution followed by batch normalization and ReLU, green pooling blocks that shrink the maps, dropout sprinkled in for regularization, and max pooling stepping sizes down. The encoder is a familiar image-classifier trunk; the twist is what replaces its classification head — a mirrored decoder that grows the picture back.
The whole network is a procedure applied to an image, so walk it as one:
Purpose. Compress a large color image into a small feature map that keeps enough content to rebuild the original, then rebuild it — learning every filter from reconstruction error alone.
Inputs and outputs. In: one color image of roughly pixels (three channels). Out: a reconstructed image of the same size, plus the small bottleneck map in between.
Steps. Encoder: alternate convolution (with batch normalization and ReLU) and stride-2 pooling until the map is small; decoder: alternate transpose-convolution upsampling with convolution until the original size returns; compare output to input; backpropagate; adjust all filters. No labels anywhere.
4.9.1 The Encoder Path: Convolution, Batch Normalization, Pooling
Follow the numbers on the color-image example. Each stride-2 pooling halves both side lengths; after four such reductions the side lengths shrink by a factor of . That small map is the encoded representation produced by the encoder path — the code, in image form.
Worked dimension bookkeeping. Start from :
| Stage | Spatial size | Operation |
|---|---|---|
| Input | — | |
| After pooling 1 | stride-2 pooling | |
| After pooling 2 | stride-2 pooling | |
| After pooling 3 | stride-2 pooling | |
| Code (after pooling 4) | stride-2 pooling |
Check: and , matching the drawn example's "about 15 by 16". While space shrinks, depth typically grows — early blocks carry few channels, deeper blocks carry many, so the code trades width for richness. Sense-check: four halvings equal one sixteenth, exactly the factor the class quoted.
4.9.2 Batch Normalization Refresher
Because batch normalization appears in every block, refresh what it is and why it exists — this could be a basic question in any machine learning job interview, so it is not a fringe concept.
Q: Can you remind me why batch normalization exists — its objective, without the math? A: It applies per mini-batch during backpropagation training. The goal is keeping the statistics of each mini-batch more or less unchanged across different hidden layers of the deep network, which speeds up training. You calculate the mini-batch mean, subtract it, then normalize so the spread holds near a constant variance. Extra trainable parameters come along, plus some non-trainable running statistics.
Mechanically you compute the mean of the mini-batch, subtract it, then rescale so the spread settles near unit variance; two learned parameters per channel (a scale and a shift) let the network undo the normalization where it helps. Batch normalization also carries non-trainable running statistics, accumulated during training and used at inference. It is close to a must for mini-batch-based training of deep networks, letting models converge within noticeably fewer epochs.
A related history lesson on generalization methods, since several students asked:
Q: Besides L1 and L2, what else improves generalization of deep networks? A: Increasing the sample size through data augmentation counts — flips, crops, and color jitters manufacture new training examples for free — and dropout does too: units are switched off at random during training so no single path can be relied upon. Dropout was heavily preferred in the stretch around 2015 through 2017; once batch normalization matured, people found they could largely stop worrying about it. Both remain fair interview material — brush up if either feels distant.
Exam note: batch normalization is named explicitly as a basic machine learning interview question. Know its purpose (stable per-layer mini-batch statistics), where it applies (per mini-batch during training), and its effect (fewer epochs to converge) — without needing formulas.
4.9.3 The Decoder Path: Transpose Convolution Upsampling
The decoder reverses the journey, and here sits the genuinely new piece: instead of striding down, stride up. Where the encoder pooled from large image to small feature map, the decoder applies fractionally strided convolution — also called transpose convolution — with upsampling steps of two, mirroring each stride-2 pooling. Intuition for the operation itself: ordinary convolution asks "given a patch, how strongly does it match my filter?" and produces one number; transpose convolution runs the same wiring backwards, asking "given one number, paint the patch it should have come from" — each input value spreads a learned pattern outward, overlapping neighbors stitch together, and the map grows. The filters doing the painting are learned, like everything else here.
The map grows back along exactly the mirror of the encoder's staircase: about becomes , then , then , continuing until the original color image returns. Transpose convolution was taught in the deep neural network course even though none of its architectures used it — now you see where it earns its place. At the end, compare the reconstructed image with the original and train by minimizing reconstruction error, adjusting the filters in the encoding layers as usual. No labels are needed anywhere in the whole structure.
Real-world placement: this encoder-decoder shape with a transpose-convolution decoder powers modern image inpainting tools — networks that edit photographs by filling damaged or removed regions with plausible content — because growing a clean image out of a compressed code is exactly what the decoder practices all day.
Exam note: assignment one asks you to train this kind of deep convolutional autoencoder yourself, aiming for high-quality reconstruction. Details were deliberately left open so there is room for your own experimentation.
4.9.4 Comparing Reconstructions: Deep Autoencoder versus PCA
One displayed comparison uses MNIST handwritten characters at 28 by 28 pixels. Three reconstructions appear side by side, all squeezed through a 30-dimensional code: a 30-dimensional deep autoencoder, 30-dimensional logistic PCA, and 30-dimensional plain PCA. The deep autoencoder reconstruction is visibly sharper and clearer than either PCA variant — strokes stay crisp while the linear versions blur toward average-looking digits. Push further to deep convolutional networks and performance improves again. The takeaway stands for your own assignment experiments: nonlinear codes beat linear ones at equal code size, and convolutional nonlinear codes beat dense ones on images.
Scope and traps:
- Track dimensions at every block; if a size refuses to halve cleanly, decide deliberately how to pad or crop rather than discovering it in an error message.
- Batch normalization presumes mini-batches; with tiny batches its statistics get noisy and its benefits shrink.
- Transpose convolution can leave faint grid-like artifacts when misconfigured — check your stride and kernel size against the pooling it is meant to mirror.
Recap: a convolutional encoder shrinks sixteenfold to through shared-weight filters, and a transpose-convolution decoder paints the image back — trained end to end on reconstruction error alone. Bridge: everything so far compresses and rebuilds. The next family adds one idea with enormous consequences: make the code itself a probability distribution, and you can sample from it to invent new data.
4.10 Preview: Variational Autoencoders
One autoencoder family stayed out of today's scope on purpose. Before it appears, hold this teaser: a network trained only to rebuild its training images can later be asked for "a face, any face" — and it will emit a smiling woman wearing sunglasses, even though no such image existed anywhere in its training set. Where did that face come from?
The family is the variational autoencoder (VAE), which opens right after the mid-semester examination. It carries applications into generative modeling and counts among the classic generative AI designs. The VAE still belongs to the autoencoder category — encoder, code, decoder, reconstruction error — and the difference is entirely in the regularizing functional, which takes a different type.
4.10.1 A Penalty That Shapes a Distribution
Every regularizer met today pushed on values: weight sizes (L1/L2), tied structure, derivative magnitudes (contractive), firing rates (sparse), or noise robustness (denoising). The VAE constraint targets the latent space itself: the probability distribution associated with the auto-encoded space is forced toward a zero-mean Gaussian. Train with that functional and you get a compact encoder whose latent space supports something no ordinary autoencoder offers — sampling.
Why does distribution-shape matter so much? An ordinary autoencoder's codes scatter wherever they please: between two occupied code regions lie empty gaps, and if you invent a code point inside a gap, the decoder produces garbage — nobody ever trained it there. A Gaussian-shaped latent space has no gaps: every point sits near training codes, so every point you can name decodes to something sensible.
A map analogy helps: an ordinary autoencoder builds cities — dense blocks of valid codes separated by wilderness where decoding fails. A variational autoencoder builds road cover across the whole country; drive (sample) anywhere and you still find a usable destination. The analogy breaks where all analogies about learned spaces do: the "roads" are high-dimensional curved regions, not flat lines on paper.
4.10.2 Sampling New Faces from the Latent Space
Here is the classic demonstration. Train a variational autoencoder on a large set of human faces varied along many axes: male and female, some wearing sunglasses and some not, some smiling and some not, different skin tones, some looking straight at the camera and some sideways. After training, draw a random sample from the latent space — that is, pick coordinates from a standard zero-mean Gaussian — and pass through the decoder.
The output might be a smiling woman wearing sunglasses — a combination absent from every training image, yet completely meaningful. The model recombined learned factors of variation (smile from some images, sunglasses from others) into one coherent new arrangement.
That is the essence of a generative model: manufacture new data that is valid and useful yet never appeared in the training set, created purely by sampling the learned latent space. So the VAE provides a powerful paradigm for learning the probability distribution of data — the continuation of the autoencoder story with a distribution-shaped penalty.
Visual intuition for the mechanism: imagine the latent plane as a grid over which decoded outputs morph smoothly — walking east turns neutral expressions into smiles, walking north adds sunglasses. Landmarks sit at training clusters; the paths between them are what sampling travels. One-sentence takeaway: shaping the latent distribution into a smooth blob turns a compressor into an inventor.
Recap: a VAE keeps the autoencoder skeleton and swaps the regularizer for one that pulls the latent distribution toward a zero-mean Gaussian, unlocking sampling of never-seen-yet-valid data after the mid-semester break. Bridge: the VAE is one route to learning . The rest of this session switches tracks entirely — models built directly around likelihood, starting with autoregressive thinking.
4.11 Autoregressive Models and Likelihood Thinking
From here to the end of the course the theme shifts. Instead of compressing and rebuilding data, models now learn the probability distribution of the data itself — then create new samples by drawing from that distribution like tickets from a lottery drum. The first family for this job is built on one disarmingly simple habit: predict only from the past.
The first family of models for this job is autoregressive and likelihood-based. Likelihood-based thinking goes back to earlier statistics coursework; here it powers learning probability distributions of data directly.
4.11.1 What Autoregressive Means
The name says it: a particular variable depends on whatever variables appeared in the past — never on the future. Each prediction reaches backward only. In symbols, a model of the sequence is built from conditionals of the form : the next value given everything before it. The word "auto" marks that the model's own previous outputs become its future inputs at generation time.
4.11.2 The Familiar RNN Connection
You already know one autoregressive system: the recurrent neural network (RNN) doing next-word prediction. Once trained, feed it a word or a letter; conditioned on that history, it generates the next word, then the next, each output conditioning on everything generated so far, until a stop symbol arrives. Whatever appears at each step depends only on what happened in earlier steps — the autoregressive recipe in action. Text generators you use daily run exactly this loop under the hood.
4.11.3 The Model Roadmap: Masking, WaveNet, PixelCNN
Several specific models fill the coming sessions:
- Masking-based methods. Mask out information from the future so training uses past data only. A mask is just a pattern of blocked connections that makes "no peeking ahead" structural rather than aspirational.
- MADE (Masked Autoencoder for Density Estimation). A classic method: an ordinary feedforward network whose weights are masked so each output sees only earlier inputs. Even if it sees little direct use today, it inspired many methods in service right now.
- WaveNet. An autoregressive model suited to speech signals; a variant still drives text-to-speech products. Real-world placement: the underlying technology supports dubbing — replacing the dialogue track of one speaker with another speaker's voice while keeping the video intact.
- PixelCNN. Convolutional networks performing density estimation on image pixels, introduced next.
4.11.4 PixelCNN's Product Rule over Pixels
How can a CNN estimate a distribution over images? Take images with pixels , drawn from many training examples — say 10,000 images. Look at how the intensity of the very first pixel varies across those images and fit a distribution to it. Then predict the second pixel's distribution based on what came before it, and continue pixel by pixel, each one conditioned on its predecessors. Stated in words: the overall distribution of the whole image is the product of these per-pixel distributions, and maximizing that product — the likelihood — uncovers the parameters of the distribution.
This is the chain rule of probability applied along pixel order:
Two things make this more than bookkeeping. First, the factorization is an exact identity — true for every joint distribution, with no independence assumptions anywhere. All modeling freedom hides inside the chosen form of each conditional, not in the product itself. Second, training turns multiplication into addition: maximize , equivalently minimize the negative log-likelihood , which decomposes into per-pixel terms a CNN can compute in one pass when its masks hide the future. The convention fixing "the past" is a raster scan: left to right, top to bottom, as reading order. Maximizing this likelihood-based objective is the basic principle behind CNN-driven density estimation of images.
Worked micro-example: a 2-pixel binary image. Let each pixel be 0 or 1, ordered then , with fitted tables:
Multiply out all four joints using the product rule:
Final answer: the four joint probabilities are . Sense-check: they sum to exactly , as any valid joint distribution must — and generating works in order: flip a coin weighted 0.7 for , then draw from whichever conditional row matches.
Recap: autoregressive models factor a joint distribution into per-step conditionals over the past, train by maximizing likelihood, and generate step by step — from RNN text to WaveNet speech to PixelCNN images. Bridge: what is a learned distribution actually good for? Three jobs — synthesis, compression, and anomaly detection — where the last one falls out almost for free.
4.12 Three Jobs for a Learned Distribution
Why go to all this trouble to learn ? Because one fitted distribution pays three salaries at once: it can create data you never had, compress data you do have, and flag data that should not exist at all. The third job turns out to be almost a free bonus — as the worked example below shows, once the machinery is visible, spotting an outlier stops being a question.
Three goals justify learning the distribution of your data:
- Synthesizing new data — images, videos, speech, text — where whatever you generate should be a valid sample drawn from the learned distribution.
- Compressing data, because storing the parameters of a learned distribution costs far fewer numbers than storing the raw dataset — that is what constructing efficient codes means.
- Anomaly detection.
4.12.1 Worked Example: Is 25 an Outlier?
Anomaly detection falls straight out of the framework. Suppose these samples arrive from a one-dimensional Gaussian distribution:
Question: is 25 an outlier? Walk the full path, five steps.
Worked example: fitting the Gaussian by MLE, then judging the test point.
Step one — write the density. Stated in class as: one over root two pi sigma, times e to the power minus x minus mu squared over two sigma squared:
where is the mean and the standard deviation of the Gaussian.
Step two — estimate and by maximum likelihood estimation (MLE) — material from earlier statistics and machine learning coursework, where MLE also trains logistic regression. With all samples independent of each other, the likelihood multiplies the density evaluated at every sample:
So the first factor plugs 13 into the formula, giving the probability that value 13 occurs under the candidate Gaussian; then 4; then the rest.
Step three — tame the product with a logarithm. Taking the log turns the product into a summation, and since each factor contains an exponential, the log leaves a simple closed form. Written out fully, the negative log-likelihood over samples is:
The class simplified this by dropping the constant term and writing
and the simplification is legitimate for finding the optimal mean: does not involve at all, so it cannot move 's minimum — it only shifts every candidate score equally. One boundary matters though: if you also optimize , that dropped term is the only place survives, so keep it for the variance step. Proportional notation () means exactly this: same minimizer, rescaled value.
Step four — differentiate and set to zero. For the mean, holding fixed:
For the variance, keeping the full expression from step three and differentiating with respect to gives , which rearranges to . The result: the best-fitting Gaussian has its mean and spread fixed by these two formulas. Now plug the actual six numbers in: the sum is , so . The squared deviations are , so and .
Step five — judge the suspect. Plug the test point 25 into the fitted distribution and read off its probability. The standardized distance is — five standard deviations out. The density there evaluates to
In class the verdict was phrased with a small illustrative figure — "around 0.002, say" — and the precise number depends on how you read it (the bare density, the chance of landing in a small interval around 25, or a one-sided tail probability). Every reading lands far below any reasonable threshold, so the conclusion is identical: the chance that this point belongs to the learned distribution is negligible, and you call it an anomaly.
Final answer: fitting the Gaussian gives , ; the test point 25 sits about five standard deviations away with a vanishingly small fitted probability, so it is declared an anomaly. Sense-check: 25 lies beyond every training sample by a wide margin, which any sensible detector must flag.
4.12.2 Classroom Exchange: Nearest Neighbors versus Fitted Probabilities
A natural instinct proposed in class was to hunt for anomalies by proximity:
Q: How would anomaly detection work within this likelihood-based setting? Something like nearest-neighbor detection, perhaps? A: Nearest-neighbor ideas belong to general anomaly detection, and the instinct is reasonable — odd points sit far from familiar ones. But inside this framework there is a more direct route, which is why the question is nearly self-answering. The goal of a likelihood-based model is to maximize the probability of the data; the maximization outputs the parameters of the fitted distribution. So fit the distribution to your samples, then evaluate the suspicious point under that fitted distribution: if its probability lands very small, declare it an outlier. No neighbor counting required — the fitted probability itself is the test. Why the neighbor idea gets set aside here: it needs distance judgments against stored examples, while the fitted distribution summarizes everything into a few parameters and answers instantly.
4.12.3 Scaling Up: From Six Numbers to Images
The toy example used six scalar samples. Even a small 28 by 28 image makes live in 784 dimensions, and a modest 128 by 128 color image with 3 channels pushes dimensionality past 49,000. Two hard requirements follow. First, the method must work well in high-dimensional space even when the training set covers that space sparsely — learn the distribution from sparse high-dimensional data and still expect good generalization. Second, learning must be computationally efficient, and the chosen form of distribution must be easy to sample from.
4.12.4 Sampling Speed Matters Too
Ease of sampling is not enough; speed counts as well. Generating new data should happen fast — ideally all pixels produced in parallel rather than one after another. This requirement quietly rules some families in and others out: autoregressive models generate sequentially by construction, which is exactly the behavior Section 4.13 will return to.
Assumptions and scope:
- The closed-form estimates above assume the data truly follows a single Gaussian; heavy skew or multiple clusters need richer models before the fitted probability can be trusted.
- MLE's variance formula divides by , not ; with tiny samples it slightly underestimates the spread compared with the unbiased estimator taught in statistics courses.
- Declaring an anomaly requires choosing how small "too improbable" is — a design threshold, not something the mathematics supplies.
Recap: one learned distribution serves synthesis, compression, and anomaly detection; for Gaussian data, MLE hands you the sample mean and the average squared deviation, and any new point scores by its fitted probability. Bridge: different model families fill these jobs with different strengths — so what would the perfect generative model look like? Time for a checklist.
4.13 The Wishlist for Modern Generative Models
Suppose a genie offered to build any generative model you describe. What would you ask for? Writing that list carefully — accuracy, speed, fidelity, size — turns out to organize the whole research landscape: every existing system is a different answer to which wish gets granted and which gets traded away.
Assemble every requirement raised across the session and you get the checklist against which generative models are judged.
4.13.1 Six Desirable Properties
| Property | What it demands | What its absence looks like |
|---|---|---|
| Accurate modeling | The distribution must capture the training data faithfully | Generated samples drift away from the data's real patterns |
| Efficient training | Reaching that accurate fit must be fast | Weeks of compute for one model version |
| Expressiveness and generalization | Sampled outputs must align with the training domain — sample from a distribution over faces and decode: another human face, never a dog | Nonsense outputs outside the training domain |
| Sampling quality | Generated items should look crisp, without artifacts or damage, no missing facial parts | Blurs, ghost limbs, garbled text |
| Sampling speed | Generation should run rapidly, ideally with all pixels produced in parallel | One pixel at a time, seconds or minutes per sample |
| Compression rate | The learned distribution should carry few parameters | A "compressed" model larger than the data it summarizes |
Read the table as a set of simultaneous constraints: each row alone is achievable today; all six rows together have never been met by one system.
4.13.2 Why No Single Model Wins
No existing model satisfies every item fully — which explains why the landscape keeps multiplying: ChatGPT, Anthropic, Gemini, and many others coexist, each strong somewhere on the list and weaker elsewhere.
Watch ChatGPT generate a complex design document: the whole document never appears in one shot; it emerges iteratively, sentence after sentence. That iterative behavior is the slow sequential sampling showing through — the same autoregressive, past-only generation met in Section 4.11. These systems still do remarkable work, but many dimensions remain open for improvement — and that gap is exactly where research continues.
The practical reading of this section: when you meet any generative model in the coming sessions, interrogate it against these six properties. Asking "where does it sit on the checklist?" replaces vague impressions with a precise comparison, and it predicts exactly where the next generation of systems will try to improve.
Recap: six properties — accurate modeling, efficient training, expressiveness, sampling quality, sampling speed, compression rate — form the judging rubric; no current model satisfies them all, and visible symptoms like token-by-token document writing reveal sequential sampling under the hood. Bridge: this closes the session's arc — regularized autoencoders taught how pressure shapes codes, and likelihood thinking opened the road to models that generate. The coming sessions walk that road family by family.
Real-world placement: the checklist explains product strategy across the AI industry — voice assistants prize sampling speed, image tools prize sampling quality, and API providers prize training efficiency, so each vendor's flagship reflects a different bet about which property users will pay for.
Exam Guidance Summary
- Backpropagation mastery is assumed in the exam: expect to compute weight updates for autoencoder architectures and for any architecture covered in this course. Review it until applying it is mechanical.
- The mid-semester examination falls roughly four to five weeks after this session; everything from the regularized-autoencoder stretch onward is fair game.
- Assignment one carries two verification tasks: confirm empirically that deep autoencoders beat shallow nonlinear ones, which beat linear (PCA-style) ones; and train a deep convolutional autoencoder to produce high-quality reconstructions, with design details intentionally left open for experimentation.
- Past question papers were promised for upload as practice material; problem-solving webinars follow later, including sessions devoted to working through past papers.
- ChatGPT is endorsed for generating practice problems in this area — its solutions are mostly correct — but always check that its method matches the class method, since multiple valid methods can give slightly different results.
- Batch normalization is named explicitly as a basic machine learning interview question, not a fringe concept; know its purpose (stable per-layer mini-batch statistics), where it applies (per mini-batch during training), and its effect on training speed (fewer epochs) without needing formulas.
Study priorities in one line: drill backpropagation by hand until routine, start the assignment experiments early enough to iterate, and keep the tied-weight synchronization recipe and the sparse-autoencoder KL penalty sharp — both are the kind of derivations assessments like to request.
Key Industry Applications
- Text-to-speech and dubbing. WaveNet-style autoregressive models still drive speech generation products, including dubbing pipelines that replace one speaker's dialogue with another speaker's voice while keeping the video untouched.
- Photo restoration. Denoising autoencoders trained on synthetically corrupted fresh photographs can clean digitized old family prints whose damage resembles salt-and-pepper noise — the corrupt-clean training recipe at work.
- Image inpainting. Deep convolutional encoder-decoder pairs underpin tools that edit or complete images, growing clean content out of a compressed code via transpose convolution.
- Practice tooling. ChatGPT serves as an on-demand problem generator for this subject area, with method verification left to the student.
- The generative model industry. No single system meets every desirable property — accurate modeling, fast training, expressiveness, sampling quality, sampling speed, compression — which is why ChatGPT, Anthropic, Gemini, and many competing systems coexist, each strong on different axes of the checklist.
Pattern to notice: three of these applications share one skeleton — an encoder that compresses and a decoder that rebuilds. What changes between products is the pressure applied during training (noise, bottleneck size, distribution shaping), which is exactly the design axis this lecture explored.
UDL Lecture 4 notes · Regularized Autoencoders and Likelihood-Based Generative Models
Sections Breakdown
Why bottlenecked encoders lose information, which activations and losses fit each input type, and the backpropagation fluency this course assumes.
Why an overcomplete autoencoder degenerates into copying, and how adding a regularization penalty restores a meaningful code.
Weight-only penalties: the L2 objective with weight decay and the L1 lasso that drives weights exactly to zero; why biases stay outside.
Forcing the decoder matrix to equal the transpose of the encoder matrix using synchronized averaged updates, and what tying costs and buys.
The Jacobian penalty that makes codes insensitive to small input changes, its per-unit form, and the freeze-up caused by extreme lambda.
Corrupt, encode, decode, and score against the clean original; Gaussian and salt-and-pepper noise; restoring old photographs end to end.
Measuring per-unit firing rates, penalizing deviation from a designer-chosen target with KL divergence, and deriving the weight updates.
The performance ladder from linear autoencoders (equivalent to PCA) through shallow nonlinear to deep stacks at a fixed code size.
Convolution, batch normalization, and pooling on the encoder path; transpose convolution growing the image back on the decoder path.
How pulling the latent distribution toward a zero-mean Gaussian turns the familiar encoder-decoder skeleton into a generative model.
Predicting each variable from its past only, and PixelCNN's exact product-rule factorization of the joint density over pixels.
Synthesizing, compressing, and flagging anomalies with one fitted distribution, worked fully through Gaussian maximum likelihood.
The six desirable properties used to judge generative models, and why no existing system satisfies them all at once.
What assessments assume and cover: backpropagation fluency, the assignment-one experiments, and interview-level basics such as batch normalization.
Where these techniques run in production: text-to-speech and dubbing, photo restoration, image inpainting, and competing generative systems.
Exam Revision Notes
Below is the distilled, exam-ready core. Every entry comes from the full explanation above. Use this section for rapid review; return to the main notes when a point needs more context.
Recap: Undercomplete Autoencoders and Lossy Encoding
Must-know: Undercomplete means fewer hidden nodes than inputs; encoding is lossy; better architecture = good reconstruction at smaller code size.
⚠️ Top pitfall: Judging an autoencoder by reconstruction alone instead of reconstruction quality relative to code size.
Self-check: Why does an undercomplete code lose information even with perfect training?
Connects to: Overcomplete Autoencoders Need Regularization (4.2).
Overcomplete Autoencoders Need Regularization
Must-know: Overcomplete + unregularized = identity copy = useless code; regularized autoencoders get their name from the penalty that fixes this.
⚠️ Top pitfall: Assuming more hidden nodes always help; past input size, unconstrained capacity invites copying.
Self-check: Name the three autoencoder-specific penalties and the architecture each one produces.
Connects to: L1 and L2 Regularized Autoencoders (4.3); Contractive Autoencoders (4.5); Denoising Autoencoders (4.6); Sparse Autoencoders (4.7).
L1 and L2 Regularized Autoencoders
Must-know: L2 penalty = lambda*||theta||^2 gives per-step decay factor (1-2*lambda*eta); L1 = lambda*||theta||_1 pulls every weight by a constant amount toward zero; biases never regularized.
⚠️ Top pitfall: Regularizing the biases, or forgetting that theta includes both W and W* but not b and c; also confusing sparse weights (L1 here) with sparse activations (Section 4.7).
Self-check: Why does the L1 update reach exactly zero while the L2 update only approaches it?
Connects to: Tied Weights (4.4); Sparse Autoencoders (4.7).
Tied Weights
Must-know: Synchronized tied update: W*_next = 1/2(A + B^T) and W_next = 1/2(A^T + B); taking the transpose of W_next returns W*_next, so the constraint holds exactly after every iteration.
⚠️ Top pitfall: Running plain backpropagation on a tied network: the two gradients differ, so one unconstrained step breaks W* = W^T permanently.
Self-check: Why does averaging keep the two matrices exact transposes of each other?
Connects to: L1 and L2 Regularized Autoencoders (4.3); Contractive Autoencoders (4.5).
Contractive Autoencoders
Must-know: Penalty = lambda * sum over j,i of (dh_j/dx_i)^2 = sum_j g'(a_j)^2 ||W_:j||^2 for a single-layer encoder; extreme lambda freezes codes at their initial values.
⚠️ Top pitfall: Setting lambda too large: hidden outputs freeze at initial values for every input, reconstruction loss explodes, and the autoencoder becomes meaningless.
Self-check: For h = tanh(w^T x + b), what two factors multiply to form this unit's penalty contribution?
Connects to: Tied Weights (4.4); Denoising Autoencoders (4.6).
Denoising Autoencoders
Must-know: DAE objective: x_tilde = noise(x), x_hat = dec(enc(x_tilde)), L = ||x - x_hat||^2 measured against the clean original; at q = 0.2 about one fifth of pixels are destroyed (half salt, half pepper); recovery is never complete.
⚠️ Top pitfall: Believing there is a noise tipping point below which the original is fully recovered; a residual reconstruction error always remains, and high corruption breaks a fixed architecture.
Self-check: In a 28x28 MNIST image corrupted at q = 0.2 with an even salt/pepper split, roughly how many pixels turn white?
Connects to: Contractive Autoencoders (4.5); Sparse Autoencoders (4.7).
Sparse Autoencoders
Must-know: rho_hat_L = (1/m) sum h_L(x^(i)) is measured per unit; rho is designer-supplied (0.2, 0.1, smaller for big data); KL penalty is zero exactly at rho_hat = rho; derivative of one KL term is -rho/rho_hat + (1-rho)/(1-rho_hat).
⚠️ Top pitfall: Thinking adding the rho term re-regularizes the divergence: rho-hat is empirical per hidden node while plain rho is the external target, so nothing is double-regularized.
Self-check: With target 10 percent and 10,000 training inputs, how many times does one node fire high across the dataset?
Connects to: L1 and L2 Regularized Autoencoders (4.3); Denoising Autoencoders (4.6); Deep Autoencoders (4.8).
Deep Autoencoders
Must-know: Performance ladder: deep > shallow nonlinear > linear (PCA) at fixed code size; a linear autoencoder's optimum coincides with PCA; matching a deep stack with one wide layer needs many units plus regularization.
⚠️ Top pitfall: Comparing architectures at different code sizes, or expecting depth alone to prevent copying in an overcomplete setup.
Self-check: Why is a purely linear autoencoder equivalent to PCA?
Connects to: Overcomplete Autoencoders Need Regularization (4.2); Denoising Autoencoders (4.6); Deep Convolutional Autoencoders (4.9).
Deep Convolutional Autoencoders
Must-know: Four stride-2 poolings shrink side lengths by 16 (240x256 to 15x16); the decoder mirrors each halving with a stride-2 transpose convolution; BN normalizes per mini-batch and speeds convergence.
⚠️ Top pitfall: Letting feature-map sizes refuse to divide evenly across blocks without planning pad/crop; forgetting BN needs mini-batches.
Self-check: Starting at 240x256, what are the spatial sizes after each of the four stride-2 poolings?
Connects to: Deep Autoencoders (4.8); Preview: Variational Autoencoders (4.10).
Preview: Variational Autoencoders
Must-know: The VAE differs from other autoencoders only in the regularizing functional: it forces the latent distribution toward a zero-mean Gaussian, which makes sampling possible; classic demo recombines face attributes never seen together.
⚠️ Top pitfall: Assuming an ordinary autoencoder can generate: its latent gaps decode to garbage because no training pressure ever shaped them.
Self-check: Why can every sampled point in a trained VAE's latent space be decoded into something sensible?
Connects to: Deep Convolutional Autoencoders (4.9); Autoregressive Models and Likelihood Thinking (4.11); The Wishlist for Modern Generative Models (4.13).
Autoregressive Models and Likelihood Thinking
Must-know: PixelCNN factorization: p(x) = prod_{i=1}^{n^2} p(x_i | x_1,...,x_{i-1}) — the exact chain rule of probability along raster order; training minimizes the summed negative log conditional probabilities.
⚠️ Top pitfall: Treating the factorization as an approximation: it is an exact identity for any joint distribution; all modeling freedom lives inside the conditional forms.
Self-check: In a 2-pixel binary model with p(x1=1)=0.7 and p(x2=1|x1=1)=0.9, what is p(1,1)?
Connects to: Three Jobs for a Learned Distribution (4.12).
Three Jobs for a Learned Distribution
Must-know: MLE for a Gaussian: mu_hat = mean of samples; sigma_hat^2 = (1/n) sum (x_i - mu_hat)^2 (divide by n); log turns the likelihood product into a sum; dropping the constant log(sqrt(2 pi sigma^2)) term is valid when optimizing mu only.
⚠️ Top pitfall: Assuming anomaly detection needs nearest neighbors: within the likelihood framework you fit the distribution and flag points whose fitted probability is tiny; also remember the dropped NLL constant must return when optimizing sigma.
Self-check: For samples 13, 4, 7, 6, 5, 12, what are the MLE estimates of mu and sigma?
Connects to: Autoregressive Models and Likelihood Thinking (4.11); The Wishlist for Modern Generative Models (4.13).
The Wishlist for Modern Generative Models
Must-know: The six desirable properties of generative models, and the fact that no single system meets them all — which is why ChatGPT, Anthropic, Gemini, and others coexist with different strengths.
⚠️ Top pitfall: Judging generative models by output quality alone while ignoring training cost, compression rate, or sampling speed.
Self-check: Name all six wishlist properties and one visible symptom of sequential sampling.
Connects to: Preview: Variational Autoencoders (4.10); Autoregressive Models and Likelihood Thinking (4.11); Three Jobs for a Learned Distribution (4.12).
Exam Guidance Summary
Must-know: Exam-ready skills: hand backpropagation on autoencoder architectures, tied-weight synchronized updates, sparse-autoencoder KL penalty, and Gaussian MLE; assignment one covers the architecture ladder plus a convolutional autoencoder.
⚠️ Top pitfall: Postponing backpropagation review until exam week — it is a standing prerequisite across every assessment in the course.
Self-check: Which two tasks does assignment one ask you to verify or build?
Connects to: Recap: Undercomplete Autoencoders and Lossy Encoding (4.1); Tied Weights (4.4); Sparse Autoencoders (4.7); Deep Autoencoders (4.8); Deep Convolutional Autoencoders (4.9).
Key Industry Applications
Must-know: Named application-to-technique pairs: dubbing/text-to-speech to WaveNet, photo restoration to denoising autoencoders, inpainting to transpose-convolution decoder pipelines.
⚠️ Top pitfall: Describing applications vaguely ('used in engineering') instead of naming the technique and product family.
Self-check: Which architecture pattern underlies photo restoration, inpainting, and speech products alike?
Connects to: Denoising Autoencoders (4.6); Deep Convolutional Autoencoders (4.9); Autoregressive Models and Likelihood Thinking (4.11); The Wishlist for Modern Generative Models (4.13).
Was this lecture useful?
BitsNotes AI Assistant
Subject Notes AssistantConfigure AI Chat
Choose how to access the chatbotSigned in as
Powered by BitsNotes — 20 messages per day. No API key needed. Want unlimited access? Use "Bring Your Own Key" mode.
Sign in to use AI Chat
Get 20 free AI messages per day to ask questions about your lecture notes. Sign in with Google or GitHub — it takes 5 seconds.
Sign In to BitsNotesSwitch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.