プリンキピア

第8章現代の畳み込みニューラルネットワーク

8.8.3. RegNet8.8.3 RegNet

The resulting AnyNetXE design space consists of simple networks following easy-to-interpret design principles:
英語のヒント
こうしてできるAnyNetXEの設計空間は、解釈しやすい設計原理に従う単純なネットワークからなる。
  • Share the bottleneck ratio ki=k for all stages i;
    英語のヒント
    すべての段iでボトルネック比ki=kを共有する。
  • Share the group width gi=g for all stages i;
    英語のヒント
    すべての段iでグループの幅gi=gを共有する。
  • Increase network width across stages: ci≤ci+1;
    英語のヒント
    段を追ってネットワークの幅を増やす:ci≤ci+1。
  • Increase network depth across stages: di≤di+1.
    英語のヒント
    段を追ってネットワークの深さを増やす:di≤di+1。
This leaves us with a final set of choices: how to pick the specific values for the above parameters of the eventual AnyNetXE design space. By studying the best-performing networks from the distribution in AnyNetXE one can observe the following: the width of the network ideally increases linearly with the block index across the network, i.e., cj≈c0+caj, where j is the block index and slope ca>0. Given that we get to choose a different block width only per stage, we arrive at a piecewise constant function, engineered to match this dependence. Furthermore, experiments also show that a bottleneck ratio of k=1 performs best, i.e., we are advised not to use bottlenecks at all.
英語のヒント
これで、最後の選択の組が残る。最終的なAnyNetXEの設計空間で、上のパラメータの具体的な値をどう選ぶかである。AnyNetXEの分布から最も性能のよいネットワークを調べると、次のことがわかる。ネットワークの幅は、理想的にはネットワーク全体でブロックの番号とともに線形に増える。つまりcj≈c0+cajである。ここで、jはブロックの番号、傾きはca>0である。違うブロックの幅を選べるのは段ごとだけなので、この依存関係に合うように作り込んだ、区分的に一定の関数にたどり着く。さらに、実験からは、ボトルネック比はk=1が最もよいこともわかる。つまり、ボトルネックはまったく使わないほうがよい。
We recommend the interested reader reviews further details in the design of specific networks for different amounts of computation by perusing Radosavovic et al. (2020). For instance, an effective 32-layer RegNetX variant is given by k=1 (no bottleneck), g=16 (group width is 16), c1=32 and c2=80 channels for the first and second stage, respectively, chosen to be d1=4 and d2=6 blocks deep. The astonishing insight from the design is that it still applies, even when investigating networks at a larger scale. Even better, it even holds for Squeeze-and-Excitation (SE) network designs (RegNetY) that have a global channel activation (Hu et al., 2018).
英語のヒント
興味のある読者には、Radosavovic et al. (2020)を読み込んで、計算量の違いに応じた具体的なネットワークの設計のさらなる詳細を確かめることを勧める。たとえば、効果的な32層のRegNetXの変種は、k=1(ボトルネックなし)、g=16(グループの幅は16)、1段目と2段目のチャネルがそれぞれc1=32とc2=80で、深さはそれぞれd1=4とd2=6ブロックに選ばれる。この設計からの驚くべき洞察は、もっと大きな規模のネットワークを調べるときでも、これがまだ当てはまるということである。さらによいことに、大域的なチャネルの活性化をもつSqueeze-and-Excitation(SE)ネットワークの設計(RegNetY)にさえ成り立つ(Hu et al., 2018)。
class RegNetX32(AnyNet):
    def __init__(self, lr=0.1, num_classes=10):
        stem_channels, groups, bot_mul = 32, 16, 1
        depths, channels = (4, 6), (32, 80)
        super().__init__(
            ((depths[0], channels[0], groups, bot_mul),
             (depths[1], channels[1], groups, bot_mul)),
            stem_channels, lr, num_classes)
We can see that each RegNetX stage progressively reduces resolution and increases output channels.
英語のヒント
各RegNetXの段が、解像度を少しずつ下げ、出力チャネルを増やしていくことがわかる。
RegNetX32().layer_summary((1, 1, 96, 96))
Sequential output shape:     torch.Size([1, 32, 48, 48])
Sequential output shape:     torch.Size([1, 32, 24, 24])
Sequential output shape:     torch.Size([1, 80, 12, 12])
Sequential output shape:     torch.Size([1, 10])