Theory of Convex Optimization for Machine Learning