Project DelphiTensors Workshop

This is a recurrent neural network

W, U = np.random.randn(4, 4) * 0.5, np.random.randn(4, 3) * 0.5 h = np.zeros(4) for t in range(6): h = np.tanh(W @ h + U @ xs[t]) # same W and U every step

A hidden state h, updated by the same weights at every step. That is the whole structure, and you have already built it twice today — once for Fibonacci, once for the airline forecast.

The only additions an RNN makes are the non-linearity tanh and a second matrix U that lets new input enter at each step.