How to create and train a neural network in Python