Compiling and training a Keras neural network