GRU

Recurrent · node type · GRU

A lighter gated recurrent layer: two gates and no separate cell, often as good as an LSTM.

Also called Gated recurrent unit

Figure 1. GRU inside Restore punctuation in a transcript, a real model in WeightSpace. The 2 outlined nodes are GRU; select any node for its shapes and parameters.

What it does

A GRU keeps a single hidden state. An update gate z blends the previous state with a new candidate, and a reset gate r decides how much of the previous state the candidate may look at. When z stays near one, the old state passes through untouched, which gives the GRU long memory with fewer parameters than an LSTM. It is common in streaming audio models, where each step must be cheap.

Formula

zt = σ(Wz xt + Rz ht−1 + bz), rt = σ(Wr xt + Rr ht−1 + br)ĥt = tanh(Wh xt + Rh (rt ⊙ ht−1) + bh)ht = (1 − zt) ⊙ ĥt + zt ⊙ ht−1

Shapes and parameters

Shapes
Input [T, N, I]; hidden state [D, N, H]; output of every step [T, D, N, H].
Parameters
3H × (I + H) weights plus 6H biases per direction in ONNX. With I = 64 and H = 64: 24,576 + 384 = 24,960.
Used for
Streaming speech enhancement (GTCRN), keyword spotting, and small sequence models on devices.

Figure 2. The typed ports of GRU, in the same format as every model drawing. Letters such as N or C stand for any size.

In WeightSpace

Read-only in WeightSpace today. The speech enhancement model in the catalog is edited at a normalization bias in its decoder, after its recurrent layers.