Modified quasi-Newton methods for training neural networks