Learning on a Torus