Machine learning gradient descent and quasi-Newton