End-to-End Optimization of Deep Learning Applications