regularized neural network cost fcn with test