Using a neural network to learn the Q function