Hardware-Aware Machine Learning: Modeling and Optimization