Fitting Models and Controlling Complexity: Gradient Descent and Regularization