第3章回帰のための線形ニューラルネットワーク
3.5.5. Summary3.5.5 まとめ
This section contains the first implementation of a deep network (in this book) to tap into the conveniences afforded by modern deep learning frameworks, such as MXNet (Chen et al., 2015), JAX (Frostig et al., 2018), PyTorch (Paszke et al., 2019), and Tensorflow (Abadi et al., 2016). We used framework defaults for loading data, defining a layer, a loss function, an optimizer and a training loop. Whenever the framework provides all necessary features, it is generally a good idea to use them, since the library implementations of these components tend to be heavily optimized for performance and properly tested for reliability. At the same time, try not to forget that these modules can be implemented directly. This is especially important for aspiring researchers who wish to live on the leading edge of model development, where you will be inventing new components that cannot possibly exist in any current library.
英語のヒント
この節には、MXNet(Chen et al., 2015)、JAX(Frostig et al., 2018)、PyTorch(Paszke et al., 2019)、Tensorflow(Abadi et al., 2016)のような現代の深層学習フレームワークが与えてくれる便利さを利用した、(この本で)最初の深いネットワークの実装が含まれている。データの読み込み、層、損失関数、最適化手法、訓練ループの定義には、フレームワークの既定のものを使った。フレームワークが必要な機能をすべて提供しているなら、それを使うのが一般によい考えである。こうした構成要素のライブラリの実装は、性能のために高度に最適化され、信頼性のためにきちんとテストされている傾向があるからである。同時に、これらのモジュールは直接実装できることを忘れないようにしてほしい。これは、モデル開発の最前線に身を置きたい研究者志望の人にとってとりわけ重要である。そこでは、今のどのライブラリにも存在しえない新しい構成要素を発明することになる。
In PyTorch, the
data module provides tools for data processing, the nn module defines a large number of neural network layers and common loss functions. We can initialize the parameters by replacing their values with methods ending with _. Note that we need to specify the input dimensions of the network. While this is trivial for now, it can have significant knock-on effects when we want to design complex networks with many layers. Careful considerations of how to parametrize these networks is needed to allow portability.英語のヒント
PyTorchでは、
dataモジュールがデータ処理の道具を提供し、nnモジュールが多数のニューラルネットワークの層とよく使われる損失関数を定義している。_で終わるメソッドで値を置き換えれば、パラメータを初期化できる。ネットワークの入力の次元を指定する必要があることに注意してほしい。今は自明だが、多くの層をもつ複雑なネットワークを設計したいときには、大きな波及効果をもちうる。移植性を確保するには、こうしたネットワークをどうパラメータ化するかを注意深く考える必要がある。