Algorithms to optimize gradient descent