第5章多層パーセプトロン
5.3.1. Forward Propagation5.3.1 順伝播
Forward propagation (or forward pass) refers to the calculation and storage of intermediate variables (including outputs) for a neural network in order from the input layer to the output layer. We now work step-by-step through the mechanics of a neural network with one hidden layer. This may seem tedious but in the eternal words of funk virtuoso James Brown, you must “pay the cost to be the boss”.
英語のヒント
順伝播(あるいは順方向パス)とは、ニューラルネットワークについて、入力層から出力層へ順に、中間変数(出力を含む)を計算して保存することをいう。ここでは、隠れ層が一つのニューラルネットワークの仕組みを一歩ずつたどる。退屈に思えるかもしれないが、ファンクの名手ジェームス・ブラウンの不朽の言葉を借りれば、「ボスになるには代価を払わなければならない」のである。
For the sake of simplicity, let’s assume that the input example is and that our hidden layer does not include a bias term. Here the intermediate variable is:
英語のヒント
簡単のため、入力の事例はで、隠れ層はバイアス項を含まないと仮定しよう。このとき、中間変数は次のとおりである。
(5.3.1)
where is the weight parameter of the hidden layer. After running the intermediate variable through the activation function we obtain our hidden activation vector of length :
英語のヒント
ここでは隠れ層の重みパラメータである。中間変数を活性化関数に通すと、長さの隠れ層の活性ベクトルが得られる。
(5.3.2)
The hidden layer output is also an intermediate variable. Assuming that the parameters of the output layer possess only a weight of , we can obtain an output layer variable with a vector of length :
英語のヒント
隠れ層の出力も中間変数である。出力層のパラメータが重みだけをもつと仮定すると、長さのベクトルである出力層の変数が得られる。
(5.3.3)
Assuming that the loss function is and the example label is , we can then calculate the loss term for a single data example,
英語のヒント
損失関数を、事例のラベルをとすると、一つのデータ事例についての損失項を次のように計算できる。
(5.3.4)
As we will see the definition of regularization to be introduced later, given the hyperparameter , the regularization term is
英語のヒント
後で紹介する正則化の定義でわかるように、ハイパーパラメータが与えられたとき、正則化項は次のようになる。
(5.3.5)
where the Frobenius norm of the matrix is simply the norm applied after flattening the matrix into a vector. Finally, the model’s regularized loss on a given data example is:
英語のヒント
ここで、行列のフロベニウスノルムは、行列を平らにしてベクトルにした後に当てはめるノルムにすぎない。最後に、与えられたデータ事例についてのモデルの正則化された損失は次のとおりである。
(5.3.6)
We refer to as the objective function in the following discussion.
英語のヒント
以下の議論では、を目的関数と呼ぶ。