Autonomous Motion Learning For Near Optimal Control