Learning to combine foveal glimpses with a third-order Boltzmann machine