GRU Parameters Calculator
Calculate the number of trainable parameters in a GRU layer.
About GRU Parameters Calculator
A GRU has 3 gates (reset, update, new), each with input-to-hidden and hidden-to-hidden weight matrices. Total parameters = 3 × (input_size × hidden_size + hidden_size²) + biases. GRUs have 75% of LSTM parameters (3 gates vs 4).
Formula
GRU Parameters
params = 3 × (input_size × hidden_size + hidden_size^2) + 3 × 2 × hidden_size
- 3
- Number of gates (reset, update, new)
Worked example
With the default values below, GRU Parameters Calculator returns Total Parameters of 1,182,720. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Input Sizeminimum 1
- 256
- Hidden Sizeminimum 1
- 512
- Include Biasone of Yes, No
- Yes
Results
- Total Parameters
- 1,182,720
- Weight Parameters
- 1,179,648
Step by step
- 1GRU has 3 gates: reset, update, new= 3
- 2Weight params: 3 × (input×hidden + hidden²)= 1,179,648
- 3Total= 1,182,720
Assumptions and limits
- The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
How do GRU parameters compare to LSTM?
GRUs have 3 gates vs LSTMs' 4 gates, so GRUs have 75% the parameters of an equivalently-sized LSTM. GRUs often match LSTM performance with fewer parameters.
When should I use GRU vs LSTM?
GRUs are preferred when you want fewer parameters and faster training. LSTMs may perform slightly better on very long sequences due to their separate cell state mechanism.
Related Calculators
- RNN Parameters Calculator
- LSTM Parameters Calculator
- Parameter Count Calculator
- Trainable Parameters Calculator
- Embedding Layer Size Calculator
- Dense Layer Parameters Calculator
- Multi-head Attention Parameters Calculator
- Transformer Parameters Calculator
- Average Pool Output Calculator
- CNN Output Shape Calculator
You might also need
- RNN Parameters CalculatorCommonly used together
- LSTM Parameters CalculatorCommonly used together
- Parameter Count CalculatorCommonly used together
- Multi-head Attention Parameters CalculatorAlso in Neural Networks
- CNN Parameter Count CalculatorAlso in Neural Networks
- Trainable Parameters CalculatorAlso in Neural Networks
