Machine Learning for Harnessing Thermal Energy: From Materials Discovery to System Optimization.