% Small choose
$$
With the gates, we can update the cell state and the hidden state as follows.
The inclusion of the three gates and the memory cell has some pros and cons:
We can also increase the depth of the RNN by stacking multiple hidden layers on top of each other:
Depending on the application/task, there are several variants of RNNs:
The official PyTorch documentation and d2l.ai
provide several examples of RNNs and LSTMs: