learning a generative motion model from sequence based on a latent motion matrix