Using Machine Learning to Solve Nonpolynomial Problems