THINNs: Thermodynamically Informed Neural Networks