Using learners and trainers to optimize the parameters in a neural network