Added code for training the handwritten neural network.