プリンキピア

第9章リカレントニューラルネットワーク

9.4.1. Neural Networks without Hidden States9.4.1 隠れ状態のないニューラルネットワーク

Let’s take a look at an MLP with a single hidden layer. Let the hidden layer’s activation function be ϕ. Given a minibatch of examples 𝐗∈ℝn×d with batch size n and d inputs, the hidden layer output 𝐇∈ℝn×h is calculated as
英語のヒント
隠れ層が一つのMLPを見てみよう。隠れ層の活性化関数をϕとする。バッチサイズn、入力の数dの事例のミニバッチ𝐗∈ℝn×dが与えられたとき、隠れ層の出力𝐇∈ℝn×hは次のように計算される。
𝐇=ϕ(𝐗𝐖xh+𝐛h).(9.4.3)
In (9.4.3), we have the weight parameter 𝐖xh∈ℝd×h, the bias parameter 𝐛h∈ℝ1×h, and the number of hidden units h, for the hidden layer. So armed, we apply broadcasting (see Section 2.1.4) during the summation. Next, the hidden layer output 𝐇 is used as input of the output layer, which is given by
英語のヒント
(9.4.3)では、隠れ層について、重みパラメータ𝐖xh∈ℝd×h、バイアスパラメータ𝐛h∈ℝ1×h、隠れユニットの数hがある。これらを用意したうえで、和をとるときにはブロードキャスト(2.1.4節を参照)を当てはめる。次に、隠れ層の出力𝐇は出力層の入力として使われ、出力層は次で与えられる。
𝐎=𝐇𝐖hq+𝐛q,(9.4.4)
where 𝐎∈ℝn×q is the output variable, 𝐖hq∈ℝh×q is the weight parameter, and 𝐛q∈ℝ1×q is the bias parameter of the output layer. If it is a classification problem, we can use softmax(𝐎) to compute the probability distribution of the output categories.
英語のヒント
ここで、𝐎∈ℝn×qは出力変数、𝐖hq∈ℝh×qは重みパラメータ、𝐛q∈ℝ1×qは出力層のバイアスパラメータである。分類問題なら、softmax(𝐎)を使って出力のカテゴリーの確率分布を計算できる。
This is entirely analogous to the regression problem we solved previously in Section 9.1, hence we omit details. Suffice it to say that we can pick feature-label pairs at random and learn the parameters of our network via automatic differentiation and stochastic gradient descent.
英語のヒント
これは前に9.1節で解いた回帰問題とまったく同じなので、詳細は省く。特徴量とラベルの組をランダムに選び、自動微分と確率的勾配降下法によってネットワークのパラメータを学習できる、と言えば十分である。