Learning Low-Dimensional Latent Representations of Demonstrated Trajectories for Robots