A phase transition in sampling from Restricted Boltzmann Machines