Generative Temporal Models with Memory