EX4: regularized neural network cost function

* Adds regularization to cost function.