Controlling Mechanical Systems with Learned Models: A Machine Learning Approach