Computing loss + L2 regularization