implemented neural network backpropagation and regularized gradient