One iteration of neural network training