Foundations of Deep Learning