プリンキピア

第2章準備

2.4.4. Chain Rule2.4.4 連鎖律

In deep learning, the gradients of concern are often difficult to calculate because we are working with deeply nested functions (of functions (of functions…)). Fortunately, the chain rule takes care of this. Returning to functions of a single variable, suppose that y=f(g(x)) and that the underlying functions y=f(u) and u=g(x) are both differentiable. The chain rule states that
英語のヒント
深層学習では、関心のある勾配を計算するのが難しいことが多い。深く入れ子になった関数(の関数(の関数……))を扱っているからである。幸い、連鎖律がこれを引き受けてくれる。一変数の関数に戻って、y=f(g(x))であり、その元になる関数y=f(u)とu=g(x)がどちらも微分可能だとしよう。連鎖律は次のことを述べる。
dydx=dydududx.(2.4.9)
Turning back to multivariate functions, suppose that y=f(𝐮) has variables u1,u2,…,um, where each ui=gi(𝐱) has variables x1,x2,…,xn, i.e., 𝐮=g(𝐱). Then the chain rule states that
英語のヒント
多変数関数に話を戻して、y=f(𝐮)が変数u1,u2,…,umをもち、各ui=gi(𝐱)が変数x1,x2,…,xnをもつ、つまり𝐮=g(𝐱)だとしよう。このとき連鎖律は次のことを述べる。
∂y∂xi=∂y∂u1∂u1∂xi+∂y∂u2∂u2∂xi+…+∂y∂um∂um∂xi  and so  ∇𝐱y=𝐀∇𝐮y,(2.4.10)
where 𝐀∈ℝn×m is a matrix that contains the derivative of vector 𝐮 with respect to vector 𝐱. Thus, evaluating the gradient requires computing a vector–matrix product. This is one of the key reasons why linear algebra is such an integral building block in building deep learning systems.
英語のヒント
ここで𝐀∈ℝn×mは、ベクトル𝐱についてのベクトル𝐮の導関数を含む行列である。したがって、勾配を評価するには、ベクトルと行列の積を計算する必要がある。これが、深層学習のシステムを作るうえで線形代数がこれほど欠かせない構成要素である、鍵となる理由の一つである。