Training Gaussian Process Regression Models Using Optimized Trajectories