Added function to compute neural network outputs