Compiling and training the model