ゲート付き回帰型ユニット
ゲート付き回帰型ユニット(ゲートつきかいきがたユニット、英: Gated recurrent unit、略称: GRU)は、回帰型ニューラルネットワーク(RNN)におけるゲート機構である[1]。2014年にKyunghyun Cho(조 경현)らによって発表された[2]。GRUは忘却ゲートを持つ長・短期記憶(long short-term memory、LSTM)に似ているが[3]、出力ゲートを欠くためLSTMよりもパラメータが少ない[4]。多声音楽モデリングおよび音声シグナルモデリングの特定の課題におけるGRUの性能は、LSTMの性能と類似していることが明らかにされている。GRUは特定のより小さなデータセットではもっと良い性能を示すことが明らかにされている[5]。
しかしながら、Gail Weiss、Yoav Goldberg、およびEran Yahavによって示されているように、LSTMは無制限の計数を容易に実行できるがGRUはできないため、LSTMはGRUよりも「厳密に強力」である[6]。これが、LSTMによって学習可能な単純な言語の学習をGRUが失敗する理由である[6]。
同様に、Google BrainのDenny Britz、Anna Goldie、Minh-Thang Luong、およびQuoc Leによって示されているように、LSTMセルは「ニューラル機械翻訳のためのアーキテクチャ変法の初の大規模分析」においてGRUセルを一貫して上回った[7]。
アイデア
GRUのアイデアは次の式で表される(実際の演算とは異なる)。
すなわち隠れ状態 は以下の2要素の重み付け和で更新される。
- 1ステップ前の隠れ状態
- 「入力 」と「重み付けられた隠れ状態 」の による非線形変換
例えば であれば入力は無視され隠れ状態がそのまま保持される。逆に であれば入力と隠れ状態の非線形変換により新たな隠れ状態が計算される。 は新たな隠れ状態の計算に影響を与える。 であれば入力のみから新な隠れ状態が計算され[8]、 であれば入力・隠れ状態の両方が利用される。これら と もまた と から計算される。
単純なRNNと比較して、GRUは更新ゲート による隠れ状態の保持[9]とそれによる長期記憶[10]が可能になる。また初期化ゲート による隠れ状態の削除[11]が可能になることでよりコンパクトな隠れ表現を得られる[12]。
隠れ状態のサイズが1以上であれば複数の と ( と ) を持つことになる。それぞれの は独立して学習されるため、ある は更新ゲート が長期間1に近いすなわち長期記憶を保持し、ほかの は初期化ゲート が頻繁に切り替わりながら入力のフィルタリングをおこなうように振る舞う、といったことが可能になっている。すなわちそれぞれの隠れ状態が異なる時間スケールの表現を学習しうる[13]。
アーキテクチャ
様々な組合せで以前の隠れ状態とバイアスを使ってゲーティングを行う完全ゲート付きユニットや最小ゲート付きユニット(minimal gated unit)と呼ばれる単純形など複数の変種が存在する。
以下の式において、演算子はアダマール積を示す。
完全ゲート付きユニット
最初、に対して、出力ベクトルはである。
変数
- : 入力ベクトル
- : 出力ベクトル
- : 更新ゲートベクトル
- : 初期化ゲートベクトル
- 、、および: パラメータ行列およびベクトル
という条件で、別の活性化関数も利用可能である。
およびを変更することによって代替形式を作ることができる[14]。
- タイプ1、それぞれのゲートが以前の隠れ状態およびバイアスにのみ依存する。
- タイプ2、それぞれのゲートが以前の隠れ状態にのみ依存する。
- タイプ3、それぞれのゲートはバイアスのみを使って計算される。
最小ゲート付きユニット
最小ゲート付きユニットは、更新ゲートベクトルおよび初期化ゲートベクトルが忘却ゲートへと統合されたことを除いて、完全ゲート付きユニットと類似している。これは、出力ベクトルに対する方程式が変更されなければならないこと になる[15]。
変数
- : 入力ベクトル
- : 出力ベクトル
- : 忘却ベクトル
- 、、および: パラメータ行列およびベクトル
出典
- ^ "we refer as a gated recurrent unit (GRU), was proposed by Cho et al. [2014]" Junyoung Chung, et al. (2014). Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling. Arxiv 1412.3555
- ^ Cho, Kyunghyun; van Merrienboer, Bart; Gulcehre, Caglar; Bahdanau, Dzmitry; Bougares, Fethi; Schwenk, Holger; Bengio, Yoshua (2014). "Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation". arXiv:1406.1078 [cs.CL]。
- ^ Felix Gers; Jürgen Schmidhuber; Fred Cummins (1999). “Learning to Forget: Continual Prediction with LSTM”. Proc. ICANN'99, IEE, London: 850-855. https://ieeexplore.ieee.org/document/818041.
- ^ “Recurrent Neural Network Tutorial, Part 4 – Implementing a GRU/LSTM RNN with Python and Theano – WildML”. May 18, 2016閲覧。
- ^ Chung, Junyoung; Gulcehre, Caglar; Cho, KyungHyun; Bengio, Yoshua (2014). "Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling". arXiv:1412.3555 [cs.NE]。
- ^ a b Weiss, Gail; Goldberg, Yoav; Yahav, Eran (2018). "On the Practical Computational Power of Finite Precision RNNs for Language Recognition". arXiv:1805.04908 [cs.NE]。
- ^ Britz, Denny; Goldie, Anna; Luong, Minh-Thang; Le, Quoc (2018). "Massive Exploration of Neural Machine Translation Architectures". arXiv:1703.03906 [cs.NE]。
- ^ "when the reset gate is close to 0, the hidden state is forced to ignore the previous hidden state and reset with the current input only." Cho, et al. (2014).
- ^ "the update gate controls how much information from the previous hidden state will carry over to the current hidden state" Cho, et al. (2014).
- ^ "acts similarly to the memory cell in the LSTM network and helps the RNN to remember longterm information" Cho, et al. (2014).
- ^ "allows the hidden state to drop any information that is found to be irrelevant later in the future, thus, allowing a more compact representation" Cho, et al. (2014).
- ^ "allowing a more compact representation" Cho, et al. (2014).
- ^ "As each hidden unit has separate reset and update gates, each hidden unit will learn to capture dependencies over different time scales" Cho, et al. (2014).
- ^ Dey, Rahul; Salem, Fathi M. (20 January 2017). "Gate-Variants of Gated Recurrent Unit (GRU) Neural Networks". arXiv:1701.05923 [cs.NE]。
- ^ Heck, Joel; Salem, Fathi M. (12 January 2017). "Simplified Minimal Gated Unit Variations for Recurrent Neural Networks". arXiv:1701.03452 [cs.NE]。