Piecewise linear learning and experiments
A network alternates affine maps with nonlinear activations. ReLU(z)=max(0,z) makes a piecewise linear function; without activations, repeated linear layers collapse into a single matrix.
What you will learn
- Expand a ReLU piecewise rule
- Calculate slopes at the boundary
- Separate training and testing evidence
Work through one complete example
- Let h=ReLU(2x−1), y=3h.
- For x≤1/2, y=0; for x>1/2, y=6x−3. The slope changes at the activation boundary.
- At x=1, h=1 and y=3. At x=0, h=y=0.
- In an experiment, separate training and held-out test data before fitting weights. Low training loss alone does not establish generalization.
Objective 1: Expand a ReLU piecewise rule
- Expand y=3ReLU(2x−1).
- y=0 for x≤1/2; y=6x−3 for x>1/2.
Objective 2: Calculate slopes at the boundary
- Give one-sided slopes and the ordinary derivative at 1/2.
- Slopes are 0 and 6; the ordinary derivative does not exist.
Objective 3: Separate training and testing evidence
- Does low training loss prove generalization?
- No. Split held-out data before training and compare the same test metric.
A common mistake
State the assumptions before using the formula.
Review first
Continue learning
Piecewise linear learning and experiments
Interactive diagnosis and practice load in the learning app. You can read these lesson notes without JavaScript.