An Introduction to Optimization : With Applications to Machine Learning