Learning representations from motion trajectories