Understanding Machine Learning: From Theory to Algorithms