The paper simplified the design space by repeatedly sampling and training many models from a design space and comparing design spaces by their error distributions.
Measuring the quality of a design space
Sample n models from a design space, train them, and measure their errors eiโ. The empirical distribution function (EDF) of errors is the fraction of models whose error is below e (Eq. 1 of the paper).
F(e)=n1โi=1โnโ1[eiโ<e]
The closer the curve is to the upper left, the better the design space, with more models concentrated at low error. Comparing distributions is less subject to chance than comparing the single best model found by a search. For quick comparisons, 500 models of around 400 million operations (400MF) were sampled and each trained on ImageNet for only 10 epochs.
Starting point: AnyNetX
The network is divided into "stem (3ร3 convolution, 32 channels, stride 2) โ body (four stages) โ head (global average pooling and a fully connected layer)", and only the body is varied. Each stage repeats the same block, which is the ResNeXt bottleneck (the X block in the paper). For each stage i, four values can be chosen freely: the number of blocks diโ, width wiโ, bottleneck ratio biโ, and group width giโ, giving 16 degrees of freedom over four stages.
Narrowing procedure (Sections 3.2โ3.3 and Table 1 of the paper)
- Share the bottleneck ratio across all stages (AnyNetXBโ): the error distribution barely changed.
- Share the group width across all stages (AnyNetXCโ): again the distribution barely changed.
- Make widths increase in later stages (wi+1โโฅwiโ, AnyNetXDโ): the distribution clearly improved. Conversely, keeping widths equal or decreasing them made it much worse.
- Make the number of blocks increase in later stages (di+1โโฅdiโ, AnyNetXEโ): the distribution also improved.
- Set width and depth with a quantized line (RegNet): the rule described next reduced the degrees of freedom to 6.
| Design space | Constraint added | Degrees of freedom | Number of candidates (approx.) |
|---|
| AnyNetXAโ | None | 16 | 1.8ร1018 |
| AnyNetXCโ | Shared b and g | 10 | 3.2ร1014 |
| AnyNetXEโ | Increasing width and depth | 10 | 5.5ร1011 |
| RegNet | Quantized line | 6 | 3.0ร108 |
The quantized linear rule
Lining up the per-block widths of the top 20 models in AnyNetXEโ showed that, overall, they roughly follow a line (wjโ=48โ
(j+1)). Actual model widths, however, form steps that are constant within each stage. So first, a line sets the width of each block (Eq. 2 of the paper). d is the total number of blocks, w0โ is the initial width, and waโ is the slope.
ujโ=w0โ+waโโ
j(0โคj<d)
Next, ujโ is expressed as "w0โ multiplied by wmโ some number of times", and that exponent sjโ is rounded to an integer (Eqs. 3 and 4 of the paper).
ujโ=w0โโ
wmsjโโ,wjโ=w0โโ
wmโsjโโโ
โsjโโ denotes rounding. Blocks with the same rounded width wjโ form one stage; the width of stage i is w0โโ
wmiโ, and its number of blocks is the number of blocks with that width. The upper right of the figure at the top of the article shows this line and the steps.
As a result, a network is determined by six values: d,w0โ,waโ,wmโ, the bottleneck ratio b, and the group width g. This design space, RegNetX, has a lower mean error than AnyNetX while keeping the error of the best model. The paper also shows that trying only about 32 random models is likely to find a good one.
The official implementation further aligns the rounded widths to multiples of 8 and of the group width. For example, in RegNetX-3.2GF (d=25, w0โ=88, waโ=26.31, wmโ=2.25, g=48), the stage widths given by the equations, 88, 198, 446, and 1003, become 96, 192, 432, and 1008.