Calculate network output