ML Assignment 8 - Add regularization to cost function and gradient