Equilibriumandnon-Equilibriumregimesinthe learningofRestrictedBoltzmannMachines