5.6.3 · D1Machine Learning (Aerospace Applications)

Foundations — Regularization — L1 (lasso), L2 (ridge), dropout

1,994 words9 min readBack to topic

Before you can read the parent note on L1, L2, and dropout, you must be able to read every squiggle it uses without pausing. This page builds each one from absolute zero, in the order they depend on each other.


1. A weight — the knob

Picture a mixing desk. Each slider is a . Turning slider up means "pay more attention to input number ." The whole collection of sliders is written as a bold (a vector — an ordered list of numbers).

Figure — Regularization — L1 (lasso), L2 (ridge), dropout

The letter that appears in the parent's model () is the bias — one extra slider that shifts everything up or down by a constant, independent of any input. It is usually not penalized.


2. Prediction vs. truth — the hat means "guess"

Picture two dots on a number line: a black dot at the true value , and a hollow dot at the guess . The gap between them is the model's mistake on this one example.


3. Summation — "add up a list"

Picture a shopping receipt: each line is one , and is the total at the bottom.

The topic needs because a penalty must combine all the weights into a single number to add to the score — you can't penalize a whole desk of sliders without summing over them.


4. The loss — the badness score

Picture a valley. The horizontal position is your setting of the weights; the height of the ground is the loss. Training rolls a ball downhill toward the lowest point.

Figure — Regularization — L1 (lasso), L2 (ridge), dropout

The parent note splits the loss into two named pieces:

Symbol Plain words
how badly guesses miss the true answers
the data loss plus the regularization penalty

The whole point of regularization is: don't minimize alone; minimize , which also cares about knob size.

The tiny inside the sum is the per-example loss — the badness on just one flight . Summing all of them and dividing by (the number of examples) gives the average, which is .


5. Magnitude bars: and — "how big, ignore direction"

Picture the point on a map. is the crow-flies distance to the origin. is the taxi-cab distance (you must travel along the grid streets).

Figure — Regularization — L1 (lasso), L2 (ridge), dropout

6. The slope — which way is downhill

We need a derivative (and not, say, just evaluating the loss) because to roll downhill you must know the direction of down at your current spot — that direction is exactly the slope.

The curly (instead of a straight ) is a flag: "there are several knobs; I'm changing just this one and holding the rest still."

Figure — Regularization — L1 (lasso), L2 (ridge), dropout

The stacked-together partials for all weights form the gradient, written (the upside-down triangle "nabla"). It is just the full list of slopes — the complete "downhill arrow."


7. The gradient-descent step: , , and the arrow

The superscript in just means "the weight at step number " — is the start, after one update, and so on. It is a time stamp, not a power.


8. Probability and expectation — the language of dropout

The "" in the parent means: is a random on/off switch that is with probability and otherwise. Multiplying by keeps or kills that neuron.


Prerequisite map

Weights w_i and bias b

Loss L data

Truth y and guess y-hat

Summation sigma

Norms L1 and L2

Absolute value

Total loss with penalty

Strength lambda

Gradient dL by dw

Update rule with eta

Learning rate eta

Probability p and expectation

Dropout

Neuron activation h

Regularization L1 L2 dropout

This feeds directly into the parent topic. Related roads: Gradient Descent Variants refines the update rule, Feature Engineering and Overfitting Detection motivate why we penalize, Cross-Validation picks , and Ensemble Methods plus Bayesian Inference give deeper reasons dropout works.


Equipment checklist

What is a weight ?
One adjustable number (a "knob"/slider); is its position in the list.
What does the hat in mean?
It marks a prediction/estimate, as opposed to the true value .
Read in words.
Square every weight, then add all the squares into one number.
Difference between and ?
is the data loss plus the regularization penalty.
What is geometrically?
The straight-line (crow-flies) distance from the weight point to the origin.
What is geometrically?
The taxi-cab distance — the sum of the absolute weight values.
What does tell you?
The slope of the loss when only knob is nudged — which way and how steeply loss changes.
Why does cause trouble at that does not?
has a sharp kink there so its slope is undefined; is smooth with slope .
What is and what happens if it is too large?
The learning rate (step size); too large and updates overshoot the valley bottom.
What does control?
How strongly we penalize weight size vs. fitting the data; = off, large = weights forced toward zero.
What does say?
On average a dropout neuron delivers a fraction of its normal output.
Is a power?
No — the is a step/time index meaning "the weight at iteration ."