Forward inference (mapping a sequence of inputs to a sequence of outputs) in an RNN is nearly identical to what we've already seen with feedforward networks. To compute an output y t for an input x t , we need the activation value for the hidden layer h t . To calculate this, we multiply the input x t with the weight matrix W, and the hidden layer from the previous time step h t−1 with the weight matrix U. We add these values together and pass them through a suitable activation function, g, to arrive at the activation value for the current hidden layer, h t . Once we have the values for the hidden layer, we proceed with the usual computation to generate the output vector.