In the GRU unit we had the memory function value always equal to the activation value . For LSTM that would not be the case. So the equation to find the candidate value becomes
Here we have two update gates to update the value of the memory function.
This is also known as the update gate.
is known as the forget gate.
So we calculate the new value of the memory function as follows :
Also in order to get the new activation value we use a output gate.
So in short we have the previous values of the activation and memory cell i.e. and respectively as the input. We use the inputs to calculate the values of all three gate (update, forget, output) and the candidate function. We then use this gate value along with the inputs to calculate the new activation and memory function value.
Now let us look at Bidirectional and Deep RNN.