WIP: computing the cost function for a neural network