How many pieces a budget buys, and where you put them
limit▲▲△Exact integer counts.
STATEMENT
Take a fixed number of ReLU units in the plane and count the linear regions two arrangements of them can reach. Establish the growth rate in each case, evaluate both at the same budget, and state the limit that the comparison is really about.
GIVEN
Input dimension . The two bounds of the chapter:
for one hidden layer of units, and
for hidden layers of units each, valid when .
FIND
The closed form of (I.5.4) at and its growth rate in ; the region counts for thirty units as and as ; the same for sixty units at three depths; and the asymptotic statement the table is evidence for.
STRATEGY
Evaluate before generalising. The closed form at is three terms, the numbers are small enough to check by hand, and the growth rate is then visible rather than asserted.
SOLUTION
Step 1 — one hidden layer in the plane.
so . Two units give 4 regions, three give 7, ten give 56, one hundred give 5051. Doubling the width roughly quadruples the pieces: growth is polynomial of degree , and in the plane that degree is two.
Step 2 — the same thirty units, two ways. One layer of thirty:
Three layers of ten, using (I.5.5) with :
A factor of , at the same unit count and very nearly the same parameter count.
Step 3 — sixty units, three ways.
| arrangement | regions |
|---|---|
| layer | at most |
| layers | at least |
| layers | at least |
The last is not a larger network. It is the same sixty units, stacked.
Step 4 — the limit the table is about. Read the two bounds as functions of the budget. Hold depth fixed and grow width: , polynomial. Hold width fixed and grow depth: the exponent carries , so with , exponential.
for any fixed : spending a growing budget on depth outruns spending it on width, eventually and then permanently. That is the precise sense of “depth multiplies what width adds”, and it is a statement about a limit rather than about any particular architecture.
Answer
At , one hidden layer of units reaches at most regions, which is .
Thirty units: as one layer, at least as three layers of ten — a factor of . Sixty units: , , at depths , and .
Width buys regions polynomially and depth buys them exponentially, so the ratio diverges as the budget grows.
Check — numeric · i-5-b07-region-counts.py
def shallow(n, d): # Zaslavsky 1975, one hidden layer
return sum(comb(n, i) for i in range(d + 1))
def deep(n, d, L): # Montufar et al. 2014, L hidden layers
return (n // d) ** (d * (L - 1)) * shallow(n, d)Prints the shallow table for , the thirty-unit comparison with its ratio, and the three sixty-unit arrangements.
Executed in CI. The digits above are the digits it printed.
Check — sanity
Small cases are checkable by drawing. One line cuts the plane into 2; two crossing lines into 4; three lines in general position into 7. The formula gives . A fourth line meets the other three in three points and so adds four regions, giving 11 — which is what says.
The deep bound reduces to the shallow one at . The exponent becomes zero, the factor becomes 1, and (I.5.5) collapses to (I.5.4). A bound that did not do this would be inconsistent.
The bounds point in the directions they should. (I.5.4) is an upper bound and (I.5.5) a lower one, so the comparison in Step 2 is between the best the shallow network could do and the worst the deep construction achieves. The factor of 75 is therefore a conservative statement of the gap, which is the only direction in which such a comparison is worth anything.
Where this breaks
Region counts measure how finely a network can chop its input space, and that is not what anyone wants from a model. Three limits, in increasing order of how often they are forgotten.
The counts are extremal. A trained network realises far fewer regions than its architecture allows, and the ones it realises cluster near the data rather than spreading evenly.
Pieces are not accuracy. A target needing few pieces can still be approximated badly, and a network with many regions may spend nearly all of them where no data lies.
The bound assumes . A layer narrower than the input is not governed by region counting at all but by rank: it has already discarded a subspace, and no depth after it recovers what was lost. That failure is I.5.X04, and its general form is the minimal-width theorem I.5.T4.
Variation
Fix a budget of 120 units in the plane and tabulate (I.5.5) at with . The maximum is not at the largest . Find where it is, and explain what the term does to the bound once the layers get narrow.