# How many parameters are in a gated recurrent unit (GRU) recurrent neural network (RNN) layer?

The title says it all -- how many trainable parameters are there in a GRU layer? This kind of question comes up a lot when attempting to compare models of different RNN layer types, such as long short-term memory (LSTM) units vs GRU, in terms of the per-parameter performance. Since a larger number of trainable parameters will generally increase the capacity of the network to learn, comparing alternative models on a per-parameter basis is an apples-to-apples comparison of the relative effectiveness of GRUs and LSTMs.

... the total number of parameters in the GRU RNN equals $3 \times (n^2 + nm + n)$.
where $m$ is the input dimension and $n$ is the output dimension. This is due to the fact that there are three sets of operations requiring weight matrices of these sizes.