Machine learning accelerates discovery of infrared functional materials