Deep Learning · TEE · section
Recurrent networks: the complete relationship
Recurrent neural networks
A vanilla RNN repeatedly combines the new input and previous hidden state with shared weights. Backpropagation through time accumulates contributions from every use of those shared weights. LSTM adds an explicit cell state with forget, input and output gates. GRU mixes an old hidden state and a candidate using reset and update gates.
For every recurrent calculation, compute the gate or hidden preactivation first, apply its stated activation, then combine the resulting values. Elementwise gate multiplication is different from matrix multiplication. The stated GRU update convention determines whether z retains the old state or selects the candidate.