On-Device Machine Learning: An Algorithms and Learning Theory Perspective