Create neuralNetworkCostFunction