Deep Learning · TEE · section

Comparing the three recurrent models

Recurrent neural networks

FeatureVanilla RNNLSTMGRU
Main statehh and Ch
GatesNone in vanilla cellForget input outputReset update
Long dependenciesOften difficult to learnDesigned to help retain useful long contextDesigned to help retain useful long context
Parameters at equal dimensionsUsually fewestUsually most of these threeUsually between vanilla RNN and LSTM
Typical choiceSimple short sequencesComplex long-context sequencesEfficient gated sequence baseline

With input size d and hidden size H, a basic single-bias vanilla recurrent layer has H(d+H+1) parameters; a standard LSTM has 4H(d+H+1); a basic GRU has 3H(d+H+1). These omit output layers; library versions with extra bias vectors differ. The factor four in LSTM counts three gates plus one candidate transform.

Compare what is carried through time and how many gate or candidate transforms are used. Tap the diagram to enlarge.