code for manifold learning of image patches