プリンキピア

第2章準備

2.4.3. Partial Derivatives and Gradients2.4.3 偏導関数と勾配

Thus far, we have been differentiating functions of just one variable. In deep learning, we also need to work with functions of many variables. We briefly introduce notions of the derivative that apply to such multivariate functions.
英語のヒント
ここまでは、変数が一つだけの関数を微分してきた。深層学習では、多くの変数の関数も扱う必要がある。こうした多変数関数に当てはまる導関数の概念を、簡単に紹介する。
Let y=f(x1,x2,…,xn) be a function with n variables. The partial derivative of y with respect to its ith parameter xi is
英語のヒント
y=f(x1,x2,…,xn)をn個の変数をもつ関数とする。そのith番目のパラメータxiについてのyの偏導関数は次のとおりである。
∂y∂xi=limh→0f(x1,…,xi−1,xi+h,xi+1,…,xn)−f(x1,…,xi,…,xn)h.(2.4.6)
To calculate ∂y∂xi, we can treat x1,…,xi−1,xi+1,…,xn as constants and calculate the derivative of y with respect to xi. The following notational conventions for partial derivatives are all common and all mean the same thing:
英語のヒント
∂y∂xiを計算するには、x1,…,xi−1,xi+1,…,xnを定数として扱い、xiについてのyの導関数を計算すればよい。偏導関数の次の記法はどれもよく使われ、すべて同じことを意味する。
∂y∂xi=∂f∂xi=∂xif=∂if=fxi=fi=Dif=Dxif.(2.4.7)
We can concatenate partial derivatives of a multivariate function with respect to all its variables to obtain a vector that is called the gradient of the function. Suppose that the input of function f:ℝn→ℝ is an n-dimensional vector 𝐱=[x1,x2,…,xn]⊤ and the output is a scalar. The gradient of the function f with respect to 𝐱 is a vector of n partial derivatives:
英語のヒント
多変数関数のすべての変数についての偏導関数を連結すると、関数の勾配と呼ばれるベクトルが得られる。関数f:ℝn→ℝの入力がn次元のベクトル𝐱=[x1,x2,…,xn]⊤で、出力がスカラーだとしよう。𝐱についての関数fの勾配は、n個の偏導関数のベクトルである。
∇𝐱f(𝐱)=[∂x1f(𝐱),∂x2f(𝐱),…∂xnf(𝐱)]⊤.(2.4.8)
When there is no ambiguity, ∇𝐱f(𝐱) is typically replaced by ∇f(𝐱). The following rules come in handy for differentiating multivariate functions:
英語のヒント
あいまいさがないときは、∇𝐱f(𝐱)は普通∇f(𝐱)で置き換えられる。多変数関数を微分するには、次の規則が役に立つ。
  • For all 𝐀∈ℝm×n we have ∇𝐱𝐀𝐱=𝐀⊤ and ∇𝐱𝐱⊤𝐀=𝐀.
    英語のヒント
    すべての𝐀∈ℝm×nについて、∇𝐱𝐀𝐱=𝐀⊤と∇𝐱𝐱⊤𝐀=𝐀が成り立つ。
  • For square matrices 𝐀∈ℝn×n we have that ∇𝐱𝐱⊤𝐀𝐱=(𝐀+𝐀⊤)𝐱 and in particular ∇𝐱∥𝐱∥2=∇𝐱𝐱⊤𝐱=2𝐱.
    英語のヒント
    正方行列𝐀∈ℝn×nについて、∇𝐱𝐱⊤𝐀𝐱=(𝐀+𝐀⊤)𝐱が成り立ち、特に∇𝐱∥𝐱∥2=∇𝐱𝐱⊤𝐱=2𝐱である。
Similarly, for any matrix 𝐗, we have ∇𝐗∥𝐗∥F2=2𝐗.
英語のヒント
同様に、任意の行列𝐗について、∇𝐗∥𝐗∥F2=2𝐗が成り立つ。