第22章付録:深層学習のための数学
22.4.2. Geometry of Gradients and Gradient Descent22.4.2 勾配の幾何学と勾配降下法
(22.4.9)
Let’s suppose that I want to use this to help minimize our loss . Let’s understand geometrically the algorithm of gradient descent first described in Section 2.5. What we will do is the following:
英語のヒント
これを使って損失を最小化したいとしよう。2.5節で最初に述べた勾配降下法のアルゴリズムを、幾何学的に理解しよう。行うのは次のことである。
- Start with a random choice for the initial parameters .
英語のヒント
初期パラメータをランダムに選ぶことから始める。 - Find the direction that makes decrease the most rapidly at .
英語のヒント
でを最も速く減らす方向を見つける。 - Take a small step in that direction: .
英語のヒント
その方向に小さな一歩を進める。。 - Repeat.
英語のヒント
繰り返す。
The only thing we do not know exactly how to do is to compute the vector in the second step. We will call such a direction the direction of steepest descent. Using the geometric understanding of dot products from Section 22.1, we see that we can rewrite (22.4.5) as
英語のヒント
(22.4.10)
Note that we have taken our direction to have length one for convenience, and used for the angle between and . If we want to find the direction that decreases as rapidly as possible, we want to make this expression as negative as possible. The only way the direction we pick enters into this equation is through , and thus we wish to make this cosine as negative as possible. Now, recalling the shape of cosine, we can make this as negative as possible by making or equivalently making the angle between the gradient and our chosen direction to be radians, or equivalently degrees. The only way to achieve this is to head in the exact opposite direction: pick to point in the exact opposite direction to !
英語のヒント
便宜のため方向の長さを1にとり、との間の角度にを使ったことに注意しよう。をできるだけ速く減らす方向を見つけたいなら、この式をできるだけ負にしたい。選ぶ方向がこの式に入ってくるのはを通してだけなので、このコサインをできるだけ負にしたい。ここで、コサインの形を思い出すと、とすること、あるいは同じことだが、勾配と選んだ方向の間の角度をラジアン、つまり度にすることで、これをできるだけ負にできる。これを実現する唯一の方法は、ちょうど反対の方向に向かうことである。を、とちょうど反対の方向を向くように選ぶのである。
This brings us to one of the most important mathematical concepts in machine learning: the direction of steepest decent points in the direction of . Thus our informal algorithm can be rewritten as follows.
英語のヒント
これにより、機械学習で最も重要な数学的概念の一つにたどり着く。最急降下の方向はの方向を向く。したがって、非形式的なアルゴリズムは次のように書き直せる。
- Start with a random choice for the initial parameters .
英語のヒント
初期パラメータをランダムに選ぶことから始める。 - Compute .
英語のヒント
を計算する。 - Take a small step in the opposite of that direction: .
英語のヒント
その方向と反対に小さな一歩を進める。。 - Repeat.
英語のヒント
繰り返す。
This basic algorithm has been modified and adapted many ways by many researchers, but the core concept remains the same in all of them. Use the gradient to find the direction that decreases the loss as rapidly as possible, and update the parameters to take a step in that direction.
英語のヒント
この基本的なアルゴリズムは多くの研究者によってさまざまに修正・改良されてきたが、中核の概念はどれでも同じままである。勾配を使って損失をできるだけ速く減らす方向を見つけ、その方向に一歩進むようにパラメータを更新するのである。