freecoding.school100% FREE · NO SIGNUP
Tensor TownISSUE #41 of 120

grus · simpler gated recurrence

NeuraVSThe Overfit Ogre
Neura saysGRUs are a simpler, faster gated RNN — fewer gates than an LSTM, often comparable results.

The Gated Recurrent Unit merges the LSTM's gates into two (reset and update) and drops the separate cell state. Fewer parameters means faster training and less data, often matching LSTM performance on many tasks. When you need a gated RNN, GRU is the lighter default; LSTM the heavier option for the longest dependencies. Both were largely superseded by transformers.

Power-ups you unlock

The Overfit Ogre attacks — common mistakes

Boss battleContrast a GRU and an LSTM in gate count and complexity.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>LSTM: 3 gates + cell state (heavier)
GRU:  2 gates, no cell state (lighter, faster)
often comparable accuracy</pre></body></html>
▶ Open the interactive comic issue
‹ Lstms · Gates · Long-Term MemorySeq2seq · Encoder-Decoder ›