On Learning Informative Trajectory Embeddings for Imitation, Classification and Regression