Entropy and the spectral action in noncommutative geometry