Learning-Based Optimal Control