The Back propagation through time on recurrent layer is defined similar to normal one, means somethin like
self.deltas[x] = self.deltas[x+1].dot(self.weights[x].T) * self.layers[x] * (1- self.layers[x])
where
self.deltas[x+1]
is error from prevous layer, self.weights[x]
is weights map and self.layers[x](1- self.layers[x])
is bakwards activation of sigmoid function where self.layers[x]
is vector of sigmoid. But while normal backpropagation the values are there, while BPTT i can not take the current self.layers[x]
: i need the previous ones, right ?
So unlike normal BP, do i need extra store old weights and layers, for example in circular queue, and then apply the formula where self.deltas[x+1]
is layer from next time ?
Not realy implementation, just basic understanding in order to can implement it.
Lets see the picture:
Here are : self.layers[0] = $x_{t+1}$, self.layers[1] = $h_{t+1}$ , self.layers[2] = $o_{t+1}$, in order to perform backprop $h_{t+1}$ -> $h_{t}$ -> $h_{t-1}$... I DO NEED to have layers $h_t$ ,$h_{t-1}$... and weights $v_{t+1}$, $v_t$... EXTRA stored in additional to the network $x_{t+1}$ -> $h_{t+1}$ -> $o_{t+1}$, right? Thats all the question.
And i do not need to store previous outputs $o[t, o_{t-1}, etc..]$, because backprop from them ot->ht, etc was already calculated.