Finish gradient descent