Manifold Learning via Memory and Context