This paper presents a method to imitate flatness-based controllers for mobile robots using neural networks. Sample case studies for a unicycle mobile robot and an unmanned aerial vehicle (UAV) quadcopter are presented. The goals of this paper are to (1) train a neural network to approximate a previously designed flatness-based controller, which takes in the desired trajectories previously planned in the flatness space and robot states in a general state space, and (2) present a dynamic training approach to learn models with high-dimensional inputs. It is shown that a simple feedforward neural network could adequately compute the highly nonlinear state variables transformation from general state space to flatness space and replace the complicated designed heuristic to avoid singularities in the control law. This paper also presents a new dynamic training method for models with high-dimensional independent inputs, serving as a reference for learning models with a multitude of inputs. Training procedures and simulations are presented to show both the effectiveness of this novel training approach and the performance of the well-trained neural network.