Skip to content
Calcrivo

GRU Parameters Calculator

Calculate the number of trainable parameters in a GRU layer.

Inputs

Total Parameters

1,182,720

Weight Parameters

1,179,648

Step by step

  1. GRU has 3 gates: reset, update, new

    gates = 3

    = 3

  2. Weight params: 3 × (input×hidden + hidden²)

    3 × (256×512 + 512×512)

    = 1,179,648

  3. Total

    1,179,648 + 3,072

    = 1,182,720

How it works

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)

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.

You might also need