The final stage of the LSTM is the output gate, and its purpose is to update the short-term memory. To achieve this, we take the newly generated long-term memory and process it through a hyperbolic tangent (tanh) function creating a potential new short-term memory. We then multiply this potential memory by the output of the Sigmoid function (σo). This multiplication generates the final output as well as the input for the next hidden cell (h⟨t⟩) within the LSTM cell.
We have
o(t)=σg(Wox(t)+Uoh(t−1)+bo),h(t)=o(t)⊗σh(c(t)).where Wo,Uo are the weights of the output gate and bo is the bias of the output gate.