When Edge Meets Learning: Adaptive Control for Resource-Constrained Distributed Machine Learning