Gradient descent in Python.