Counting the learnable functions of geometrically structured data