There is an error in the hidden layer calculations but the linear learning of a non-hidden layer output is perfect