Conditional updates of neural network weights for increased out of training performance