プリンキピア

第2章準備

2.5. Automatic Differentiation2.5 自動微分

Recall from Section 2.4 that calculating derivatives is the crucial step in all the optimization algorithms that we will use to train deep networks. While the calculations are straightforward, working them out by hand can be tedious and error-prone, and these issues only grow as our models become more complex.
英語のヒント
2.4節で見たように、導関数の計算は、深いネットワークを訓練するのに使うあらゆる最適化アルゴリズムで決定的な段階である。計算そのものは簡単だが、手で行うのは退屈で誤りやすく、こうした問題はモデルが複雑になるほど大きくなる。
Fortunately all modern deep learning frameworks take this work off our plates by offering automatic differentiation (often shortened to autograd). As we pass data through each successive function, the framework builds a computational graph that tracks how each value depends on others. To calculate derivatives, automatic differentiation works backwards through this graph applying the chain rule. The computational algorithm for applying the chain rule in this fashion is called backpropagation.
英語のヒント
幸い、現代の深層学習フレームワークはどれも、自動微分(しばしばautogradと略される)を提供することで、この仕事を私たちの手から引き受けてくれる。データを連続する関数に順に通していくと、フレームワークは、各値がほかの値にどう依存するかを追跡する計算グラフを作る。導関数を計算するには、自動微分はこのグラフを逆向きにたどりながら連鎖律を当てはめる。このように連鎖律を当てはめる計算アルゴリズムを、誤差逆伝播法という。
While autograd libraries have become a hot concern over the past decade, they have a long history. In fact the earliest references to autograd date back over half of a century (Wengert, 1964). The core ideas behind modern backpropagation date to a PhD thesis from 1980 (Speelpenning, 1980) and were further developed in the late 1980s (Griewank, 1989). While backpropagation has become the default method for computing gradients, it is not the only option. For instance, the Julia programming language employs forward propagation (Revels et al., 2016). Before exploring methods, let’s first master the autograd package.
英語のヒント
自動微分のライブラリはこの10年で熱い関心の的になったが、その歴史は長い。実際、自動微分への最も古い言及は半世紀以上前にさかのぼる(Wengert, 1964)。現代の誤差逆伝播法の背後にある中心的な考え方は、1980年の博士論文にさかのぼり(Speelpenning, 1980)、1980年代後半にさらに発展した(Griewank, 1989)。誤差逆伝播法は勾配を計算する標準の方法になったが、唯一の選択肢ではない。たとえばプログラミング言語Juliaは、順方向の伝播を使う(Revels et al., 2016)。手法を探る前に、まずautogradパッケージを使いこなそう。
import torch