Optimization of a Learned Dynamic Model for Inverted Pendulum