プリンキピア

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

8.8. Designing Convolution Network Architectures8.8 畳み込みネットワークの構造を設計する

The previous sections have taken us on a tour of modern network design for computer vision. Common to all the work we covered was that it greatly relied on the intuition of scientists. Many of the architectures are heavily informed by human creativity and to a much lesser extent by systematic exploration of the design space that deep networks offer. Nonetheless, this network engineering approach has been tremendously successful.
英語のヒント
前の節では、コンピュータビジョンのための現代のネットワーク設計をめぐってきた。扱ったすべての研究に共通していたのは、科学者の直観に大きく頼っていたことである。構造の多くは、人間の創造性に大きく導かれており、深いネットワークがもたらす設計空間の体系的な探索に導かれた度合いはずっと小さい。それでも、このネットワーク工学のやり方は、とてつもない成功を収めてきた。
Ever since AlexNet (Section 8.1) beat conventional computer vision models on ImageNet, it has become popular to construct very deep networks by stacking blocks of convolutions, all designed according to the same pattern. In particular, 3×3 convolutions were popularized by VGG networks (Section 8.2). NiN (Section 8.3) showed that even 1×1 convolutions could be beneficial by adding local nonlinearities. Moreover, NiN solved the problem of aggregating information at the head of a network by aggregating across all locations. GoogLeNet (Section 8.4) added multiple branches of different convolution width, combining the advantages of VGG and NiN in its Inception block. ResNets (Section 8.6) changed the inductive bias towards the identity mapping (from f(x)=0). This allowed for very deep networks. Almost a decade later, the ResNet design is still popular, a testament to its design. Lastly, ResNeXt (Section 8.6.5) added grouped convolutions, offering a better trade-off between parameters and computation. A precursor to Transformers for vision, the Squeeze-and-Excitation Networks (SENets) allow for efficient information transfer between locations (Hu et al., 2018). This was accomplished by computing a per-channel global attention function.
英語のヒント
AlexNet(8.1節)がImageNetで従来のコンピュータビジョンのモデルを打ち負かして以来、すべて同じパターンに従って設計された畳み込みのブロックを積み重ねて、とても深いネットワークを組み立てることが広まった。特に、3×3の畳み込みはVGGネットワーク(8.2節)によって広まった。NiN(8.3節)は、1×1の畳み込みでさえ、局所的な非線形性を加えることで役に立ちうることを示した。さらに、NiNは、すべての位置にわたって集約することで、ネットワークのヘッドで情報を集約するという問題を解決した。GoogLeNet(8.4節)は、異なる畳み込みの幅をもつ複数の枝を加え、InceptionブロックでVGGとNiNの利点を組み合わせた。ResNet(8.6節)は、帰納バイアスを(f(x)=0から)恒等写像へと変えた。これにより、とても深いネットワークが可能になった。ほぼ10年後の今もResNetの設計は人気があり、その設計の確かさを物語っている。最後に、ResNeXt(8.6.5節)はグループ化畳み込みを加え、パラメータと計算のあいだのより良いトレードオフをもたらした。視覚のためのTransformerの先駆けであるSqueeze-and-Excitation Networks(SENet)は、位置のあいだで効率よく情報を伝えられるようにする(Hu et al., 2018)。これは、チャネルごとの大域的な注意の関数を計算することで実現された。
Up to now we have omitted networks obtained via neural architecture search (NAS) (Liu et al., 2018, Zoph and Le, 2016). We chose to do so since their cost is usually enormous, relying on brute-force search, genetic algorithms, reinforcement learning, or some other form of hyperparameter optimization. Given a fixed search space, NAS uses a search strategy to automatically select an architecture based on the returned performance estimation. The outcome of NAS is a single network instance. EfficientNets are a notable outcome of this search (Tan and Le, 2019).
英語のヒント
ここまで、ニューラルアーキテクチャ探索(NAS)(Liu et al., 2018、Zoph and Le, 2016)で得られたネットワークは省いてきた。そうしたのは、その費用がふつう莫大だからである。力ずくの探索、遺伝的アルゴリズム、強化学習、あるいはほかの形のハイパーパラメータ最適化に頼っている。固定された探索空間が与えられると、NASは探索の戦略を使い、返ってきた性能の推定にもとづいて構造を自動で選ぶ。NASの結果は一つのネットワークのインスタンスである。EfficientNetは、この探索の注目すべき成果である(Tan and Le, 2019)。
In the following we discuss an idea that is quite different to the quest for the single best network. It is computationally relatively inexpensive, it leads to scientific insights on the way, and it is quite effective in terms of the quality of outcomes. Let’s review the strategy by Radosavovic et al. (2020) to design network design spaces. The strategy combines the strength of manual design and NAS. It accomplishes this by operating on distributions of networks and optimizing the distributions in a way to obtain good performance for entire families of networks. The outcome of it are RegNets, specifically RegNetX and RegNetY, plus a range of guiding principles for the design of performant CNNs.
英語のヒント
以下では、唯一最善のネットワークを追い求めるのとはかなり違う考えを論じる。それは計算の面で比較的安く、その過程で科学的な洞察をもたらし、結果の質の点でもかなり効果的である。ネットワークの設計空間を設計するという、Radosavovic et al. (2020)の戦略を見ていこう。この戦略は、手作業の設計とNASの強みを組み合わせる。それは、ネットワークの分布の上で操作し、ネットワークの一族全体でよい性能が得られるように分布を最適化することで、これを実現する。その成果がRegNet、具体的にはRegNetXとRegNetYであり、さらに高性能なCNNを設計するための一連の指針となる原理である。
import torch
from torch import nn
from torch.nn import functional as F
from d2l import torch as d2l